I have installed nagios 4.0.2 from source on my ubuntu maschine.
Installation directory is "/usr/local/nagios/...".
I would like to have all webpages under "/var/www/..."
I know, this makes things a little bit more complicated but it should work. It worked for nagios 3, but installed via ubuntu package.
I have copied the files from /usr/local/nagios/share" to /var/www/av_nagios" - my website directory.
I have modified the config file:
Code: Select all
<?php
//
$cfg['cgi_config_file']='/etc/nagios/cgi.cfg'; // location of the CGI config file
$cfg['cgi_base_url']='/cgi-bin';
// FILE LOCATION DEFAULTS
$cfg['main_config_file']='/etc/nagios/nagios.cfg'; // default location of the main Nagios config file
$cfg['status_file']='/var/cache/nagios/status.dat'; // default location of Nagios status file
$cfg['state_retention_file']='/var/cache/nagios/retention.dat'; // default location of Nagios retention file
// utilities
require_once(dirname(__FILE__).'/includes/utils.inc.php');
?>
Code: Select all
<VirtualHost *:80>
DocumentRoot "/var/www/av_nagios"
ServerName nagios.av.loc
ServerAlias event.av.loc
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 4
LogLevel debug
<Directory "/var/www/av_nagios">
RewriteEngine On
AllowOverride All
Options +Indexes FollowSymLinks +ExecCGI
DirectoryIndex index.php index.html index.cgi
Order Allow,Deny
allow from all
RewriteRule (.*)av_nagios/(.*) $1$2
</Directory>
ScriptAlias /cgi-bin /usr/local/nagios/sbin
</VirtualHost>The screen has a white background. This indicates to me the stylesheets are not used - but I am not sure.
When pushing e.g. "hosts" I get the message:
Code: Select all
Whoops!
Error: Could not open CGI config file '/usr/local/nagios/etc/cgi.cfg' for reading!
......
The logfile reports:
Code: Select all
[Fri Dec 06 12:31:22 2013] [debug] mod_deflate.c(615): [client 192.168.110.165] Zlib: Compressed 1588 to 835 : URL /cgi-bin/status.c
gi
[Fri Dec 06 12:31:22 2013] [error] [client 192.168.110.165] (8)Exec format error: exec of '/usr/local/nagios/sbin/jquery-1.7.1.min.j
s' failed, referer: http://nagios.av.loc/cgi-bin/status.cgi?hostgroup=all&style=hostdetail
[Fri Dec 06 12:31:22 2013] [error] [client 192.168.110.165] Premature end of script headers: jquery-1.7.1.min.js, referer: http://na
gios.av.loc/cgi-bin/status.cgi?hostgroup=all&style=hostdetail
[Fri Dec 06 12:31:22 2013] [debug] mod_deflate.c(615): [client 192.168.110.165] Zlib: Compressed 617 to 379 : URL /cgi-bin/jquery-1.
7.1.min.js, referer: http://nagios.av.loc/cgi-bin/status.cgi?hostgroup=all&style=hostdetail
Probably some better experts on webservers see the hint.
Thanks