How to check is Apache2 is stopped in Ubuntu?

Li' picture Li' · Apr 22, 2013 · Viewed 103.8k times · Source

I want to make sure apache2 service is stopped.

1. I need to verify if apache2 is installed or not.

when I type:

sudo /etc/init.d/apache2 stop

I got:

sudo: /etc/init.d/apache2: command not found

Does this mean apache2 is not installed? Or is it installed in another place?

2. check apache2 process:

when I type:

ps a | grep apache2

I got:

10448 pts/4    S+     0:00 grep --color=auto apache2

Does it mean apache2 is running?

3. http://localhost test

I got:

Google Chrome could not connect to localhost

How can I verify that Apache2 is stopped?

Answer

Cubatown picture Cubatown · Apr 22, 2013

In the command line type service apache2 status then hit enter. The result should say:

Apache2 is running (pid xxxx)