Websharing problems

Discussion in 'macOS' started by Dale Cooper, Nov 17, 2008.

  1. Dale Cooper macrumors regular

    Dale Cooper

    Joined:
    Sep 20, 2005
    #1
    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!
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    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.
     
  3. Dale Cooper thread starter macrumors regular

    Dale Cooper

    Joined:
    Sep 20, 2005
    #3
    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...
     
  4. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #4
    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
     
  5. Dale Cooper thread starter macrumors regular

    Dale Cooper

    Joined:
    Sep 20, 2005
    #5
    Thanks again for your help! But there's no .htaccess file in there, just index.html and the website folder...
     
  6. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #6
    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.
     
  7. Dale Cooper thread starter macrumors regular

    Dale Cooper

    Joined:
    Sep 20, 2005
    #7
    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.
     
  8. Cerebrus' Maw macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Brisbane, Australia
    #8
    Sorry if this sounds insulting to your intelligence =D, but where did you save the index.html file?
     
  9. Dale Cooper thread starter macrumors regular

    Dale Cooper

    Joined:
    Sep 20, 2005
    #9
    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)
     
  10. Cerebrus' Maw macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Brisbane, Australia
    #10
    Hmm, ok, just for my own insatiable curiosity, try typing http://localhost/index.html into safai, rather than the absolute IP.

    Also, just check your Firewall, see if have any ports blocked etc
     
  11. Dale Cooper thread starter macrumors regular

    Dale Cooper

    Joined:
    Sep 20, 2005
    #11
    Neither using http://localhost/index.html nor turning off the firewall completely helps..
    Setting up web sharing looked so easy at first!
     
  12. Cerebrus' Maw macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Brisbane, Australia
    #12
    C'est tres bizarre, mon ami!

    Have you tried it on a different account? Just to see if the problem is system wide or specific?

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

    DoFoT9

    Joined:
    Jun 11, 2007
    Location:
    Singapore
    #13
    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
     
  14. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #14
    Try repairing permissions. This'll rule out problems caused by, among other things, Apache being unable to read its configuration files.
     
  15. bob007 macrumors newbie

    Joined:
    Nov 18, 2008
    #15
    dear wrldwzrd89
    please see an old forum topic, i would like to ask a few questions, maybe you know the answere.

    http://forums.macrumors.com/showthread.php?p=6627487

    thank you very much
     
  16. Dale Cooper thread starter macrumors regular

    Dale Cooper

    Joined:
    Sep 20, 2005
    #16
    Thanks for all of your help!

    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:
     

Share This Page