1

Working on a new client's dev site, which is a wordpress install on a Plesk box. I have SSH root access, and FTP access through a separate account.

What I've done so far

Initially I couldn't make any changes to any files at all. The permissions on all the template files looked a little screwy (644), so I figured change them to allow group, and add myself to the group:

  • CHMOD Recursive on the theme folder to set everything to 664
  • Quickly realised I'd broken it, set the folders to 755, kept files as 664
  • Ownership on all files is a mixture of root:root and 500:500 (there is no user nor group with the ID of 500 on the server).
  • Added myself to the group 'root' so I could modify the files too

The Problem

This worked OK, in terms of being able to edit the existing files, so I began working. However, I can't upload to the directory, even having run CHOWN -R root:root templatefolder/ and being in the root group.

I feel like I must be missing something obvious, and it's doing my head in.

Questions:

Files in the install owned by 500 with group 500 - I've looked in /etc/group and /etc/passwd and there is no user nor group with this ID. Is that left over from another developer's setup or the previous server (they moved recently)?

Is being in the 'root' group enough, or do I need to own the theme folder as 'myftpuser' in order to upload and create new files?

Like I say, I have edit access, so I got myself this far. I'm now questioning what to do next!

1
  • 1
    The uid the http service runs as must be able to write (and read) the upload directory.
    – 3molo
    Apr 1, 2012 at 12:29

1 Answer 1

1

You said you put the folder permissions back to 755. This means that you have to be the owner of the folder to be able to create files in it. The reason why your chmod broke when you changed folders to 664 is because folders need the execute bit. So you need to set the folders to 775 and make sure youre in the group that owns them.

Also, the better way to solve this is not to add yourself to the root group, but to change the group of all the files to one that youre in. Not a major issue, but its just good practice.
(An even better practice would be to utilize ACLs, but that goes beyond the scope of this question)

Lastly, the files that are owned by '500:500' are probably that was because that was the owner when they were extracted from the tarball when they were installed. You can change the ownership to match the other files without issue.

1
  • Thanks so much. So obvious now, clearly had a brainfart between 775 and 755! Wasn't too keen to change the group the files belong to as there is a development team in the Ukraine who built the site and still do work on it, and I didn't want to break anything for them! Sorry I can't upvote you but I don't have enough rep :)
    – Ben
    Apr 2, 2012 at 13:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .