How To Check Apache Installed On Linux
Apache is a globe'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. Importantly, it's easy to install and has a unproblematic configuration as well.
Read Also: How to Hide Apache Version Number and Other Sensitive Info
In this commodity, nosotros will bear witness how to cheque Apache web server uptime on a Linux organization using different methods/commands explained below.
i. Systemctl Utility
Systemctl is a utility for controlling the systemd system and service director; information technology is used it to get-go, restart, stop services and beyond. The systemctl status sub-control, 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 condition apache2 #Debian/Ubuntu # systemctl status httpd #RHEL/CentOS/Fedora
2. Apachectl Utilities
Apachectl is a control interface for Apache HTTP server. 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).
On Debian/Ubuntu
The server-condition component is enabled by default using the file /etc/apache2/mods-enabled/status.conf.
$ sudo vi /etc/apache2/mods-enabled/status.conf
On RHEL/CentOS
To enable server-status component, create a file beneath.
# half-dozen /etc/httpd/conf.d/server-status.conf
and add together the post-obit configuration.
<Location "/server-status"> SetHandler server-status #Crave host localhost #uncomment to only allow requests from localhost </Location>
Relieve the file and shut it. Then restart the web server.
# systemctl restart httpd
If you lot are primarily using a concluding, and then y'all also need a command line web browser such every bit lynx or links.
$ sudo apt install lynx #Debian/Ubuntu # yum install links #RHEL/CentOS
And so run the command below to check the Apache service uptime:
$ apachectl condition
Alternatively, utilise the URL below to view the Apache web server status information from a graphical web browser:
http://localhost/server-status OR http:SERVER_IP/server-status
iii. ps Utility
ps is a utility which shows information concerning a selection of the active processes running on a Linux system, you can utilize information technology with grep command to check Apache service uptime as follows.
Hither, the flag:
-
-e– enables selection of every processes on the organization. -
-o– is used to specify output (comm – command, etime – process execution time and user – process possessor).
# ps -eo comm,etime,user | grep apache2 # ps -eo comm,etime,user | grep root | grep apache2 OR # ps -eo comm,etime,user | grep httpd # ps -eo comm,etime,user | grep root | grep httpd
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).
Lastly, check out more useful Apache web server guides:
- 13 Apache Web Server Security and Hardening Tips
- How to Cheque Which Apache Modules are Enabled/Loaded in Linux
- 5 Tips to Boost the Performance of Your Apache Web Server
- How to Password Protect Web Directories in Apache Using .htaccess File
In this article, we showed you three different ways to cheque Apache/HTTPD service uptime on a Linux organization. If you accept any questions or thoughts to share, do that via the comment section below.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and nigh trusted community site for any kind of Linux Manufactures, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published manufactures available FREELY to all.
If y'all like what you lot are reading, please consider buying united states of america a java ( or two ) equally a token of appreciation.
We are thankful for your never catastrophe support.
Source: https://www.tecmint.com/check-apache-httpd-status-and-uptime-in-linux/
Posted by: bloomwastles.blogspot.com

0 Response to "How To Check Apache Installed On Linux"
Post a Comment