Question

Ubuntu 16.04 WordPress LEMP Multiple Server Block Users Permissions

Read this great new article on setting up a server on 16.04 with the ideal LEMP stack for WordPress.

It works great for a single site, but not for multiple sites. This other article helps resolve that issue: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

The issue is in that article is says to assign permissions to directory as user:user but that article even notes that won’t work well in dynamic sites like WordPress.

Is there an article on how to deal with that so that on 16.04 when using having multple wordpress sites using the above articles, so that each will have permissions so that you can update WordPress and plugins via WordPress backend, and edit files via SFTP, and to make sure each site uses a different user for security?

Such perhaps site1_usr:www-data for site1 and site2_usr:www-data for site 2, and not sure if have to add users to www-data, or if each site should have a user for editing files, and a seperate user for just updating wordpress (as the secure WP article on DO is back from 2013).

Thank you!

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi,

Not sure if you have found the answer. I also got stuck exactly on that.

While I gave up on configuring user:www-data, I did move away from NGINX to apache 2.4 and php7

and configuring the apache process not to run as www-data but as another user i create - say - myapache and then modifying ENVARS to have apache run as owned by user myapache

So now I can SFTP (Netbeans remote project) and have wordpress backend process updates as well

And php7 with apache2.4 runs fine for my not too busy websites!

Just to clarify, using site1usr:www-data for instance allows one to edit files via sftp but you can install/update wordpress via GUI. Using www-data:www-data allows wordpress gui to install update but you can’t edit files via sftp.

I’m assuming the site directory should be set to either site1user:www-data or site1user:site1user and that site1user then needs to be added to the www-data group or such but hoping to find the best recommendations on that and the right commands. Thank you!