Home > Article > Operation and Maintenance > How to check if apache is running in linux
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. .
#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.
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
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.
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
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!