Page 1 of 1
SSL Webinterface on Nagios3/Debian 7.6
Posted: Wed Sep 10, 2014 4:23 am
by CKSWR
Hi,
i've got a Problem with the Configuration of the Apache2 with SSL for the Webinterface of Nagios 3.4.1. I've tryed many of the Results from Google but nothing works... Maybe i'm too stupid.
Can anyone help me, what i have to do?
Thanks.
Sorry for my bad english.
Re: SSL Webinterface on Nagios3/Debian 7.6
Posted: Wed Sep 10, 2014 5:07 pm
by abrist
Start by posting the apache vhost config for the nagios vhost. It is usually located at:
Re: SSL Webinterface on Nagios3/Debian 7.6
Posted: Thu Sep 11, 2014 4:19 am
by CKSWR
I think you mean this one?
Code: Select all
# apache configuration for nagios 3.x
# note to users of nagios 1.x and 2.x:
# throughout this file are commented out sections which preserve
# backwards compatibility with bookmarks/config for older nagios versios.
# simply look for lines following "nagios 1.x:" and "nagios 2.x" comments.
ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3
# nagios 1.x:
ScriptAlias /cgi-bin/nagios /usr/lib/cgi-bin/nagios3
ScriptAlias /nagios/cgi-bin /usr/lib/cgi-bin/nagios3
# nagios 2.x:
#ScriptAlias /cgi-bin/nagios2 /usr/lib/cgi-bin/nagios3
#ScriptAlias /nagios2/cgi-bin /usr/lib/cgi-bin/nagios3
# Where the stylesheets (config files) reside
Alias /nagios3/stylesheets /etc/nagios3/stylesheets
# nagios 1.x:
#Alias /nagios/stylesheets /etc/nagios3/stylesheets
# nagios 2.x:
#Alias /nagios2/stylesheets /etc/nagios3/stylesheets
# Where the HTML pages live
Alias /nagios3 /usr/share/nagios3/htdocs
# nagios 2.x:
#Alias /nagios2 /usr/share/nagios3/htdocs
# nagios 1.x:
#Alias /nagios /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 /etc/nagios3/htpasswd.users
# nagios 1.x:
#AuthUserFile /etc/nagios/htpasswd.users
require valid-user
</DirectoryMatch>
<Directory /usr/share/nagios3/htdocs>
Options +ExecCGI
</Directory>
# Enable this ScriptAlias if you want to enable the grouplist patch.
# See http://apan.sourceforge.net/download.html for more info
# It allows you to see a clickable list of all hostgroups in the
# left pane of the Nagios web interface
# XXX This is not tested for nagios 2.x use at your own peril
#ScriptAlias /nagios3/side.html /usr/lib/cgi-bin/nagios3/grouplist.cgi
# nagios 1.x:
#ScriptAlias /nagios/side.html /usr/lib/cgi-bin/nagios3/grouplist.cgi
Re: SSL Webinterface on Nagios3/Debian 7.6
Posted: Fri Sep 12, 2014 2:46 pm
by abrist
I don't see any mention of ssl in the vhost file. How are you enabling ssl? Through the default ssl vhost file, through httpd.conf, or some other mechanism?
Re: SSL Webinterface on Nagios3/Debian 7.6
Posted: Mon Sep 15, 2014 3:10 am
by CKSWR
I removed the SSL entries from the "nagios.conf" file because it did not work. I was searching on Google for a general guide to it then try. Maybe you can tell me what changes I need to make. Thank you.
Re: SSL Webinterface on Nagios3/Debian 7.6
Posted: Mon Sep 15, 2014 4:52 pm
by sreinhardt
To quote the
debian handbook:
Apache 2.2 includes the SSL module required for secure HTTP (HTTPS) out of the box. It just needs to be enabled with a2enmod ssl, then the required directives have to be added to the configuration files. A configuration example is provided in /usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-ssl.conf.gz.
→
http://httpd.apache.org/docs/2.2/mod/mod_ssl.html
That said, here is a basic ssl configuration file that will need to be enabled and possibly configured a bit, mostly ssl cert paths, since it is from CentOS land:
https://github.com/sreinhardt/Docker-Te ... d/ssl.conf
Once that's done, you will need to make a new vhost for nagios listening on :443 with all the same settings as your port 80 vhost is set for currently. A basic vhost config for both ports can be found:
https://github.com/sreinhardt/Docker-Te ... sting.conf
Restart apache2 and ideally should be all set! Of course iptables, or debian vs centos differences may apply.
Re: SSL Webinterface on Nagios3/Debian 7.6
Posted: Tue Sep 16, 2014 3:22 am
by CKSWR
Thanks, I'll try it and then report.
Re: SSL Webinterface on Nagios3/Debian 7.6
Posted: Tue Sep 16, 2014 8:35 am
by CKSWR
It runs. Thank you.