Jump to content

httpd.conf and virtual directory conf files? Apache 2.2 question


bbiandov

Recommended Posts

Based on the main httpd.conf file one would use extra\httpd-vhosts.conf to specify virtual directories.

 

The main file says that if a server name does not match any of the virtual servers defined, apache will default to the root dir specified in the "main" config file.

 

That is NOT happening.

 

If a server name doesnt match any of the virtual directories defined in httpd-vhosts.conf , apache assumes that the root dir is the same as the one specified within the first defenition (the one at the top of the httpd-vhosts.conf file)

 

What am I missing?

That is correct. If you want to use any vhosts you need to make all your sites (including the default) vhosts.

 

Thanks, so just to be clear - we now know that the server behaves in the way we described. No questions there. I just want to see if there is a reason why Apache conf file comments state the following:

 

# 'Main' server configuration

#

# The directives in this section set up the values used by the 'main'

# server, which responds to any requests that aren't handled by a

# <VirtualHost> definition.  These values also provide defaults for

# any <VirtualHost> containers you may define later in the file.

#

# All of these directives may appear inside <VirtualHost> containers,

# in which case these default settings will be overridden for the

# virtual host being defined.

#

 

#

# ServerAdmin: Your address, where problems with the server should be

# e-mailed.  This address appears on some server-generated pages, such

# as error documents.  e.g. [email protected]

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.