http service uptime
We all know about uptime command purpose in Linux, it is used to check system uptime like, how long the system has been running without reboot and down.
Each services has their own commands to check the service uptime, also we can check the services uptime using ps command. It will shows when the parent process started and how long the service has been running.
There are multiple method to check the uptime of http process. Some of them are below mentioned. Let’s have a look.
- web server uptime via mod_status module
The Apache mod_status module allows a server administrator to check apache web server uptime, concurrent connections and server performance with given interval through CLI, also we can access this through web browser with HTML interface.
How to Install/Enable mod_status module
By default, mod_status module enabled on Apache. The reports are commented and you can not access it. Just uncomment below code in your Apache config file to enable it.
For RHEL/CentOS/Fedora systems, open /etc/httpd/conf/httpd.conf file and uncomment the below codes.
[For Apache 2.2]
Deny from all
Allow from all
[For Apache 2.4]
Require host localhost
For Debian/Ubuntu systems, open /etc/apache2/mods-enabled/status.conf file and uncomment the below codes. Uncomment and change the “126.96.36.199/24” to allow access from other hosts.
#Require ip 192.0.1.024
- Web server uptime via PS Command
ps -eo comm,etime | grep apache2
For any query or issue, feel free to discuss on http://discuss.eduguru.in