Tips - Change Nagios default URL access
By default, the Nagios URL is http(s)://<subdomain>.<domain>/nagios
. If you want to change the default Nagios path to another path, then the information below can help you.
Benedikt Geyer©
Prerequisites
- A web serveur must be installed and configured
- Nagios must be installed and configured
The Tips
- You will need to edit the
/usr/local/etc/nagios/cgi.cfg
file for Nagiossudo vi /usr/local/nagios/etc/cgi.cfg
- Change
url_html_path=/nagios
tourl_html_path=/<new_url_html_path>
- Change
- Edit
/usr/local/etc/nagios/nagios.conf
sudo vi /usr/local/etc/nagios/nagios.conf
- Change
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
toScriptAlias /<new_url_html_path>/cgi-bin "/usr/local/nagios/sbin"
- Change the line
Alias /nagios "/usr/local/nagios/share/htdocs"
toAlias /<new_url_html_path> "/usr/local/nagios/share/htdocs"
- Change
- Edit your
/usr/local/nagios/share/config.inc.php
filesudo vi /usr/local/nagios/share/config.inc.php
- Change
$cfg['cgi_base_url']='/nagios/cgi-bin';
to$cfg['cgi_base_url']='/<new_url_html_path>/cgi-bin';
- Change
- Restart
apache
ornginx
andnagios