Forum Moderators: phranque
I am using the latest version of Apache (downloaded today) on Windows XP. I have setup a virtual host for a website hosted in the /httpd/testing/wwwroot/ directory on my computer. I have commented IN the following line in httpd.conf:
Include conf/extra/httpd-vhosts.conf And I have added the required VirtualHost entries to the httpd-vhosts.conf file:
NameVirtualHost *:80 <VirtualHost *:80> </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@localhost.testing DocumentRoot /httpd/testing/wwwroot/ ScriptAlias /cgi-bin/ /httpd/testing/wwwroot/cgi-bin/ DirectoryIndex index.html ServerName localhost.testing ErrorLog logs/localhost.testing-error_log CustomLog logs/localhost.testing-access_log common </VirtualHost> Accessing [localhost...] works fine but [localhost.testing...] gives me a 403 Forbidden error. If I set the DocumentRoot directive to the same as in the main httpd.conf (<installation directory>/htdocs) it works fine. I've also tried creating an index.html file in <installation directory>/htdocs/x and using this as the DocumentRoot. This works fine too.
The only conclusion I can come to is that it is down to permissions on the folder. But so far as I am aware Apache has access to read the folder I have directed it to.
Please anyone who can help I would greatly appreciate it as I need to get this fixed ASAP.
Thanks
Jay
<Directory />
...
Deny from all
</Directory>
You need to create another <Directory> directive of
<Directory /httpd/testing/wwwroot>
... (whatever options you want)
Allow from all
</Directory>
Default Apache httpd.conf usually have this, and they expect you to manually add (or change) the directive so that you enable access to the folder you specify.
I'm 90% sure this is your issue.
-George