≡ Menu

Linux: Find Out Apache User Name

How do I find out my apache username under Linux operating system or CentOS Linux server?

There are various methods to find out apache user name who is running httpd server

lsof command

Run the following command:

lsof -i
lsof -i | less
lsof -i | grep :http

Sample outputs:

httpd 17074     dc22    4u  IPv4 42496401       TCP (LISTEN)
httpd 17230    vivek    4u  IPv4 42499206       TCP (LISTEN)
httpd 17336    jail2    5u  IPv4 42499357       TCP (LISTEN)
httpd 31723  phpcgi1    4u  IPv4 52573816       TCP (LISTEN)


  1. httpd (1st column) – Apache service / server name
  2. 17074 (2nd column) – Apache server PID
  3. dc22 (3rd column) – Apache server username for PID. This gives you apache username.

httpd.conf file

Another method is to go through config file httpd.conf and find out user and group name:

egrep -iw --color=auto 'user|group' /etc/httpd/conf/httpd.conf
egrep -iw --color=auto '^user|^group' /etc/httpd/conf/httpd.conf

Sample oututs:

User apache
Group apache
Share this tutorial on:

{ 1 comment… add one }
  • raice October 23, 2013, 7:04 am

    thank you! This was the final step I needed

Leave a Comment

   Tagged with: , , , , , , , , , ,