Security – How to run Apache as another user? (as ‘www’, or ‘apache’) on the

apache-2.2httpd.confSecurityuser-accounts

I just recently deployed a LAMP stack that came as a package for Linode (a VPS host), I can successfully run Apache 2 but the process and all my files within are owned by root. On my shared web host I could run as nobody or similar to help restrict access, how can I do this myself on my VPS?

I think the steps would be:
– Create user apache2
– Write in httpd.conf to use apache2?
– recursively chown all my files to apache2.

I simply can not find a solution except to use another package and have it installed like that, I would really enjoy some guidence on this. Thank you.

Best Answer

The User directive sets the user httpd runs as, if for some reason the distro doesn't set it in its package.