I was trying to set up Web Sharing (apache) to try out Coda, Panic’s pretty cool editor.
After enabling Web Sharing, I tried to access:
http://localhost/~USER/
(where USER is my user name), however I was greeted with “You don’t have permission to access this page”
I checked all of my permissions on /Users/USER/Sites/ etc, everything was fine.
Then I made a new user, which worked. I kept hunting around and finally found the problem.
When I used Migration Assistant to copy data from my old Mac to this one, Migration Assistant did not copy the apache configuration file. Oops. In order to fix this, you’ll need terminal and Text Edit.
- Make a new user
- Enable Web sharing (to force creation of a template configuration file)
- Open /Applications/Utilties/Terminal.app
- Enter ‘sudo ls /etc/apache2/users/’ without the quotes and press RETURN. Enter your admin password to continue.
- Note the <NEWUSER>.conf file listed there
- Enter ‘sudo cp /etc/apache2/users/<NEWUSER>.conf <USER>.conf’ replacing <NEWUSER> with the name of the new user you created, and <USER> with the name of the broken user. Press return.
- Open Text Exit.app
- Press CMD-O to open the choose file box
- Press the / key to open a “go to folder” dialog
- Type in ‘/etc/apache2/users’ without the quotes.
- Open your <USER>.conf file
- In the first line, change <Directory "/Users/<NEWUSER>/Sites/"> to <Directory "/Users/<USER>/Sites/">
- Save your document
- Turn Web Sharing off, then back on
Whew! Things should work now.
Time to file a bug with Apple.