Home  >  Article  >  Operation and Maintenance  >  How to check if apache is running in linux

How to check if apache is running in linux

青灯夜游
青灯夜游Original
2022-07-01 18:06:109169browse

3 ways to check: 1. Execute the "sudo systemctl status apache service name" command. If there is the "running" keyword in the output result, it means it is running. 2. Execute the "service httpd status" command. If the output result contains the "running" keyword, it means it is running. 3. Execute the "chkconfig --list" command. If the output result contains the "httpd" keyword, it means it is running. .

How to check if apache is running in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Apache is the world's most popular cross-platform HTTP web server, commonly used on Linux and Unix platforms to deploy and run web applications or websites. Importantly, it is easy to install and has a simple configuration.

3 ways to check whether apache is running in Linux

1. Use the Systemctl tool

Systemctl is a utility used to control system and service managers; it is used to start, restart, stop services and beyond. systemctl status subcommand, as name status is used to view the status of the service. You can use it for the above purposes, as follows:

$ sudo systemctl status apache2	  #Debian/Ubuntu

How to check if apache is running in linux

2. Use Command service httpd status command to check the startup status of apache

If stopped appears, it means that the service is stopped. If running appears, it means the service is started.

How to check if apache is running in linux

How to check if apache is running in linux

3. Use the command chkconfig --list command to view the startup status of apache

As shown in the figure: If the apache service has been started, then there will be the httpd keyword

How to check if apache is running in linux

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of How to check if apache is running in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn