Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Strange problem with virtual hosts

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
very strange... multiple name based virtual hosts seem to .. - Hi there, It is said overall that multiple name based virtual hosts can't work with ssl (see for example but I got it work with apache 2... From ..

Virtual Hosts Problem - Hi Group, I'm having trouble getting Virtual Hosts to work on my Mandrake 9,1 box. I'm using the Advx release of Apache for Mandrake, and it switches between 1.3x and 2.0.x 2.0.44) by executing one of two scripts. I've followed a lot of the..

virtual hosts problem.. - hi, After Kerio + windows managed to delete my whole I've had to reinstall the lot.. However, I'm having a few problems with stuff... I have the virtual hosts working again, but cgi scripts are not working in all of them... I have WinXP +..

rewrite problem with name virtual hosts - Hi list, i have a little problem. I am using Apache 1.3, php4 perl and ssl. I've got several name virtual hosts all listen on the same ip address. I use mod rewrite to simulate static web pages. I put in the same rewrite rules in a couple of virtual..

Problem with Virtual Hosts for Windows on Apache 2 - I cannot get the virutal hosts to work with Apache2 on my windows server. This is the I have. Does anyone have a Win2K machine? ..
Author Message
nobschlaakspam

External


Since: Oct 15, 2003
Posts: 6



(Msg. 1) Posted: Thu Dec 11, 2003 8:11 pm
Post subject: Strange problem with virtual hosts
Archived from groups: alt>apache>configuration (more info?)

Hi!

I'm going mad. Really. All the day working on apache but it still does not want to do its job ...

I have the following:

Apache/1.3.27 (Unix) Debian GNU/Linux
Kernel 2.4.18

/etc/apache/httpd.conf:
----- 8< -----
[...]

<Directory /var/www/vhosts>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride All
</Directory>

UseCanonicalName Off

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteLog /var/log/apache/rewrite.log
RewriteLogLevel 1

RewriteCond %{SERVER_NAME} ^([^.]+)\.([^.]+)$ [NC]
RewriteRule ^(.*)$ /var/www/vhosts/%2/%1/htdocs$1
</IfModule>

NameVirtualHost *

<VirtualHost _default_:*>
ServerName foo.example.com
ServerAdmin webmaster DeleteThis @example.com

DocumentRoot /var/www/htdocs
ErrorLog /var/log/apache/error.log
CustomLog /var/log/apache/access.log full

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions inherit
</IfModule>
</VirtualHost>

Include /etc/apache/vhosts.conf

[...]
----- >8 -----

/etc/apache/vhosts.conf:
----- 8< -----
[...]

<VirtualHost *>
ServerName example.net
ServerAlias *.example.net
ServerAdmin webmaster DeleteThis @example.net

DocumentRoot "/var/www/vhosts/net/example/htdocs"
VirtualDocumentRoot "/var/www/vhosts/%-1/%-2/%-3+/htdocs"
ErrorLog "/var/www/vhosts/net/example/error.log"
CustomLog "/var/www/vhosts/net/example/access.log" full

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions inherit
</IfModule>
</VirtualHost>

[...]
----- >8 -----

When I try to access "http://www.example.net/" (yes, it's resolved correctly), I see the default page which lies in
/var/www/htdocs - and not the stuff from /var/www/vhosts/net/example/www/htdocs (as it should be).
Furthermore Apache writes the following into its /var/log/apache/error.log (that's true - the global error log, not the one I
defined in the VirtualHost container):

/var/log/apache/error.log:
----- 8< -----
[...]

No directory () for Hostname www.example.net
No directory () for Hostname www.example.net
No directory () for Hostname www.example.net
No directory () for Hostname www.example.net
No directory () for Hostname www.example.net
No directory () for Hostname www.example.net

[...]
----- >8 -----

Yes, six times. Strange?!


When I try to access "http://example.net/", I see the stuff which is in /var/www/vhosts/net/example/htdocs (as it should be) - but
it's logged in /var/log/apache/access.log ... and not in /var/www/vhosts/net/example/access.log (although I defined this in
vhosts.conf).


Now my questions:

- Why can't I access the subdomains of my virtual hosts?

- What does this strange error message "No directory () for Hostname www.example.net" mean? I did not find anything on google ...

- Why is logging done into the global access.log and not into the file I defined in the VirtualHost container?

- Can anyone help me please?


Thank you in advance!


Bjoern

 >> Stay informed about: Strange problem with virtual hosts 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Thu Dec 11, 2003 9:14 pm
Post subject: Re: Strange problem with virtual hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Björn Schlaak" <NObschlaakSPAM.RemoveThis@gmx.de> wrote:
 > DocumentRoot /var/www/htdocs
 > /etc/apache/vhosts.conf:
 > DocumentRoot "/var/www/vhosts/net/example/htdocs"
 > VirtualDocumentRoot "/var/www/vhosts/%-1/%-2/%-3+/htdocs"

Don't mix DocumentRoot and VirtualDocumentRoot, and remove the " "

Davide<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Strange problem with virtual hosts 
Back to top
Login to vote
nobschlaakspam

External


Since: Oct 15, 2003
Posts: 6



(Msg. 3) Posted: Tue Dec 16, 2003 8:40 pm
Post subject: Re: Strange problem with virtual hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,

"Davide Bianchi" <davideyeahsure.RemoveThis@onlyforfun.net> wrote in news:brac6o$17ok9$1@ID-18487.news.uni-berlin.de...
 > "Björn Schlaak" <NObschlaakSPAM.RemoveThis@gmx.de> wrote:
  > > DocumentRoot /var/www/htdocs
  > > /etc/apache/vhosts.conf:
  > > DocumentRoot "/var/www/vhosts/net/example/htdocs"
  > > VirtualDocumentRoot "/var/www/vhosts/%-1/%-2/%-3+/htdocs"
 >
 > Don't mix DocumentRoot and VirtualDocumentRoot, and remove the " "

But I need a DocumentRoot directive ... because when I omit it, the environment variable $DOCUMENT_ROOT is not the actual document
as it should be (according to VirtualDocumentRoot), but the default document root of the default server. Or do you know any other
solution to this problem?

And the " " were not the problem either.

I found the error by myself:

In my /etc/apache/httpd.conf I wrote "NameVirtualHost *" and "<VirtualHost _default_:*>". First I did not use any port and in the
default VirtualHost container I did. That was the problem. Apache did not recognize that ":*" means "every port". Sad. But true.


 > Davide

Björn<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Strange problem with virtual hosts 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]