2

I ran the following command, when logged into my shared Linux host to see what user Apache was running as:

ps aux | egrep '(apache|httpd)'

And it was the same user that I use on the server.

ie.

myuser@example.com [~/public_html]# ps aux | egrep '(apache|httpd)'
myuser  44904  0.0  0.0  61244   724 pts/0    S+   15:43   0:00 egrep (apache|httpd)

Is that standard for shared hosts? On my development computer apache runs under the user www-data, and in documentation or tutorials on file permissions for certain CMS environments, I see reference to Apache working under the user www-data all the time.

migrated from serverfault.com Dec 3 '15 at 23:32

This question came from our site for system and network administrators.

  • 1
    I usually see this on nonshared servers. May be they can easily identify the user and its webuser. – Arun Anson Dec 4 '15 at 14:20
1

Webservers run with www-data as user, as what you saw is just the process of the command you typed

  • How would one check to confirm this? I was using this serverfault.com/questions/125865/… – David Csonka Dec 3 '15 at 23:53
  • 1
    You can use this cat /etc/apache2/envvars | grep APACHE_RUN_USER or grep the user instead ps aux | grep www-data – Jajo Dec 4 '15 at 0:00
  • 1
    ps aux | grep httpd – Jajo Dec 4 '15 at 0:13
  • 1
    Shared host webservers uses user nobody – Jajo Dec 4 '15 at 7:09
  • 1
    On a shared host, Apache cannot run as the user nor is this a good idea for security. Apache always installs to use a made-up non-privileged user name typically www-data. I have seen nobody on older installs though it can/may still be used in some cases. It all depends upon the install since the packages will vary depending upon the OS and who created the package. – closetnoc Dec 4 '15 at 14:32

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.