Strange problem with file permissions for local web server

Discussion in 'OS X Mountain Lion (10.8)' started by thesheep, Aug 14, 2012.

  1. thesheep macrumors regular

    thesheep

    Joined:
    Mar 27, 2006
    #1
    I'm migrating all my stuff from Snow Leopard to Mountain Lion.

    I have a new MBP with a fresh install of Mountain Lion and I'm trying to set up my localhost development server as it was under SL.

    I've got Apache and PHP working as recommended here. But I'm getting strange permission problems.

    Certain folders are giving 403 Forbidden errors when I try to view them in a browser. I noticed the owner of these folders was set to 'root' so I did a chown command to move it to my own username, and also chmod 755 on everything. It still didn't work. I tried chmod 777 on the entire folder structure and I still get the 403 errors. However, if I create a sibling folder, and place an HTML file in there, it displays fine.

    ~/Sites/clientabc/site/

    is shown as

    Code:
    drwxr-xr-x  25 benhayes staff 850 12 Oct 2010 site
    and

    ~/Sites/clientabc/test/

    is shown as

    Code:
    drwxr-xr-x 3 benhayes staff 102 14 Aug 11:40 test
    But anything in 'test' is viewable, but nothing in 'site' is viewable.

    Is it possible that I have 2 different usernames that appear the same (both are 'benhayes') but in the underlying OS they are treated as different accounts?
     
  2. thesheep thread starter macrumors regular

    thesheep

    Joined:
    Mar 27, 2006
    #2
    Update: I just ran Repair Disk Permissions in Disk Utility and got a whole load of errors in various places including Library/Java, Library/Preferences, Library/WebServer and System/Library/CoreServices (and several others).

    After running repair it tells me that one of the problems cannot be fixed (System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent)

    Has not fixed the problem with 403 errors.

    I am now regretting upgrading to Mountain Lion!
     
  3. thesheep thread starter macrumors regular

    thesheep

    Joined:
    Mar 27, 2006
    #3
    Just in case anyone reads this with a similar problem, I worked out what it was. There was a hidden .htaccess file in the site directory. Since FollowSymLinks was not enabled, Apache was choking on the rewrites in this rule and throwing a 403 error. The lesson here: check Apache error logs before writing a long post about a problem.
     

Share This Page