Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Wordpress file permissions

  1. #1
    Join Date
    Sep 2013
    Beans
    5

    Wordpress file permissions

    Linux newb be gentle

    I have successfully installed my lamp stack and wordpress which all runs great - but I'm having problems with the file and directory permissions of wordpress in var/www.

    I need to change the owner from root to my user account - Can this be done without having to sudo chown each dir and file individually?

    TIA

  2. #2
    Join Date
    Sep 2013
    Beans
    5

    Re: Wordpress file permissions

    I've since run gksu nautilus to change owner and permissions of the var/www directory - However; whilst in nautilus the directory and all sub directories and files show as me the owner - but when I exit nautilus they show as root - Any idea why this is?

  3. #3

    Re: Wordpress file permissions

    make backups!
    Code:
    sudo tar -pczf /root/archive.tar.gz /var/www
    Code:
    sudo chown user:group /var/www/* -R
    group is probably www-data or similar and I'd leave that alone but if it is, include it after user:www-data

    user being your login username.
    Windows assumes the user is an idiot.
    Linux demands proof.

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,966
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Wordpress file permissions

    You do realize that Wordpress needs to write into some of its directories, right? That means the "www-data" user must have write privileges as well as you. I take the path of putting www-user in the same group as the WP owner, but I don't have a real user own the Wordpress tree. I created a user that only owns websites. If you put yourself in that user's group as well as the www-data user, you'll all be able to read and write in the WP tree.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Aug 2008
    Location
    Victoria, BC Canada
    Beans
    1,741

    Re: Wordpress file permissions

    try chmod and set the permissions to 777, easier than messing around with various packages

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Wordpress file permissions

    Quote Originally Posted by Vegan View Post
    try chmod and set the permissions to 777, easier than messing around with various packages
    Not when the files are being served by a web server. That effectively gives www-data full access to the files.

    It would be a better idea to do as SeijiSensei suggests.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7

    Re: Wordpress file permissions

    Quote Originally Posted by Vegan View Post
    try chmod and set the permissions to 777
    Very bad advice, sorry. It leaves all content open to exploits.

    Convenience at the price of Security is neither convenient nor secure.

    http://wordpress.org/support/topic/d...le-permissions
    Windows assumes the user is an idiot.
    Linux demands proof.

  8. #8
    Join Date
    Mar 2011
    Beans
    23

    Re: Wordpress file permissions

    Quote Originally Posted by SeijiSensei View Post
    You do realize that Wordpress needs to write into some of its directories, right? That means the "www-data" user must have write privileges as well as you. I take the path of putting www-user in the same group as the WP owner, but I don't have a real user own the Wordpress tree. I created a user that only owns websites. If you put yourself in that user's group as well as the www-data user, you'll all be able to read and write in the WP tree.
    Can you clarify this please? Who is www-user? Who is the WP owner? Who is the www-data user? I'm facing a similar problem as the original poster and tried sudo chown user:www-data /var/www -R to no avail because when I create a new directory within /var/www I have to chown all over again. This is such a pain. Can't I set it up so that I can both modify, delete, add files via sFTP AND have WP be able to write to its directory?

  9. #9
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Wordpress file permissions

    Quote Originally Posted by icebox83 View Post
    Can you clarify this please? Who is www-user? Who is the WP owner? Who is the www-data user? I'm facing a similar problem as the original poster and tried sudo chown user:www-data /var/www -R to no avail because when I create a new directory within /var/www I have to chown all over again. This is such a pain. Can't I set it up so that I can both modify, delete, add files via sFTP AND have WP be able to write to its directory?
    www:data is the user your web server runs under.

    Make yourself the owner of the files and add www-data as the group.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  10. #10
    Join Date
    Mar 2011
    Beans
    23

    Re: Wordpress file permissions

    Quote Originally Posted by CharlesA View Post
    www:data is the user your web server runs under.

    Make yourself the owner of the files and add www-data as the group.
    Which is fundamentally sudo chown user:www-data /var/www right? And throwing -R in there also applies the chown to all subdirectories and files?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •