10 August 2008 ~ 10 Comments

Forbidden 403 error in Leopard Mac OS 10.5 with Web Sharing On




The Upgrade to Leopard was flawless! I took backup of everything on the HD if I had to revert to plan B, which is clean install!

Ok! Lets start the game and start playing with the Web powerhouse under this OS. I switched on Web Sharing, typed in:

http://localhost/~username

And I got the following error:

Forbidden: 403 Error
You dont have permissions to access localhost/~username


Googling the error, I was pointed to this very useful resource: http://www.macosxhints.com/article.php?story=20071027155902154

My solution was the following:

  1. Locate httpd.conf file, which should be at /private/etc/apache2/httpd.conf
  2. Edit it and locate <Directory /> using pico. You should be writing like sudo pico httpd.conf while being in the apache2 directory
  3. Change Deny from all to Allow from all in it
  4. Save the file
  5. type sudo apachectl stop (to stop the apache server)
  6. type sudo apachectl start (plz!)
  7. Enjoy :)

While you were editing the httpd.conf file, it wouldn’t be a bad idea to enable PHP also.

  1. Find LoadModule php5_module in httpd.conf
  2. Uncomment it i.e. delete # sign before the statement
  3. Save the file
  4. Stop and start the web server
  5. Your phpinfo(); test file should inform that you are running PHP 5.2.4 successfully.
  6. Congrates!

Happy coding!

Reblog this post [with Zemanta]

Related Posts


10 Responses to “Forbidden 403 error in Leopard Mac OS 10.5 with Web Sharing On”

  1. Gradualist 10 August 2008 at 8:24 am Permalink

    Hi thanks for posting your fix to this problem, which helped me too. Eventhough my particular scenario was a little different: I installed Leopard a few weeks ago and already had my local webserver running fine (having gone in and enabled PHP and shtml via the httpd.conf file) – UNTIL today. Today i got the 403 permissions error you got above when trying to browse to my local webserver files, while still being able to connect to the files across the network from my other computer (on Tiger)!?! Anyway, followed you point 3 above (though I edited my httpd.conf file in BBedit and restarted the web sharing via system preferences) and I’m back up and running.

    Cheers!

  2. admin 10 August 2008 at 8:25 am Permalink

    Hi! I’m glad it worked out well for you. Strange things happen, thats why I call them predictable stupidities :)

  3. Eric 10 August 2008 at 8:27 am Permalink

    I am having this issue as well, but editing the httpd.conf did not resolve it. I read at other sites that the folder permissions may be the problem, I have tried numerous options, but still no luck. Any other suggestions?

  4. ferdi 10 August 2008 at 8:28 am Permalink

    thanx for your solution. it worked out well.

  5. Andy 10 August 2008 at 8:29 am Permalink

    I’ve been trying to fix this problem for a while. Thanks, this was very helpful. For the longest time I was editing the httpd.conf file in the httpd.conf directory and not the apache2 directory.

  6. Sergio 10 August 2008 at 8:29 am Permalink

    it worked for me, thanks a lot! :)

  7. Ted Wood 10 August 2008 at 8:30 am Permalink

    I’ve been running Apache2 under Leopard for a number of weeks now, but this weekend it just decided to throw up a 403 Forbidden error for every VirtualHost I have configured. Very strange.

    Unfortunately, nothing I’ve tried (including this solution) has worked. Must be missing something very obvious.

  8. Harry 10 August 2008 at 8:31 am Permalink

    I have just started getting the 403 Forbidden error for all of my users’ websites. The main website is working just fine but all of the users just stopped this weekend and had been working just fine. This is a clean install of OS X Server Leopard.

  9. Andrew 10 August 2008 at 8:31 am Permalink

    For what it is worth, this all didn’t work for me. What did was doing and Apple-I on the SITES folder and setting it to R/W for (me), Read Only for unknown and everyone.

    But that still wasn’t enough. I had to go back to my /user/name/ folder and set it for everyone ‘Read Only’–then I got websharing to work. Go figure.

  10. Kay 10 August 2008 at 8:32 am Permalink

    I had to do what Andrew did to get it working – i still feel a bit uncomfortable to set my whole Home folder to Read-only for everyone .. isn’t there another solution like adding the whole folder in in the conf file, not just the Users/me/Sites one?


Leave a Reply