Leonard Challis
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Change wordpress usergroup with pleskReplying to this post as it is still quite prominent on Google searches.
You need to remember a few things when running the chown command in this context:
You must specify the correct user/group
chown stands for “change ownership” – this command will change the owner of a file and the group which the file belongs to. Samuel B uses www-data because his Apache webserver is running under the user www-data. I believe some versions of plesk run as the user apache. A simple way of finding this out is running:cat /etc/passwd
You will see a user name www-data or apache. Use that in the chown command.
Run chown as superuser
Changing permissions/ownership of files is something a superuser (root) must do. On some systems you can runsudo chown ...
or similar, but on a lot of Plesk installations your normal user account won’t be in the sudoers file. You will have been given a root account completed with password – ssh to the server and log in as root then run that command.breakdown of chown
chown is simply a command on the Linux command line. As with all commands, you can read a manual page by typingman command
– i.e.man chown
. That said, the chown command is simple enough…chown -R www-data:www-data /var/www
chown – the name of the command
-R – recursive – meaning run this command on all files including those inside folders (and subequent folders) until all are chowned
www-data:www-data – On the left of the colon is a username and on the right is the groupname. To set just a username and or groupname just omit the one you don’t want.
/var/www – the file/folder to chown. This can be either a file or folder. Remember if you specify a folder without the -R option it will only chown that folder – the contents of that folder will remain the same.