Chown Gets 403 Forbidden

Discussion in 'Site & Server Administration' started by Infranight, Jun 27, 2010.

  1. #1
    I just chowned my /home/admin to admin:
    chown -R root:root /home/admin
    And my sites are all 403 forbidden now.
    Does anyone know how I can revert this? Thanks!
     
    Infranight, Jun 27, 2010 IP
  2. KaniGT5

    KaniGT5 Active Member

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Not enough information to fully diagnose the issue here.

    All things considering, you want to change your httpdocs/root of your web back to apache:apache as owner.
     
    KaniGT5, Jun 27, 2010 IP
  3. madaboutlinux

    madaboutlinux Member

    Messages:
    250
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    43
    #3
    Yes, you will receive an "Forbidden Error" message because, by default the 'public_html' directory is owned by user.nobody (i.e. apache user) and the permissions are 750, which makes it possible for Apache to access the directory. Since you have changed the ownership of the whole user home directory to root.root recursively, the public_html directory now looks like

    drwxr-x--- 14 root.root 4096 Jun 18 06:13 public_html/

    and the Apache user (nobody) OR others don't have access to it resulting in the Forbidden error message. You will either have to set username.nobody ownership for the public_html directory OR change their permissions to 755.
     
    madaboutlinux, Jun 28, 2010 IP
  4. madaboutlinux

    madaboutlinux Member

    Messages:
    250
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    43
    #4
    As per the command you gave above, it looks like you have only changed the ownership for a single user? If yes, execute the following commands:

    chown admin.admin /home/admin -R
    chown admin.nobody /home/admin/public_html
    chown admin.mail /home/admin/etc -R
     
    madaboutlinux, Jun 28, 2010 IP
  5. Infranight

    Infranight Member

    Messages:
    319
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #5
    Yes, apache:apache worked perfect; thanks!
     
    Infranight, Jun 28, 2010 IP