Questions installing WP on LEMP

Posted April 3, 2015 3k views

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? 


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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.