1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Setting Up The Web Interface</title>
<STYLE type="text/css">
<!--
.Default { font-family: verdana,arial,serif; font-size: 8pt; }
.PageTitle { font-family: verdana,arial,serif; font-size: 12pt; font-weight: bold; }
-->
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="black" class="Default">
<p>
<div align="center">
<h2 class="PageTitle">Setting Up The Web Interface</h2>
</div>
</p>
<hr>
<p>
<strong><u>Notes</u></strong>
</p>
<p>
In these instructions I will assume that you are running the <a href="http://www.apache.org">Apache</a> web server on your machine. If you are using some other web server, you'll have to make changes where appropriate. I am also assuming that you used the <i>/usr/local/nagios</i> as the installation prefix.
</p>
<p>
<strong><u>Sample Configuration</u></strong>
</p>
<p>
A sample Apache config file snippet is created when you run the configure script - you can find the sample config file (named <i>httpd.conf</i>) in the <i>sample-config/</i> subdirectory of the Nagios distribution. You will need to add the contents of this file to your Apache configuration files before you can access the Nagios web interface. The instructions found below detail how to manually add the appropriate configuration entries to Apache.
</p>
<p>
<strong><u>Configure Aliases and Directory Options For The Web Interface</u></strong>
</p>
<p>
First you'll need to create appropriate entries for the Nagios web interface (HTML and CGIs) in your web server config file. Add the following snippet to your web server configuration file (i.e. <b>httpd.conf</b>), changing it to match any directory differences on your system.
</p>
<strong>
<font color="red">
<pre>
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Alias /nagios /usr/local/nagios/share
<Directory "/usr/local/nagios/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
</pre>
</font>
</strong>
<p>
<strong>Note:</strong> The default Nagios installation expects to find the HTML files and CGIs at <b>http://yourmachine/nagios/</b> and <b>http://yourmachine/nagios/cgi-bin/</b>, respectively. These locations can be changed using the <b>--with-htmurl</b> and <b>--with-cgiurl</b> options in the configure script.
</p>
<p>
<strong>Important!</strong> If you are installing Nagios on a multi-user system, you may want use <a href="http://cgiwrap.unixtools.org/">CGIWrap</a> to provide additional security between the CGIs and the <a href="commandfile.html">external command file</a>. If you decide to use CGIWrap, the ScriptAlias you'll end up using will most likely be different from that mentioned above. More information on doing this can be found <a href="security.html">here</a>.
</p>
<p>
<strong><u>Restart The Web Server</u></strong>
</p>
<p>
Once you've finished editing the Apache configuration file, you'll need to restart the web server with a command like this...
</p>
<p>
<strong>
<font color="red">
/etc/rc.d/init.d/httpd restart
</font>
</strong>
</p>
<p>
<strong><u>Configure Web Authentication</u></strong>
</p>
<p>
Once you have installed the web interface properly, you'll need to specify who can access the Nagios web interface. Follow <a href="cgiauth.html">these instructions</a> to do this.
</p>
<p>
<strong><u>Verify Your Changes</u></strong>
</p>
<p>
Don't forget to check and see if the changes you made to Apache work. You should be able to point your web browser at <b>http://yourmachine/nagios/</b> and get the web interface for Nagios. The CGIs may not display any information, but this will be remedied once you configure everything and start Nagios.
</p>
<hr>
</body>
</html>
|