Thursday, November 18, 2010

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

Encounter this problem after you set up virtual host in web server?
It is because the folder permission is not set probably.

Here is an example:


<Virtualhost *:80="">
ServerName testhost.com
DocumentRoot "/home/testhost/www"
DirectoryIndex index.php
<Directory "/home/testhost/www">
AllowOverride All
Allow from All
</Directory>


ErrorLog "logs/testhost-error.log"
CustomLog "logs/testhost-access.log" common
</Virtualhost>

Make sure to set permission 755 for each folder in the document root path
/home <- 755
/home/testhost <-- 755
/home/testhost/www <-- 755