LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   virtual host going to different directory (https://www.linuxquestions.org/questions/red-hat-31/virtual-host-going-to-different-directory-353503/)

ekrumm 08-15-2005 12:46 PM

virtual host going to different directory
 
Why would a virtual host serve pages from a directory other than the one specified in the httpd.conf?

thanks!

PenguinPwrdBox 08-16-2005 09:48 PM

Could you be more specific?

ekrumm 08-17-2005 07:45 AM

PenguinPwrdBox,
It is working now...I don't know why. The only difference between now and yesterday is where the NameVirtualHost line is. Yesterday it was above all of the virtualhost containers, today it's just above the affected containers.
I was trying to set up name based virt hosting but Apache would serve the default no content (Welcome to Red Hat...) page even though the docroot specified had pages. It wouldn't even do a dir list if I enabled it. What would overide the documentroot that I put in the virtualhost container? Does it matter if the NameVirtualHost line is above all of the virtualhost entries instead of being directly above the ones targetted?

thanks!

From the httpd.conf:

NameVirtualHost 12.163.x.x # yesterday this line was above all the virtualhost, today it is here.
<VirtualHost 12.163.x.x>
DocumentRoot "/var/www/site1"
ServerName store.site1.net
DirectoryIndex index.php index.html
<Directory "/var/www/site1">
allow from all
Options -Indexes
</Directory>
</VirtualHost>

<VirtualHost 12.163.x.x>
DocumentRoot "/var/www/site2"
ServerName fat.site2.net
DirectoryIndex index.php index.html
<Directory "/var/www/site2">
allow from all
Options -Indexes
</Directory>
</VirtualHost>

XOR007 08-20-2005 11:21 AM

I didn't know I could put <Directory> directives inside a vhost section. I'll try that!


All times are GMT -5. The time now is 10:47 PM.