Friday, January 19, 2007

You don't have permission to access / on this server.

I'm trying to work with Apache in a VMware virtual machine to test configuring virtual hosts. My document root is the default "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs" however I wanted to put my virtual site in a completely different location, such as: C:\ |-Program Files\ |-HostedWebSites\ |--Site1\ |--Site2\ |--Site2\ I then modified the httpd.conf file to include the /extra/httpd-vhosts.conf and added three blocks with the unique DocumentRoot and ServerName. Then I added the hostname I wanted to use for each one to my HOSTS file, reloaded the HOSTS file (nbtstat -R) and tried to browse to my three virtual hosts only to receive the following error: Forbidden You don't have permission to access / on this server. Funny thing was if I moved the sites under the "htdocs" directory it would work fine, so it was a permissions problem, but everything in Windows look right. I finally was able to get it working, I think the right way, by adding the following block to each block: DocumentRoot "C:/WebSiteHosting/Site1" ServerName Site1 ErrorLog logs/Site1-error_log CustomLog logs/Site1-access_log common Site1"> Order Deny,Allow Allow from all