14 Replies Latest reply: Oct 5, 2010 4:21 PM by Alessandro Montini
Hugacrv Level 1 Level 1 (0 points)
I am having problems with Web Sharing on my primary user account.

In the Setting>Sharing>Web Sharing panel it shows my computer address and the address for my personal website.

When I click on the computer's address, I get a page that says "It Works!" but when I click the personal website address, I get "You don't have permission to access..."

I created a test account and everything works fine there. I repaired permissions and ran the 10.6.4 combo update again and neither helped.

Any suggestions on what else to look at? I'm baffled.

MacBook Core 2 Duo 2.4Ghz, Mac OS X (10.6.4), 23" LED Cinema Display
  • j.v. Level 5 Level 5 (4,155 points)
    This suggests to me that maybe the permissions are messed up on the personal website folder, its contents, and/or its superior folders. Open Terminal.app, located in the /Applications/Utilities folder.
    Type the following commands, each followed by pressing the "return" key:

    ls -dl ..
    ls -dle
    ls -dle Sites
    ls -l Sites
    ls -l Sites/images

    Those "l" in the "ls" and after the hyphens are lower-case L.

    Actually, you can just copy those five "ls" commands as a block and paste the entire block into the Terminal window.

    When I do those commands, I get the following:

    iMac:~ jv$ ls -dl ..
    drwxr-xr-x 13 root admin 442 Jul 30 13:20 ..
    iMac:~ jv$ ls -dle
    drwxr-xr-x+ 26 jv staff 884 Aug 13 23:30 .
     0: group:everyone deny delete 
    iMac:~ jv$ ls -dle Sites
    drwxr-xr-x+ 5 jv staff 170 Jun 18 21:07 Sites
     0: group:everyone deny delete 
    iMac:~ jv$ ls -l Sites
    total 0
    drwxr-xr-x 3 jv staff 102 Jun 18 21:07 images
    -rw-r--r-- 1 jv staff 2642 Jun 18 21:07 index.html
    iMac:~ jv$ ls -l Sites/images
    total 32
    -rw-r--r-- 1 jv staff 16624 Jun 18 21:07 gradient.jpg


    You should see the same files and folders listed ( ".." , "." , Sites, images, index.html, and gradient.jpg). What I am interested in seeing about each of those is what the stuff in blue says for you, for each of those files and folders. It should match. If any of them don't match, post back what you've got and we'll fix the permissions. Actually, seeing the owner and group affiliation ("jv" and "staff" in my example) should have your short user name as owner and "staff" for group affiliation so if you don't get that, post back with that information, too, and we'll fix file/folder ownership.
  • Hugacrv Level 1 Level 1 (0 points)
    Thanks for the reply, here are the results from my Terminal session:

    [jay-hs-macbook:~] j% ls -dl ..
    drwxr-xr-x 7 root admin 238 Aug 12 00:49 ..
    [jay-hs-macbook:~] j% ls -dle
    drwxr-xr-x 56 j staff 1904 Aug 13 16:59 .
    [jay-hs-macbook:~] j% ls -dle Sites
    drwxr-x---@ 6 j staff 204 Aug 13 17:05 Sites
    [jay-hs-macbook:~] j% ls -l Sites
    total 8
    drwxr-x--- 8 j staff 272 Feb 18 2003 Graphics
    drwxr-xr-x 3 j staff 102 Aug 12 00:49 images
    -rw-r--r-- 1 j staff 2642 Aug 12 00:49 index.html
    [jay-hs-macbook:~] j% ls -l Sites/images
    total 40
    -rw-r--r-- 1 j staff 16624 Aug 12 00:49 gradient.jpg

    I see some differences so looks like I'll need some more help from you.

    Thanks in advance
  • j.v. Level 5 Level 5 (4,155 points)
    First thing I notice is that that permissions for "everyone" access are different between our two Sites' folders. So in Terminal, first do a
    ls -Rle@ Sites > Desktop/initialperms.txt 
    This lets us save a text file telling us what the initial state of all the permissions are now, in case we want or need to restore back to its original (but apparently broken) state.

    Now try doing a chmod -vv 755 Sites. See whether that fixes you. While on the one hand, other users in the "staff" group should have access already and as owner, you definitely should have had access, but on the other hand, maybe clicking on that link through the system preferences sharing web sharing thingy treats it like how "everyone else" would access it. If doing that chmod doesn't fix it, do a ls -dle@ Sites since that folder is showing some additional extended attributes, so I can see what they are.

    I presume your "Graphics" folder that is in your "Sites" folder is something that you put in there? (Since I don't have one?) It looks like it inherited the permissions of its enclosing folder, so I would do the same with it,
    chmod -vv 755 Sites/Graphics 
    If you have stuff inside that Graphics folder, I would do a
    find Sites/Graphics -type f -exec chmod -vv 644 {} \; 
    and a
    find Sites/Graphics -type d -exec chmod -vv 755 {} \; 
    too. You should see a stream of messages that look like
    Sites/Graphics/somefile: 010640 \[-rw-r----- ] -> 010644 \[-rw-r--r-- ] 
    when you do those commands.

    If you do those things, then hopefully that will fix you up. If you are still having problems, just like you first did, do a
    ls -Rle@ Sites > Desktop/modperms.txt 
    so you can easily show other helpers here what I've done to you

    PS - in your test account that you created, since it works, the files' and folders' permissions there are exactly like what your files' and folders' permissions in your account should look like. So if you were to do a
    ls -Rle@ ../testAcctShortUserName/Sites 
    and a
    ls -Rle@ Sites 
    that will give you a recursive listing, showing permissions, owner/group, access control lists, and extended attributes, of both Sites' folders for you to compare.
  • Hugacrv Level 1 Level 1 (0 points)
    j.v. wrote:
    Now try doing a chmod -vv 755 Sites. See whether that fixes you.


    This did not fix the problem

    If doing that chmod doesn't fix it, do a ls -dle@ Sites since that folder is showing some additional extended attributes, so I can see what they are.


    Results of ls -dle@ Sites

    drwxr-xr-x@ 6 j staff 204 Aug 13 17:05 Sites
    com.apple.FinderInfo 32

    I presume your "Graphics" folder that is in your "Sites" folder is something that you put in there?


    Yes, some time ago, don't remember why and I'm not using the contents so I will probably delete it.


    If you do those things, then hopefully that will fix you up. If you are still having problems, just like you first did, do a
    ls -Rle@ Sites > Desktop/modperms.txt 
    so you can easily show other helpers here what I've done to you


    Done

    PS - in your test account that you created, since it works, the files' and folders' permissions there are exactly like what your files' and folders' permissions in your account should look like. So if you were to do a
    ls -Rle@ ../testAcctShortUserName/Sites 
    and a
    ls -Rle@ Sites 
    that will give you a recursive listing, showing permissions, owner/group, access control lists, and extended attributes, of both Sites' folders for you to compare.


    Results

    [jay-hs-macbook:~] j% ls -Rle@ ../websharetest/Sites
    total 1184
    -rw-r--r--@ 1 websharetest staff 302232 Aug 12 19:18 Pictures alias
    com.apple.FinderInfo 32
    com.apple.ResourceFork 301907
    drwxr-xr-x 3 websharetest staff 102 Aug 12 00:49 images
    -rw-r--r-- 1 websharetest staff 2642 Aug 12 00:49 index.html

    ../websharetest/Sites/images:
    total 32
    -rw-r--r-- 1 websharetest staff 16624 Aug 12 00:49 gradient.jpg

    [jay-hs-macbook:~] j% ls -Rle@ Sites
    total 8
    drwxr-x--- 8 j staff 272 Feb 18 2003 Graphics
    drwxr-xr-x 3 j staff 102 Aug 12 00:49 images
    -rw-r--r-- 1 j staff 2642 Aug 12 00:49 index.html

    Sites/images:
    total 40
    -rw-r--r-- 1 j staff 16624 Aug 12 00:49 gradient.jpg

    (Note: I removed the results for the Graphics folder since I plan to delete it)

    It seems that the critical folders have the same permissions. Where else should I look?

    Message was edited by: Hugacrv
  • Barney-15E Level 8 Level 8 (41,980 points)
    In the Finder, choose Go to Folder from the Go menu.
    Type /etc/apache2/users and hit return. Is there a file in that folder with the user name and .conf?
  • Hugacrv Level 1 Level 1 (0 points)
    There is one for my test account (websharetest.conf) but not for the account where I'm having problems.
  • Barney-15E Level 8 Level 8 (41,980 points)
    Well, that's the problem.

    Duplicate the one that's there and then edit it so that the Directory path points to the correct user Sites directory, and change the name to the other account.

    Then, open terminal copy/paste this command and leave a space after it. Drag the new user.conf file to the Terminal window and hit return.
    sudo chown root:wheel 
    It will ask for your password, but not print anything out when you type it in.
  • Hugacrv Level 1 Level 1 (0 points)
    This did not resolve the problem.
  • Barney-15E Level 8 Level 8 (41,980 points)
    What is the result of this command in Terminal
    apachectl configtest
  • Hugacrv Level 1 Level 1 (0 points)
    Result

    [jay-hs-macbook:~] j% apachectl configtest
    Syntax OK
  • Barney-15E Level 8 Level 8 (41,980 points)
    Try stopping and restarting web sharing.
  • Hugacrv Level 1 Level 1 (0 points)
    SUCCESS!!!

    Thank you very much, I was beginning to think this was going to turn out badly.

    Should I assume that initial round of permission changes were (at the very least) not harmful and potentially contributed to the fix? Or do I need to go back and reset them to what they were?
  • Barney-15E Level 8 Level 8 (41,980 points)
    I looks like you just put them the way they should have been.
  • Alessandro Montini Level 1 Level 1 (15 points)
    Thanks!! It work for me too!!