RSS

Mac OS X Leopard: Web Sharing Troubles: “Forbidden”

Sun, Oct 28, 2007

Apple, CodeIgniter

If you’ve installed Mac OS X Leopard 10.5 already and you use the built in apache server “Web Sharing” you will need to follow these steps before your web server works again. If you’ve tried to visit a page on your local server, you will be greeted by this message:

Forbidden (403)

You don't have permission to access /~danielerrante/ezslide/ on this server.

Leopard fails to copy the settings from apache in Tiger to apache2 in Leopard. Therefore, you will need to follow these simple steps to get your server up again.

If you can vaguely remember creating a configuration file when you first set up Tiger called yourusername.conf, you will need to do that in apache2’s /etc/apache2/users/ folder and add the following to that file:

<Directory "/Users/danielerrante/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Replace danielerrante with your username. Or, you can do all that by copying and pasting one line in terminal:

sudo cp /private/etc/httpd/users/* /private/etc/apache2/users/

Next, you will need to /etc/apache2/httpd.conf and enable PHP5. To do this, navigate to this line:

#LoadModule php5_module libexec/apache2/libphp5.so

Uncomment that line by removing the pound sign.

Last step: Restart your web server by going to the system preferences, uncheck web sharing, then check it again so it restarts.

You’re done!

Source: http://discussions.apple.com/thread.jspa?threadID=1187457&tstart=15

This post was written by:

Daniel - who has written 36 posts on the web developer’s journal.


Contact the author

16 Comments For This Post

  1. Jim George Says:

    Right on. Thanks for posting this, saved me a lot of time poking around. Seems like a bit of an oversight on Apple’s part…

  2. Daniel Errante Says:

    Thanks for the feedback, Jim. I spent a lot of time setting up the apache server on my mac the first time around, and it took a while to find a solution for the same problem in Leopard.

  3. Olly Says:

    You’re a lifesaver. I was trying to work out how to fix this for what seems like an age.

    I should add that I had to do one thing differently, though. I installed Leopard with an Archive and Install and so didn’t have a /private/etc/httpd/users/ folder to copy. I had a backup of my Tiger install on a Firewire drive so I had to go to that and copy it in. Once I did that it worked fine. The rest of the steps were the same.

    Thanks again.

  4. Mat Harden Says:

    Thanks Daniel, that’s sorted me out. I agree with Jim too, Apple could have explained a bit more here as it does say in Web Sharing what you’re personal website address is.

  5. Copes Flavio Says:

    Thanks for this tip! I was just figuring out what happened to my Sites folder ;-)

  6. Daniel Errante Says:

    Thanks everyone. If it’s helpful, click the digg button in the top right corner. Thanks!

  7. Philip Jones Says:

    Thanks - I agree this is a life saver.

  8. behlul Says:

    thanks

  9. Stien Says:

    Wow. Thanks, and, like [post 8] says, you only need to go to the command line to fix this problem.

  10. Ira Edelman Says:

    Thank you! That was exactly what I needed. The Terminal line was definitely helpful. The only thing was that the httpd.conf wasn’t letting me save, so I had to copy it to the Desktop, edit, save, then drag back, and Authenticate. Thanks!

  11. Urf Says:

    You are a lifesaver!! I have a Uni assignment due tomorrow and so I decided to install Leopard … as you do. Disaster until I came across your page. PHP now back up and working as before. Thanks a million :)

  12. Justin Says:

    Thank you!!! Very strange that Leopard did this…

  13. Issac Says:

    Hey, thanks for putting this up. I had the same problem.

  14. Antoine Says:

    Thanks a lot!!! You saved me hours! I guess Apple should ass this to their “Leopard Drop-In DVD”!

  15. David Livingstone Says:

    Thanks - a great help. I used BBedit for httpd.conf once I knew what the solution was.

  16. Alf W. Says:

    YAY Thanks!!! im 12… Now i can host my website!!!

1 Trackbacks For This Post

  1. the web developer’s journal » Blog Archive » How to Fix Mac OSX Leopard Web Sharing | BizWidgets / PHP Web Design Says:

    [...] to fix the problem. You only have to type one line in terminal and change one line in a config file!read more | digg [...]

Leave a Reply