0

I have an Ubuntu server. Apache, MySQL and VsFTPd are running on it and it hosts more than one web sites. Every web site owner has an FTP user to upload files. However, Apache is running as www-data, as default. Thus, the files uploaded using Wordpress and cache files created by caching plugins of Wordpress are owned by www-data. In order to upload files one must make his folder's permission 777, which is not safe.

Should I make Apache run as separate users for each customer?

  • Why not put all your users in group www-data? – Rinzwind Apr 17 '14 at 20:35
  • @Rinzwind- I assume the OP wants a little more separation between users. – Panther Apr 17 '14 at 20:42
1

IMO you are best off using one of two options. First would be some sort of virtualization, for example lxc , openvz, or KVM. This option gives the most separation.

Your second, and perhaps better option, is to use a feature called "home directories".

sudo a2enmod userdir

Restart apache2 daemon with following command

sudo service apache2 restart

Ceate folder “public_html” in the home directories, then set permission public_html folder to 0755

mkdir ~/public_html && chmod 0755 ~/public_html

Configure your vitrual hosts to use /home/user_name/public_html as the web root.

See:

https://help.ubuntu.com/community/ApacheMySQLPHP#Virtual_Hosts

http://kimbriggs.com/computers/computer-notes/linux-notes/apache2-public_html-virtual-directories.file

http://joao.machado-family.com/2013/06/04/ubuntu-13-04-apache2-setup-public_html/

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.