I tried to setup a development environment in my local Apache server to have multiple sites, each with its own name. However when I try to access them (ex. http://site1
) from a browser I get:
You don't have permission to access / on this server.
This is what I have done so far in order to enable vhosts:
I created a folder to keep for my projects and added an html file in each site folder
mkdir site1 site2
I uncommented the following line in /etc/httpd/httpd.conf
and then edited /etc/httpd/extra/httpd-vhosts.conf
CustomLog "/var/log/httpd/site1.log" common
CustomLog "/var/log/httpd/site2.log" common
127.0.0.1 site1 site2
In /var/log/httpd/site1.log I get
[Sun Dec 11 02:48:41 2011] [error] [client 127.0.0.1] client denied by server configuration: /home/reborn/webdev/site1/
127.0.0.1 - - [11/Dec/2011:02:48:41 +0200] "GET / HTTP/1.1" 403 202
I can post httpd.conf too, if you need it.
Google hasn't helped me much.
I am using slackware 13.37 and Apache version 2.2.21
EDIT: I want to add that the server worked correctly before and still does if I comment again the line in httpd.conf that includes extra/httpd-vhosts.conf, then I can can access localhost from a browser but uses /var/www/htdocs as DocumentRoot.