问题描述： After upgrading to Mac OS X 10.6 or create a new account in you mac, you may be unable to access expected web site content (in your ~/Sites/ folder) via Web Sharing. Web Sharing appears to be enabled and working correctly, but trying to load your web site results in a “Forbidden 403” Web page.
解决方法 If you installed Mac OS X 10.6 via an Upgrade Install (the default type), follow these steps:
- Open TextEdit.
- Click the Format menu and click Make Plain Text. Then click OK.
- Copy the below text as is and paste it into the TextEdit document.
<Directory "/Users/myname/Sites/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
- Replace the word “myname” with your user account’s shortname. (This is the same name as the user’s Home folder in the Users folder.)
- Save the TextEdit document on the desktop with the name “myname.conf” where “myname” is the shortname.
- At the prompt, click “Use .conf”.
- Quit TextEdit.
- In Finder, from the Go menu choose Go to Folder.
- Type in: /etc/apache2/users/
- Click Go.
- Drag “shortname.conf” from the desktop into the Finder window for (/etc/apache2/users).
- At the prompt, click Authenticate.
- Enter the administrator username and password and click OK.
- Close the Finder window.
- Open Terminal.
- Enter this command on a single line, followed by Return:
sudo chown root:wheel /etc/apache2/users/shortname.conf
- Enter your administrator password when prompted.
- Quit Terminal.
- Open System Preferences and click Sharing.
- Uncheck (deselect) Web Sharing to turn it off, then check Web Sharing to turn it back on.