Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is there any command to find out if apache is running or not.

and on which port except by seeingports.conf files

When i try netstat command then apaches does not appear in that.

but when i use apache2 restart command then it says restart ok

i don't know where it is running

share|improve this question

5 Answers 5

up vote 8 down vote accepted

lsof -i list open ports and the corresponding applications.

For a general check if an app is running you could just use ps aux | grep apache2

share|improve this answer
Or "ps aux | grep httpd" for redhat/centos. – lg. Apr 13 '10 at 7:19
SvW = Sportverein Werder ? :D – Ibrahim Apachi Aug 15 '14 at 10:20
netstat -anp | grep apache

You could see the listening port and PID from this if it's running.

share|improve this answer
sudo netstat -anp | grep apache – Laukik Patel Feb 26 at 5:43
It's showing in the "Local Address" column. Does it mean apache is running at the same ip address of the machine, on port 80? – Rodrigo Sep 30 at 14:33

If lsof is installed you could try something like this:

lsof | grep httpd

(for centos and friends)

lsof  | grep apache

(for debian and company)

share|improve this answer
netstat -tulpn

You'll see the Pid / Binary name on far right column, match this to your running apache instance.

share|improve this answer

for freebsd sockstat | grep apache httpd

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.