113 | | echo 'apache22_enable="YES"' >> /etc/rc.conf |
114 | | |
| 117 | php-module is in /usr/ports/www, install separately |
| 118 | cd /usr/ports/lang/php52-extensions |
| 119 | make install clean |
| 120 | |
| 121 | echo 'apache24_enable="YES"' >> /etc/rc.conf |
| 122 | test apache (browser to http://<ip-adres>) |
| 123 | }}} |
| 124 | 3. php |
| 125 | {{{ |
| 126 | - pkg install php54 en php54-extensions |
| 127 | - activeer php configuration cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini |
| 128 | - configureer apache voor php |
| 129 | edit /usr/local/etc/apache22/httpd.conf: |
| 130 | LoadModule cgi_module |
| 131 | DirectoryIndex index.php index.html index.htm |
| 132 | AddType application/x-httpd-php .php |
| 133 | AddType application/x-httpd-php-source .phps |
| 134 | AddHandler cgi-script .cgi |
| 135 | - check php info pagina. De standaard document root in apache24 is /usr/local/www/apache22/data. Maak een php-testbestand aan |
| 136 | (echo “<? phpinfo(); ?>” >> /usr/local/www/apache22/data/test.php |
| 137 | check de pagina http://<ip-sdres>/test.php |
| 138 | }}} |
| 139 | 4. installeer nagios |
| 140 | {{{ |
| 141 | cd /usr/ports/net-mgmt/nagios |
| 142 | make install clean |
| 143 | default installatie, voeg NETSNMP toe aan nagios group en user. |
| 144 | echo 'nagios_enable="YES"' >> /etc/rc.conf |
| 145 | kopieer de voorbeeld pagina naar de config files |
| 146 | cd /usr/local/etc/nagios/ |
| 147 | cp cgi.cfg-sample cgi.cfg |
| 148 | cp nagios.cfg-sample nagios.cfg |
| 149 | cp resource.cfg-sample resource.cfg |
| 150 | |
| 151 | Idem in /usr/local/etc/nagios/objects/: |
| 152 | cp commands.cfg-sample commands.cfg |
| 153 | cp contacts.cfg-sample contacts.cfg |
| 154 | cp localhost.cfg-sample localhost.cfg |
| 155 | cp printer.cfg-sample printer.cfg |
| 156 | cp switch.cfg-sample switch.cfg |
| 157 | cp templates.cfg-sample templates.cfg |
| 158 | cp timeperiods.cfg-sample timeperiods.cfg |
| 159 | |
| 160 | check de nagios configuratie op fouten: |
| 161 | # nagios -v /usr/local/etc/nagios/nagios.cfg |
| 162 | |
| 163 | Maak een admin password aam voor de nagios home page (admin is nagiosadmin) |
| 164 | htpasswd -c /usr/local/etc/nagios/htpasswd.users nagiosadmin |
| 165 | |
| 166 | Voeg Nagios toe aan de apache configuratie: |
| 167 | |
| 168 | edit /usr/local/etc/apache24/httpd.conf, voeg toe aan het einde van het bestand: |
| 169 | |
| 170 | ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/ |
| 171 | Alias /nagios /usr/local/www/nagios/ |
| 172 | <Directory /usr/local/www/nagios> |
| 173 | Options None |
| 174 | AllowOverride None |
| 175 | Order allow,deny |
| 176 | Allow from all |
| 177 | AuthName “Nagios Access” |
| 178 | AuthType Basic |
| 179 | AuthUSerFile /usr/local/etc/nagios/htpasswd.users |
| 180 | Require valid-user |
| 181 | |
| 182 | </Directory> |
| 183 | <Directory /usr/local/www/nagios/cgi-bin> |
| 184 | Options ExecCGI |
| 185 | AllowOverride None |
| 186 | Order allow,deny |
| 187 | Allow from all |
| 188 | AuthName “Nagios Access” |
| 189 | AuthType Basic |
| 190 | AuthUSerFile /usr/local/etc/nagios/htpasswd.users |
| 191 | Require valid-user |
| 192 | </Directory> |
| 193 | |
| 194 | Opnieuw starten van apache en controleren op fouten |
| 195 | /usr/local/etc/rc.d/apache24 restart |
| 196 | |
| 197 | Open de nagios pagina http://ip/nagios, gebruik login en password |
| 198 | }}} |