Serve Nagios 3 as a standalone Apache site
Serve Nagios 3 as a standalone Apache site
Written in 2015 for Nagios 3 and Apache 2.4 on Ubuntu. Commands and paths may be outdated.
By default Nagios 3 is served as an alias, your-domain.com/nagios3. To serve it as a standalone site:
Disable the default config:
a2disconf nagios3Link the Nagios Apache config as a site:
ln -s /etc/nagios3/apache2.conf /etc/apache2/sites-enabled/your-domain.com.confEdit that file to look like this:
<VirtualHost *:80> ServerAdmin webmaster@example.com ServerName nagios.example.com ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3/ Alias /stylesheets /etc/nagios3/stylesheets/ Alias / /usr/share/nagios3/htdocs/ DocumentRoot /usr/share/nagios3/htdocs/ <DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)> Options FollowSymLinks DirectoryIndex index.php index.html AllowOverride AuthConfig Order Allow,Deny Allow From All AuthName "Nagios Access" AuthType Basic AuthUserFile /path/to/nagios3/htpasswd.users require valid-user </DirectoryMatch> <Directory /usr/share/nagios3/htdocs> Options +ExecCGI </Directory> ErrorLog ${APACHE_LOG_DIR}/nagios.example.com-error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/nagios.example.com-access.log combined </VirtualHost>In
/etc/nagios3/cgi.cfg, changeurl_html_pathfrom/nagios3to/.Restart Apache:
service apache2 restart
Last updated on