How to get the name of the apache user
10,855
Solution 1
Try
ps aux | grep httpd
or
ps aux | grep apache
The first column of the output is the user that is running the process.
Sample output from a CentOS system
apache 4173 0.0 0.6 239100 6720 ? S Aug04 0:00 /usr/sbin/httpd
and an Ubuntu system
www-data 3124 0.0 0.2 6452 2180 ? S Aug04 0:00 /usr/sbin/apache2 -k start
On CentOS apache is running as user apache
and on Ubuntu it's running as www-data
Solution 2
just see on httpd.conf (usually on /etc/httpd/conf/) grep User httpd.conf
Author by
UpCat
Updated on September 18, 2022Comments
-
UpCat over 1 year
Possible Duplicate:
Finding out what user Apache is running as?I use openSuse and I try to find out the name of the apache user. So I enter
vim /etc/passwd
in the terminal. Or
ps -a
Both don't have apache listed. I have mysql and other stuff but apache isn't mentioned. Any ideas?
ps aux | grep httpd
Output:
-
user9517 over 12 yearsYour apache is running as user
wwwrun
-
UpCat over 12 yearsthanks and whats the group for that user?
-
Greg Petersen over 12 yearsCheck with
groups wwwrun
. -
GuyT over 9 yearsOn OpenSuSe it's done by following command:
grep -i "^user" /etc/apache2/uid.conf
-
-
UpCat over 12 yearsthe first column is named with root, so is root the apache user?
-
UpCat over 12 yearsI edited my question. habe a look at the output
-
Anarko_Bizounours over 12 yearsno output pal. You messed up the link!