04-20-2011, 11:29 PM #1Newbie
- Join Date
- Apr 2011
Apache Virtual Host Mapping to the Wrong Directory
Hello Again ... My last post was so successful, I figured I would give this another shot.
I am running an Apache service on CentOS. Apache is more or less a base install using Yum. I have, however, enabled virtual hosting by uncommenting:
Now, it seems to be working ... kinda. The virtual host is picking up, and pointing me 'almost' to the correct directory, but unfortunately it points one directory higher than it is supposed to ... not at all sure why.
Here is my Virtual Host Definition:
<VirtualHost *:80> ServerName mizozo.net ServerAlias *.mizozo.net ServerAdmin [email protected] ErrorLog /var/log/httpd/mizozo.net.error.log CustomLog /var/log/httpd/mizozo.net.custom.log combined DocumentRoot /var/www/html/mizozo.net/htdocs/ <Directory "/var/www/html/mizozo.net/htdocs/"> DirectoryIndex index.php Order allow,deny Allow from all </Directory> </VirtualHost>
Everything from the directory mizozo.net and down is recursively owned by apache:apache. Whats worse, if I manually go to <domain>/htdocs/index.php, I get nothing.
Also, the error-log repeats this a lot:
Directory index forbidden by Options directive: /var/www/html/mizozo.net/
I have tried several things ... trailing slash at the end of the directory, fiddling with the <directory> section, removing the <directory> section ... just don't know. It is probably something stupid, as it usually is, but I am not a server guy and just don't see it.
Thanks again for looking ...
04-21-2011, 01:09 AM #2Intangible Asset Appraiser
- Join Date
- Mar 2009
- Austin Tx
What files do you have in ....../htdocs target folder? You mentioned an index.php, is there anything in it?
"Directory index forbidden..." means you are not hitting a default index for whatever, and instead of displaying an index of files, your Options directive for that folder don't allow it.
It really looks like nothing in in the /mizozo.net directory (or no index file at least). Starting to think you may have conflicting Virtualhost entries? Is there another in the conf file?
You can override and see if you get a directory index with this - go back up the conf file and find your global docroot and it's Dir Options directive:
Options Indexes FollowSymLinks MultiViews
If you have to, you can add that Options directive line to your show existing <directory> entry for that vhost, just to test. Not a good practice to allow dir indexing by default, though.This is the best signature in the world....Tribute!
(It is not the best signature in the world, no. This is just a tribute)
By 1EightT in forum Dedicated ServerReplies: 5Last Post: 03-20-2007, 12:01 PM
By MankeyMonkey in forum Web HostingReplies: 4Last Post: 08-14-2005, 07:32 PM
By EstSolarus in forum Web HostingReplies: 8Last Post: 03-01-2005, 02:40 PM
By fozzy in forum Programming DiscussionReplies: 6Last Post: 09-01-2004, 11:03 AM
By Mans in forum Hosting Security and TechnologyReplies: 3Last Post: 09-17-2003, 02:46 PM