Announcement

Collapse
No announcement yet.

Messed up with /var/www/ file permissions

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Messed up with /var/www/ file permissions

    Hello, I think I've been messing up too much with file permissions. So much so that I now can't copy anything to/from the directory /var/www/. I can't even access any html content placed under that folder through a web browser.

    I think everything started after I did this:

    sudo chown www-data.www-data /var/www/ -R
    sudo chmod o-rwx /var/www/ -R

    The thing is, I couldn't find a way to really undo that.

    Any clue will be appreciated!

    #2
    Re: Messed up with /var/www/ file permissions

    With those commands, you changed user and group ownerships to www-data and then denied all others access. So currently only user www-data and members of group www-data have access to /var/www.

    Probably not what you had in mind. Without knowing how you want the permissions/ownerships set up it's impossible to give detailed help, but you can temporarily add permissions with chmod [ugo]+[rwx], for example, you can give full access to var/www/ with
    Code:
    sudo chmod -R o+rwx /var/www/
    NOTE that this is probably not what you want (giving write access to all), but it'll give you temporary access while you go back to the drawing board.

    Comment


      #3
      Re: Messed up with /var/www/ file permissions

      The following commands should fix it:
      Code:
      sudo chmod -R 775 /var/www
      sudo chown -R www-data:www-data /var/www
      sudo adduser yourusername www-data
      ASROCK Z87 Pro4 - i5 4670K - R9 270x ☞ Triple Boot: KDE NEON ★ Windows 10 ★ Windows 7

      Comment

      Working...
      X