bbiandov Posted May 13, 2008 Share Posted May 13, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/105358-httpdconf-and-virtual-directory-conf-files-apache-22-question/ Share on other sites More sharing options...
trq Posted May 13, 2008 Share Posted May 13, 2008 That is correct. If you want to use any vhosts you need to make all your sites (including the default) vhosts. Quote Link to comment https://forums.phpfreaks.com/topic/105358-httpdconf-and-virtual-directory-conf-files-apache-22-question/#findComment-539790 Share on other sites More sharing options...
bbiandov Posted May 13, 2008 Author Share Posted May 13, 2008 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. admin@your-domain.com Quote Link to comment https://forums.phpfreaks.com/topic/105358-httpdconf-and-virtual-directory-conf-files-apache-22-question/#findComment-540035 Share on other sites More sharing options...
bbiandov Posted May 17, 2008 Author Share Posted May 17, 2008 So it would appear then one is unable to have a "catch-all" root and in addition to that a few explicit site configs with their own roots? Quote Link to comment https://forums.phpfreaks.com/topic/105358-httpdconf-and-virtual-directory-conf-files-apache-22-question/#findComment-543645 Share on other sites More sharing options...
trq Posted May 18, 2008 Share Posted May 18, 2008 yes, the fist VirtualHost you define will be your catch all. Quote Link to comment https://forums.phpfreaks.com/topic/105358-httpdconf-and-virtual-directory-conf-files-apache-22-question/#findComment-544140 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.