You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/01/28 12:30:59 UTC

[BUG]: "DocumentRoot behaves strangely within VirtualHost" on Irix (fwd)

---------- Forwarded message ----------
Date: Mon Jan 27 14:07:19 1997
From: bentlema@cs.umn.edu
To: apache-bugs%apache.org@organic.com
Subject: [BUG]: "DocumentRoot behaves strangely within VirtualHost" on Irix

Submitter: bentlema@cs.umn.edu
Operating system: Irix, version: 6.2
Version of Apache Used: 1.2b6
Extra Modules used: 
URL exhibiting problem: 

Symptoms:
--
When specifying DocumentRoot within a VirtualHost
declaration, the URL *MUST* match the ServerName
specified.  This is a problem specific to using
VirtualHosts.  I'm running another apache server
without VirtualHosts, and I can specify URL's like:
http://www/
http://www.cs/
http://www.cs.umn.edu/
And they all resolv to the full host name, and
the index.html loads each time.  This is not the
case when using virtual hosts...

For example, if I Have:

<VirtualHost winter.cs.umn.edu>
   ServerName winter.cs.umn.edu
   DocumentRoot /export/servers/web/root/htdocs
</VirtualHost>

And try to access http://winter/ I get the following
error in my log:  

    access to /usr/local/etc/httpd failed for 
    melange.cs.umn.edu, reason: File does not exist

But when I access http://winter.cs.umn.edu/ it
works fine.  *BUT* if I change the ServerName to
simple "winter" (without the .cs.umn.edu) the
problem is exactly reversed.


===========

Symptoms:
--
This is some more info on my previous bug report:

Adding a "global" DocumentRoot (ouside of the 
VirtualHost) sortof fixes the problem.  It acts
as a "fall-back" DocumentRoot.

For example:  
   When I access: http://winter/ 
              or: http://winter.cs/

   I get the global DocumentRoot.  But when
    I access: http://winter.cs.umn.edu/
    I get the DocumentRoot specified within
    the VirtualHost declaration.

Also, ServerName doesn't affect the behavior of
DocumentRoot outside the VirtualHost declaration,
as it *DOES* withing a VirtualHOst declatation.
--


Re: [BUG]: "DocumentRoot behaves strangely within VirtualHost" on Irix (fwd)

Posted by Dean Gaudet <dg...@arctic.org>.
This might be resolved by replacing the hostname in the VirtualHost line
with the ip address.  It's also worth noting that it's just not possible
for the server to know the client's resolving order... and the Host: 
header doesn't require a FQDN.  This is a really typical problem in my
experience.  I'm not sure we can accomodate named-vhosts and ip-vhosts in
a manner that's backwards compatible with 1.0 configs. 

The ServerAlias directive would also be useful here.

Dean

On Tue, 28 Jan 1997, Rob Hartill wrote:

