Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running a Ubuntu server instance. It's on EC2 so the default setup is a admin account(I know it's not root) named Ubuntu. I have already installed Apache HTTP 2.4 from source, but realized I would like to run Apache HTTPD under a non admin user account named Apache. Any suggestions for making Apache HTTPD run under its own account?

share|improve this question
add comment

migrated from stackoverflow.com Feb 4 '13 at 7:02

This question came from our site for professional and enthusiast programmers.

1 Answer

The Apache httpd switches to a different user already by default. On Ubuntu have a look in /etc/apache2/apache2.conf at User parameter which uses a variable defined in /etc/apache2/envvars. If you are not happy with the default user www-data you can change it there.

If you want to start the daemon as non-root user from the very beginning, you will have to modify the /etc/init.d/apache2 startup script. That will be problematic, for example it will not be able to listen on port 80, it will not be able to write its .pid file in /var/run etc.

share|improve this answer
    
All I want is the safest setup possible. Apache and MongoDB both suggest running the daemon under its own account. I was confused how to do that but it seems like they automatically do it and they are referring to people who changes default settings. –  aknewhope Feb 14 '13 at 15:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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