Questions installing WP on LEMP

April 3, 2015 956 views
Nginx WordPress LEMP

I'm almost to finish the WP installation on my brand new LEMP server, but I'm stacked on this step. I will copy what the tutorial says:

<^>The group that nginx operates under is www-data. For the user portion, enter your user account name. We will demonstrate with an account called demo here:

sudo chown -R demo:www-data /var/www/html/*

Then by user (demo on the example) I don't know which user I should put. Is the user that I'm using on the SSH? 

2 Answers

If you are logging in via ssh as root or have not set up an additional user you can use the following command:

sudo chown -R www-data:www-data /var/www/html/*

This will set the ownership to the user and group that nginx runs as and you should not encounter any permission problems. You may need to run this again if you upload any files using SFTP since they would be owned by root upon upload.

Thanks it finally works with that command. But for newbies, I think that tutorial should be edited, since if you follow the exact steps, you can't grant full permissions to the user to upload.

Have another answer? Share your knowledge.