Bear with me, this is going to be tough to word clearly.

Let's say I have a VPS account and I want to resell, and host a bunch of people on my server, giving them their own separate domains. Each user should be able to ftp in and upload files to their domain. The catch here is, Apache likes to run as a single process owner (usually www-data), and this creates a problem. I can check /etc/apache2/envvars to change the user/group to something else, but I need each user to have the proper rights to their own folders. And Apache needs to be set up in a way that the users don't have to set folders/files writable to a certain group in order for PHP to write to them (a la WordPress).

How do I set things up to work this way, for a multi-user shared hosting environment?

  • You could use php + suexec to run the php process as the user, no issue with file permissions then.
    – rcomblen
    Apr 11, 2013 at 7:01

2 Answers 2


First use apache2-mpm-itk which change the user by VirtualHost. Define a user and its virtualhost, and define the permissions to 700. Nobody can read other user files. The files created in the VirtualHost by Apache is owned by the user and not by www-data.

  • Any potential issues with using ITK on a VPS with 1GB RAM? Apache's docs warn: "MPM-ITK, on the other hand, processes request headers under root, switches to the target userid, and then kills the httpd process when finished serving the connection. As discussed above, this has serious security and performance implications." Apr 11, 2013 at 8:02
  • I dont't think you will have a problem with that. It depends of your websites of course. It there is big PHP memory, there can be a problem in all the solutions
    – Dom
    Apr 11, 2013 at 8:38

The Apache Wiki has a page discussing the issues, and some solutions. See it here: http://wiki.apache.org/httpd/PrivilegeSeparation

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.