Saturday, March 17, 2012

Personal web server on MacOs Lion 403 forbidden

With the release of Lion, many have noticed that turning on the personal web server (in built apache) gives a 403 forbidden access denied error. There are a few elements to resolving this issue.
Below ~username is going to be ~aniket (please replace that with your own ~username), the first thing to check is whether we have the following entries
vi /etc/apache2/users/aniket.conf 

<Directory "/Users/aniket/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
Make sure that this file has permissions as the following
 -rw-r--r--  1 root  wheel  142 Mar 16 16:42 aniket.conf
Also make sure that the directory /Users/aniket and /Users/aniket/Sites have the execute permission bits set not only for the owner, but also the group and everybody else. You might have to be root to complete this task.

chmod 711 /Users/aniket

result should look like
drwx--x--x  77 aniket  staff   2686 Mar 16 16:35 aniket
drwxr-xr-x+   6 aniket  staff   204 Apr 25  2009 Sites
Incorrect permissions have been the cause of many problems and setting them to 711 resolves the forbidden error.
Powered by Blogger.