This is a discussion on Virtual Hosts definition outside of httpd.conf within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi all, When I define a VirtualHost in a config file that is included into httpd.conf with Include, it ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi all,
When I define a VirtualHost in a config file that is included into httpd.conf with Include, it uses that as the default host. However, when I put that exact same definition into httpd.conf, it works as expected. To clarify: httpd.conf: Listen x.x.x.x:p DocumentRoot /the/right/path Include virthosts.conf virthosts.conf: <VirtualHost x.x.x.x> DocumentRoot /foo/bar ServerName name.tld </VirtualHost> The above definition will use /foo/bar as DocumentRoot, when accessing the server with its IP address. This setup: httpd.conf: Listen x.x.x.x:p DocumentRoot /the/right/path <VirtualHost x.x.x.x> DocumentRoot /foo/bar ServerName name.tld </VirtualHost> Will use /the/right/path as DocumentRoot when accessing the server with its IP address. Can anyone shed some light on this? In my opinion they should *both* use /the/right/path as DocumentRoot. TIA Bart Friederichs |
|
|||
|
Davide Bianchi wrote:
> On 2005-11-15, Bart Friederichs <bf@tbwb.nl> wrote: > >>httpd.conf: >> Listen x.x.x.x:p >> DocumentRoot /the/right/path >> >> <VirtualHost x.x.x.x> > > > I think that in this case, in your httpd.conf there is a "NameVirtualHost" > directive missing, hence your vhost is not used at all. The NameVirtualHost is there. All other virtual hosts work correctly. The two config files are entirely identical, except for the fact that in one case everything is in httpd.conf and in the other a part is in another config file, that is included in httpd.conf. Bart |
| Thread Tools | |
| Display Modes | |
|
|