How to enable the Apache server-status on centos 7

Enabling the Apache server-status on centos 7

mod_status is an Apache module which helps to monitor web server load and current httpd connections with an HTML interface which can be accessible via a web browser. Apache’s mod_status shows a plain HTML page containing the information about current status of web server state.

Installation

Let's start by Installing the httpd package on centos 7 machine.

[root@linuxhelp1 ~]# yum install httpd -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.xeonbd.com
 * extras: mirror.xeonbd.com
 * updates: mirror.xeonbd.com
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-88.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-88.el7.centos for package: httpd-2.4.6-88.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-88.el7.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-88.el7.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-88.el7.centos.x86_64
.
.
.
Verifying  : apr-1.4.8-3.el7_4.1.x86_64                                                       2/5 
  Verifying  : mailcap-2.1.41-2.el7.noarch                                                      3/5 
  Verifying  : httpd-2.4.6-88.el7.centos.x86_64                                                 4/5 
  Verifying  : apr-util-1.5.2-6.el7.x86_64                                                      5/5 

Installed:
  httpd.x86_64 0:2.4.6-88.el7.centos                                                                

Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7_4.1                           apr-util.x86_64 0:1.5.2-6.el7              
  httpd-tools.x86_64 0:2.4.6-88.el7.centos               mailcap.noarch 0:2.1.41-2.el7              

Complete!

Start and enable the apache service.

[root@linuxhelp1 ~]# systemctl start httpd
 [root@linuxhelp1 ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

Configure server-status on apache main configuration file.

[root@linuxhelp1 ~]# vim /etc/httpd/conf/httpd.conf
    <IfModule mod_status.c>
    ExtendedStatus On
   <Location /server-status>
    SetHandler server-status
   Allow from all
   </Location>
   </IfModule>

In order to make the changes effect, you'll need to restart httpd.

[root@linuxhelp1 ~]# systemctl restart httpd

The Apache status page will be accessible via your domain name along with the “/server-status” at the end. i.e) http://serveripaddress/server-status or http://serev-hostname/server-status With this the method to enable the Apache server-status on centos 7 comes to an end.

Tag : Apache CentOS
FAQ
Q
How to check apache server status from browser?
A
Once you enable the apache server status you can visit the domain name along with /server-status
Q
What is the location of apache configuration File?
A
/etc/httpd/conf/httpd.conf is the location of apache configuration File
Q
What is Virtual Hosting?
A
Virtual Hosting in Apache allows you to host multiple websites on a single instance. You can either create IP based or Name based on virtual hosting.
Q
Which module is responsible for Apache Redirection?
A
mod_rewrite is responsible for the redirection, and this must be uncomment in httpd.conf file.



LoadModule rewrite_module modules/mod_rewrite.so
Q
Which File is considered as Main configuration File of Apache?
A
httpd.conf is the main configuration file used in Apache