I am running monitorix on CentOS using my apache server (as opposed to the built-in server) wit the following addition to the virtualhost:
Alias /monitorix /usr/share/monitorix
<Directory /usr/share/monitorix>
Options -Indexes +FollowSymLinks
Order allow,deny
Allow from all
AllowOverride All
</Directory>
<Directory /usr/share/monitorix/cgi>
AddHandler cgi-script .cgi
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI +FollowSymLinks
Allow from all
AllowOverride All
</Directory>
Further, the following config for monitorix itself:
base_dir = /usr/share/monitorix/
base_lib = /usr/lib/monitorix/
base_url = /monitorix
base_cgi = /monitorix/cgi
when I open the URL http://domain.com/monitorix, I get the HTML interface properly displaying Monitorix version v3.4.0. so the httpd config seems to work fine.
when I click on the [OK] button, I get this error:
FATAL: Monitorix is unable to continue!
File 'monitorix.conf.path' was not found.
Please make sure that 'base_dir' option is correctly configured and this CGI (monitorix.cgi) is located in the 'base_dir'/cgi/ directory.
And don't forget to restart Monitorix for the changes to take effect!
my http logfile shows this:
[Fri Mar 28 10:26:01 2014] [error] FATAL: File 'monitorix.conf.path' was not found! at /usr/share/monitorix/cgi/monitorix.cgi line 210.\n
which tells me that CGI works fine too. The paths in the httpd confirg seem also to be ok and match the paths in the monitorix config seem also to be correct.
But somehow the path is not OK. I tried the base_dir with and without trailing slashes, but that did not help.
the file /usr/share/monitorix/cgi/monitorix.cgi before line 210 tries to
open(IN, "< monitorix.conf.path");
my $config_path = <IN>;
chomp($config_path);
close(IN);
the file /usr/share/monitorix/cgi/monitorix.conf.path exists, too.
I do not know PERL very well, anyone can tell me what is wrong here?
This Perl CGI
monitorix.cgi
simply cannot find its configuration file namedmonitorix.conf.path
.As you show only a fragment of the Perl file, it is only guesses:
monitorix.conf.path
and you had to create one in/usr/share/monitoryx/cgi/
/usr/share/monitoryx/
, notbase_dir/cgi/
as it is explained in the error message you got while clicking on the button.Of course, this is all best guesses. There is still a chance the Perl CGI is looking for its configuration file in a totally different place.
I found the issue: mod_perl was enabled and messed around with the cgi to find a file located in the same directory.
thanks to Mikaku from the #freenode.net #monitorix IRC channel for solving this!