Page 1 of 1

Apache Error 403 after configuring virtual hosts

PostPosted: 22. January 2006 21:03
by johnwarde
Hi,

I have installed XAMPP 1.5.1 on my Windows XP machine and I am having trouble setting up virtual hosts.

The following entries are in my HOSTS file:

-------------------------------------------------------
127.0.0.1 localhost
127.0.0.1 local.test.com
-------------------------------------------------------

I have added the following to the end of my httpd.conf:

--------------------------------------------------------
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/DevApps/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName local.test.com
DocumentRoot "C:/Dev/Web/www"
</VirtualHost>
--------------------------------------------------------

Restarted Apache. The first virtual host re-enables the XAMPP website and works however the second virtual host does not work and Apache reports

-------------------------------------------------------
Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.
Error 403
-------------------------------------------------------

when I browse to local.test.com or http://local.test.com/index.htm

In the error.log file :
-------------------------------------------------------
Sun Jan 22 19:40:01 2006] [error] [client 127.0.0.1] client denied by server configuration: C:/Dev/Web/www/index.htm
-------------------------------------------------------

How do I get my "local.test.com" virtual host to work?

Thanks for your help,

John

PostPosted: 22. January 2006 21:25
by Wiedmann
Read the Apache manual about directory-blocks and the "allow" directive.

PostPosted: 23. January 2006 10:43
by johnwarde
Hi,

I added the following to my httpd.conf:

<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

I thought I had tried this already but it work now. I knows its undesireable from a security point of view to have this set-up but the websites are internal only, but I can work from this point to make more secure.

John

403 forbidden error

PostPosted: 23. January 2006 20:27
by nick.kirby
Hello there, I am having the same problem.

I have XAMPP Apache configured inside of a virtual machine on 192.168.1.30.

I have used the extra/httpd-vhosts.conf to configure virtual hosts which I intend eventually to be internet facing.

I am using an XP machine to connect to the virtual machine, and it's host file is edited to show that www.test.com is on 192.168.1.30.

Basically, as far as I can see, there are no config errors. Apache starts without issue, the vhosts are correctly configured, but I still get this error.

What have i missed?

PostPosted: 24. January 2006 06:35
by WorldDrknss
www.worlddrknss.blogdns.org <-- XAMPP Tutorials

PostPosted: 24. January 2006 11:04
by nick.kirby
Hello, many thanks for advice! I changed the Deny All to Allow all. Works perfectly.

thank you!