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, 2014 at 20:35
  • @Rinzwind- I assume the OP wants a little more separation between users.
    – Panther
    Apr 17, 2014 at 20:42

1 Answer 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.





Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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