> 
> ---------- Forwarded message ----------
> Date: Mon Jan 27 14:07:19 1997
> From: bentlema@cs.umn.edu
> To: apache-bugs%apache.org@organic.com
> Subject: [BUG]: "DocumentRoot behaves strangely within VirtualHost" on Irix
> 
> Submitter: bentlema@cs.umn.edu
> Operating system: Irix, version: 6.2
> Version of Apache Used: 1.2b6
> Extra Modules used: 
> URL exhibiting problem: 
> 
> Symptoms:
> --
> When specifying DocumentRoot within a VirtualHost
> declaration, the URL *MUST* match the ServerName
> specified.  This is a problem specific to using
> VirtualHosts.  I'm running another apache server
> without VirtualHosts, and I can specify URL's like:
> http://www/
> http://www.cs/
> http://www.cs.umn.edu/
> And they all resolv to the full host name, and
> the index.html loads each time.  This is not the
> case when using virtual hosts...
> 
> For example, if I Have:
> 
> <VirtualHost winter.cs.umn.edu>
>    ServerName winter.cs.umn.edu
>    DocumentRoot /export/servers/web/root/htdocs
> </VirtualHost>
> 
> And try to access http://winter/ I get the following
> error in my log:  
> 
>     access to /usr/local/etc/httpd failed for 
>     melange.cs.umn.edu, reason: File does not exist
> 
> But when I access http://winter.cs.umn.edu/ it
> works fine.  *BUT* if I change the ServerName to
> simple "winter" (without the .cs.umn.edu) the
> problem is exactly reversed.
> 
> 
> ===========
> 
> Symptoms:
> --
> This is some more info on my previous bug report:
> 
> Adding a "global" DocumentRoot (ouside of the 
> VirtualHost) sortof fixes the problem.  It acts
> as a "fall-back" DocumentRoot.
> 
> For example:  
>    When I access: http://winter/ 
>               or: http://winter.cs/
> 
>    I get the global DocumentRoot.  But when
>     I access: http://winter.cs.umn.edu/
>     I get the DocumentRoot specified within
>     the VirtualHost declaration.
> 
> Also, ServerName doesn't affect the behavior of
> DocumentRoot outside the VirtualHost declaration,
> as it *DOES* withing a VirtualHOst declatation.
> --
> 
> 


Re: [BUG]: "DocumentRoot behaves strangely within VirtualHost" on Irix (fwd)

Posted by Marc Slemko <ma...@znep.com>.
I am seeing more and more of these reports due to conflicts between what a
user thinks is a virtual server and what the server does.  This is, of
course, caused by the "non-IP intensive virtualhost support".  

Perhaps either the syntax needs to be changed or the server can be tweaked
to make this less likely?

On Tue, 28 Jan 1997, Rob Hartill wrote:

> 
> ---------- Forwarded message ----------
> Date: Mon Jan 27 14:07:19 1997
> From: bentlema@cs.umn.edu
> To: apache-bugs%apache.org@organic.com
> Subject: [BUG]: "DocumentRoot behaves strangely within VirtualHost" on Irix
> 
> Submitter: bentlema@cs.umn.edu
> Operating system: Irix, version: 6.2
> Version of Apache Used: 1.2b6
> Extra Modules used: 
> URL exhibiting problem: 
> 
> Symptoms:
> --
> When specifying DocumentRoot within a VirtualHost
> declaration, the URL *MUST* match the ServerName
> specified.  This is a problem specific to using
> VirtualHosts.  I'm running another apache server
> without VirtualHosts, and I can specify URL's like:
> http://www/
> http://www.cs/
> http://www.cs.umn.edu/
> And they all resolv to the full host name, and
> the index.html loads each time.  This is not the
> case when using virtual hosts...
> 
> For example, if I Have:
> 
> <VirtualHost winter.cs.umn.edu>
>    ServerName winter.cs.umn.edu
>    DocumentRoot /export/servers/web/root/htdocs
> </VirtualHost>
> 
> And try to access http://winter/ I get the following
> error in my log:  
> 
>     access to /usr/local/etc/httpd failed for 
>     melange.cs.umn.edu, reason: File does not exist
> 
> But when I access http://winter.cs.umn.edu/ it
> works fine.  *BUT* if I change the ServerName to
> simple "winter" (without the .cs.umn.edu) the
> problem is exactly reversed.
> 
> 
> ===========
> 
> Symptoms:
> --
> This is some more info on my previous bug report:
> 
> Adding a "global" DocumentRoot (ouside of the 
> VirtualHost) sortof fixes the problem.  It acts
> as a "fall-back" DocumentRoot.
> 
> For example:  
>    When I access: http://winter/ 
>               or: http://winter.cs/
> 
>    I get the global DocumentRoot.  But when
>     I access: http://winter.cs.umn.edu/
>     I get the DocumentRoot specified within
>     the VirtualHost declaration.
> 
> Also, ServerName doesn't affect the behavior of
> DocumentRoot outside the VirtualHost declaration,
> as it *DOES* withing a VirtualHOst declatation.
> --
>