[ubuntu] How to check is Apache2 is stopped in Ubuntu?

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?

This question is related to ubuntu process apache2

The answer is


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

Apache2 is running (pid xxxx)


You can also type "top" and look at the list of running processes.


Examples related to ubuntu

grep's at sign caught as whitespace "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? "Repository does not have a release file" error ping: google.com: Temporary failure in name resolution How to install JDK 11 under Ubuntu? How to upgrade Python version to 3.7? Issue in installing php7.2-mcrypt Install Qt on Ubuntu Failed to start mongod.service: Unit mongod.service not found

Examples related to process

Fork() function in C How to kill a nodejs process in Linux? Xcode process launch failed: Security Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes Linux Script to check if process is running and act on the result CreateProcess error=2, The system cannot find the file specified How to make parent wait for all child processes to finish? How to use [DllImport("")] in C#? Visual Studio "Could not copy" .... during build How to terminate process from Python using pid?

Examples related to apache2

Only variable references should be returned by reference - Codeigniter 413 Request Entity Too Large - File Upload Issue Site does not exist error for a2ensite How to convert .pem into .key? Apache: Restrict access to specific source IP inside virtual host CodeIgniter removing index.php from url Failed Apache2 start, no error log Apache2: 'AH01630: client denied by server configuration' what does it mean "(include_path='.:/usr/share/pear:/usr/share/php')"? How to check is Apache2 is stopped in Ubuntu?