Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache user does not exist

Tags:

linux

apache

I'm trying to run the command, chown -R apache:apache xyz But I'm getting error, chown: apache:apache': invalid user

Then I tried for the user www-data, but with same results.

Then I tried to check who owns the apache process by running, ps -Af |grep httpd. I get the following,

root     29577     1  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29754 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29756 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29757 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29758 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29759 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29760 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
root     29785 29358  0 18:04 pts/0    00:00:00 grep httpd

So, where is the apache user?

Thanks.

like image 333
tecman Avatar asked Mar 18 '11 18:03

tecman


People also ask

What user should apache run as?

Information. Although Apache is typically started with root privileges in order to listen on port 80 and 443, it can and should run as another non-root user in order to perform the web services. The Apache User and Group directives are used to designate the user and group that the Apache worker processes will assume.

What is the apache user in CentOS?

Apache, in its working process, defines what user Apache is running as in the configuration files. It means you can check those files to see the user configured. You can see the user is www-data on the Ubuntu server. Here, the user is apache on the CentOS server.


2 Answers

Your apache runs as the user called "nobody" (Yes nobody is a username).

I have newer seen a linux where the apache user were called apache but you can configure the name in the apache config. Which linux version are you using?

like image 128
MTilsted Avatar answered Oct 20 '22 18:10

MTilsted


look in the configuration for apache - httpd.conf. The following lines should give you the needed informations.

For the user do:

find / -name httpd.conf | xargs grep -i "^user"

and for the group do:

find / -name httpd.conf | xargs grep -i "^group" 

-Martin

like image 32
MNeimeier Avatar answered Oct 20 '22 20:10

MNeimeier