7
votes

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.

5

5 Answers

14
votes

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?

12
votes

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

7
votes

the user called "www-data" in apache2

0
votes

Not all linux servers use apache and group apache. It looks like the server is running the process as nobody.

Are you root on the server? If so you can look in the /etc/groups file to see what groups are defined.

0
votes

I've got the same problem when triyng to make the chroot with only some libraries. When I tried to su the same message was happened:

su: user xxxxxdoes not exist

Seems not all libraries was copied to the chroot subdirectory, so you can try to copy all if you've prepared the chroot dir

cp --parent -avR /usr/lib64 /CHROOT_DIR
cp --parent -avR /usr/lib /CHROOT_DIR
ln -s /CHROOT_DIR/usr/lib64 /CHROOT_DIR/lib64
ln -s /CHROOT_DIR/usr/lib64 /CHROOT_DIR/lib64