


Lastly, check out more useful Apache web server guides: The sample output below shows that apache2 service has been running for 4 hours, 10 minutes and 28 seconds (only consider the one started by root). # ps -eo comm,etime,user | grep root | grep httpd # ps -eo comm,etime,user | grep root | grep apache2

-o – is used to specify output (comm – command, etime – process execution time and user – process owner).-e – enables selection of every processes on the system.Ps is a utility which shows information concerning a selection of the active processes running on a Linux system, you can use it with grep command to check Apache service uptime as follows. Then run the command below to check the Apache service uptime: $ apachectl statusĪlternatively, use the URL below to view the Apache web server status information from a graphical web browser: OR If you are primarily using a terminal, then you also need a command line web browser such as lynx or links. #Require host localhost #uncomment to only allow requests from localhost To enable server-status component, create a file below. $ sudo vi /etc/apache2/mods-enabled/nfĪpache Mod_Status Configuration On RHEL/CentOS

The server-status component is enabled by default using the file /etc/apache2/mods-enabled/nf. This method requires the mod_status (which displays info about the server is performing including its uptime) module installed and enabled (which is the default setting). Apachectl UtilitiesĪpachectl is a control interface for Apache HTTP server. # systemctl status httpd #RHEL/CentOS/FedoraĬheck Apache Status Using Systemctl 2. The systemctl status sub-command, as the name states is used to view the status of a service, you can use it for the above purpose like so: $ sudo systemctl status apache2 #Debian/Ubuntu Systemctl is a utility for controlling the systemd system and service manager it is used it to start, restart, stop services and beyond. In this article, we will show how to check Apache web server uptime on a Linux system using different methods/commands explained below. Read Also: How to Hide Apache Version Number and Other Sensitive Info Importantly, it’s easy to install and has a simple configuration as well. Apache is a world’s most popular, cross platform HTTP web server that is commonly used in Linux and Unix platforms to deploy and run web applications or websites.
