Hey guys,
I got nagios set up like this:
I created the directory /var/www/nagios and copied the contents of /usr/lib/cgi-bin/nagios2 and /usr/share/nagios2/htdocs in there, all owned by the www-data - User:
Code:
mkdir /var/www/nagios
mkdir /var/www/nagios/cgi-bin /var/www/nagios/htdocs
cp /usr/lib/cgi-bin/nagios2/* /var/www/nagios/cgi-bin/
cp -R /usr/share/nagios2/htdocs/* /var/www/nagios/htdocs/
chown -R www-data.www-data /var/www/nagios
Then I created the file
/etc/apache2/sites-available/nagios2.conf with the following content:
Code:
#
# nagios Virtual Host Webinterface
#
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin admin@mydomain.com
DocumentRoot /var/www/nagios/htdocs
ServerName nagios.mydomain.com
ErrorLog /var/log/apache2/nagios.mydomain.com-error.log
CustomLog /var/log/apache2/nagios.mydomain.com-access.log combined
ScriptAlias /cgi-bin/nagios2 /var/www/nagios/cgi-bin
ScriptAlias /nagios2/cgi-bin /var/www/nagios/cgi-bin
<Directory /var/www/nagios>
Options FollowSymLinks
DirectoryIndex index.html
AllowOverride AuthConfig
Order Allow,Deny
Allow From All
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios2/htpasswd.users
require valid-user
</Directory>
</VirtualHost>
and enabled it via
Code:
a2ensite nagios2.conf
/etc/init.d/apache2 reload
That's all. It's working.
(If I missed some explanation, please tell me)
Is this worth making a Wiki HowTo of it?
Greetings
FeG