How to check on which port apache is running

Solution 1:

netstat -anp | grep apache

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

Solution 2:

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


Solution 3:

netstat -tulpn

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


Solution 4:

If lsof is installed you could try something like this:

lsof | grep httpd

(for centos and friends)

lsof  | grep apache

(for debian and company)