Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dale Cooper

macrumors regular
Original poster
Sep 20, 2005
218
0
Hi,
I've been trying to set up Web Sharing on Leopard. When I first tried to open the site on my local network (http://[I]myip[/I]/~myshortname/) I got a Forbidden 403 error in Safari. Found a help document on Apple's pages that instructed me to create a .conf fil in /etc/apache2/users/, and now I get "Can't connect to server" instead... Hooray. Has anyone else experienced this, and/or have a solution? Thanks!
 
The cause of this is probably a permissions issue - namely, that the www user can't see your Sites folder on the server machine. To fix this, go to the server, do a Get Info on the Sites folder, and check the permissions. Is access for "Everyone" set to "read only" - the way it is set by default? If not, there are two ways to fix this.

1. If you're using Leopard, wish to preserve the permissions as they are but also give the www user read access, you can use some Terminal commands to add an ACL to the folder. (Check the manual pages for the chmod command.)
2. The simpler solution - give Everyone read only access.
 
1. If you're using Leopard, wish to preserve the permissions as they are but also give the www user read access, you can use some Terminal commands to add an ACL to the folder. (Check the manual pages for the chmod command.)
2. The simpler solution - give Everyone read only access.

Thanks.

I've tried different permissions, including "chmod -R +a "_www allow read,search" ~/Sites", chmod o+R..., using the "Show info" in Finder etc. "Everyone" has read access, throughout the Sites folder hierarchy. But I still get the Access Forbidden! message...
 
Thanks.

I've tried different permissions, including "chmod -R +a "_www allow read,search" ~/Sites", chmod o+R..., using the "Show info" in Finder etc. "Everyone" has read access, throughout the Sites folder hierarchy. But I still get the Access Forbidden! message...
Okay, so we've eliminated a permissions problem. The next thing to check for is an .htaccess file at the root of your Sites folder. If you find one, try renaming it to something else, and see if that works.

The easiest way to check for the presence of an .htaccess file is to open Terminal, change directories to Sites, then list the contents, showing hidden files.

To do this:
Code:
cd ~/Sites
ls -a

If you see an entry there called .htaccess, try this:
Code:
mv .htaccess htaccess.txt

To undo that change, if it still doesn't work:
Code:
mv htaccess.txt .htaccess
 
Thanks again for your help! But there's no .htaccess file in there, just index.html and the website folder...
Okay. That isn't the cause, so are you running any kind of active scripting? It sounds like you aren't, with just an index.html file. If you are, though, check your scripts.

Also, you might want to try getting rid of that config file you created earlier, as it's probably causing more problems than it's solving at this point.
 
No active scripting (as far as I know:eek:). I've just created a very basic iWeb site to test if I could get Web Sharing up and going, before I make something properly. I've deleted the .conf file again, but it didn't help.
 
Sorry if this sounds insulting to your intelligence =D, but where did you save the index.html file?

I wouldn't be suprised if I've done something stupid;) It's saved in ~/Sites (although I've also tried to save it in /Library/WebServers/Documents)
 
had the same problem many a time, the only real fix is too reinstall OSX.. but that is a pain in the ass as it doesnt even work sometimes unless you do a full erase.

have you tried just your IP address then index.html?? thats all i do. none of that ~username crap.

e.g. 192.168.0.12/index.html
 
Try repairing permissions. This'll rule out problems caused by, among other things, Apache being unable to read its configuration files.
 
Thanks for all of your help!

Also, if you try to open the index.html file with safari, does it render the html etc ok?

Everything opens and renders fine if I open index.html from Finder.

Fixing permissions didn't help either... Think it's time to give up soon:confused:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.