[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving Nagios3 Apache configuration to a VirtualHost setup



Shaun <debian <at> gmsl.co.uk> writes:

> 
> HI there,
> 
> When you install Nagios it installs itself so that $SERVER/nagios3/
> takes over your site. I have setup an extra vhost on my apache server
> and I don't want nagios to take over all vhosts. I just want to setup,
> say, nagios.mydomain.com/nagios3/ as being my nagios monitoring station.
> 
> The config that comes with debian is:
> 


I had a similar case and the following is what worked for me (I have a line
in /etc/hosts for nagios.local to resolve to 127.0.0.1):

<VirtualHost *:80>
    ServerName  nagios.local
    DocumentRoot /usr/share/nagios3/htdocs
    ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
    ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3
    Alias /nagios3/images /usr/share/nagios3/htdocs/images
    Alias /images /usr/share/nagios3/htdocs/images
    Alias /nagios3/stylesheets /etc/nagios3/stylesheets
    Alias /stylesheets /etc/nagios3/stylesheets
    Alias /nagios3/js /usr/share/nagios3/htdocs/js
    <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 /etc/nagios3/htpasswd.users
        require valid-user
    </DirectoryMatch>
    <Directory /usr/share/nagios3/htdocs>
        Options +ExecCGI
    </Directory>
</VirtualHost>



Reply to: