10

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.

Ikhlak S.
9,10411 gold badges60 silver badges80 bronze badges
asked Mar 18, 2011 at 18:16
0

6 Answers 6

16

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?

answered Mar 18, 2011 at 18:21
Sign up to request clarification or add additional context in comments.

Comments

12

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

answered Mar 18, 2011 at 18:30

1 Comment

If using apache2, it is file named apache2.conf
10

the user called "www-data" in apache2

answered Apr 2, 2018 at 9:04

2 Comments

It's not apache2 here, it's CentOS apache so it runs as httpd and the user is either apache or nodbody by default.
the user is nobody, not him saying nobody :)
0

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.

answered Mar 18, 2011 at 18:21

Comments

0

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
answered May 5, 2017 at 9:31

Comments

0

This ps aux | egrep '(apache|httpd)' OR apachectl -S can also help you see what the user is. For me it was www-data

answered Jun 15, 2022 at 9:13

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.