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 10.8.4.229:http (LISTEN) httpd 17230 vivek 4u IPv4 42499206 TCP 10.8.4.230:http (LISTEN) httpd 17336 jail2 5u IPv4 42499357 TCP 10.8.4.228:https (LISTEN) httpd 31723 phpcgi1 4u IPv4 52573816 TCP 10.8.4.227:http (LISTEN)
Where,
- httpd (1st column) - Apache service / server name
- 17074 (2nd column) - Apache server PID
- 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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop











{ 0 comments… add one now }