Nagios CentOS 2 – Configuring The Nagios Apache File

Nagios CentOS 2 – Configuring The Nagios Apache File

The next part of the installation is to edit the nagios.conf file for Apache on the server.

The modifications below are to lock down access to Nagios as the default configuration is to allow from all.  If you are not worried about locking down access to the Nagios web-site to only specified subnets then skip this section.

To edit the nagios.conf file on the server perform the following steps :-

Edit the file /etc/httpd/conf.d/nagios.conf

  • Locate the section <Directory “/usr/lib/nagios/cgi”>
  • Search for the line below and comment out using a # (Hash) sign at the start of the line :-

Allow from all

E.G. – #Allow from all

  • Next find the line below and uncomment the line by removed the # (Hash) sign at the start of the line :-

#Allow from 127.0.0.1

E.G. – Allow from 127.0.0.1

  • Next change the local host IP address 127.0.0.1 to the IP subnet you wish to allow access to Nagios from

Allow from 127.0.0.1

E.G. – Allow from 10.20.30

  • Next locat the section <Directory “/usr/share/nagios”>
  • Search for the line below and comment out using a # (Hash) sign at the start of the line :-

Allow from all

E.G. – #Allow from all

  • Next find the line below and uncomment the line by removed the # (Hash) sign at the start of the line :-

#Allow from 127.0.0.1

E.G. – Allow from 127.0.0.1

  • Next change the local host IP address 127.0.0.1 to the IP subnet you wish to allow access to Nagios from

#Allow from 127.0.0.1

E.G. – Allow from 10.20.30

  • Save and exit the file

Reloading The Apache Configuration

Once the nagios.conf has been modified Apache will need to be reloaded.  To reload the Apache configuration perform the following steps :-

  • In the command line execute the following command :-

service httpd reload