1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wordpress Files Issue

Discussion in 'WordPress' started by samie, Oct 10, 2014.

  1. #1
    I've used WordPress a lot in the past and never had any issues, but recently started using a VPS where I had to setup everything on the server myself. I'm noticing with my installation of WordPress that I'm having all sorts of problems with installing new themes, updating Wordpress, uploading images, etc. I'm able to resolve the issues for the most part. Like say for the uploading images issue, I just had to create an uploads folder and set the permissions to 777. But is this safe? I've never had to do it with other webhosts, infact, other web hosts wouldn't even allow 777 for security reasons. Would it possibly have to do with ownerships on my files/folders? Right now they are currently set to root:root. Not sure what else I should set them to. I'm using centos.
     
    samie, Oct 10, 2014 IP
  2. homer7

    homer7 Well-Known Member

    Messages:
    268
    Likes Received:
    25
    Best Answers:
    4
    Trophy Points:
    125
    #2
    You should change the ownership of the whole wordpress directory to the web server user instead of using the root user
    cd /var/www/
    sudo chown www-data:www-data * -R
    sudo usermod -a -G www-data username
    of course use your web server username in place of username
    i don't need to change any permissions after this
    check out these tutorials related to centos and WordPress installation

    https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-centos-6--2
    https://www.digitalocean.com/commun...-linux-nginx-mysql-php-lemp-stack-on-centos-6
    https://www.digitalocean.com/commun...linux-apache-mysql-php-lamp-stack-on-centos-6

    search tutorials section you should find more.
     
    homer7, Oct 10, 2014 IP
    samie likes this.
  3. samie

    samie Member

    Messages:
    269
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #3
    Thanks a lot for the information. I think we're definitely on the right track here when getting into chowning and ownerships. The only issue is that www-data does not exist. When I trying the usermod or chowning anything to those ownerships, then I get a message saying invalid group "www-data". Any suggestions on what I should do from here? I wasn't able to find anything in the links provided, and not having much luck researching myself.
     
    samie, Oct 10, 2014 IP
  4. homer7

    homer7 Well-Known Member

    Messages:
    268
    Likes Received:
    25
    Best Answers:
    4
    Trophy Points:
    125
    #4
    It appears CentOS uses the user apache instead of www-data
    so try
    cd /var/www/
    sudo chown apache:apache * -R
    sudo usermod -a -G apache username

    or if you are using nginx
    cd /var/www/
    sudo chown nginx:nginx * -R
    sudo usermod -a -G nginx username
     
    homer7, Oct 10, 2014 IP
    samie likes this.
  5. samie

    samie Member

    Messages:
    269
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #5
    Works great :) Thanks!
     
    samie, Oct 10, 2014 IP