Nagios Apache Config with PHP-FPM downloading cgi files

Posted by tubaguy50035 on Server Fault See other posts from Server Fault or by tubaguy50035
Published on 2012-09-27T14:29:10Z Indexed on 2012/09/27 15:39 UTC
Read the original article Hit count: 537

Filed under:
|
|
|

I'm trying to setup Nagios 3 under Apache 2.4 with PHP-FPM. I've run into a couple problems I could use help with. The PHP side of things seems to be working, I can see the home page and the sidebar. But all of the CGI files are downloading instead of executing, and when I try to click on "Read What's New In Nagios Core 3", I get an error /nagios3/docs/whatsnew.html was not found on this server. Below is my vhost config for Nagios.

<VirtualHost *:300>
# apache configuration for nagios 3.x
    ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
    ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3
# Where the stylesheets (config files) reside
    Alias /nagios3/stylesheets /etc/nagios3/stylesheets
# Where the HTML pages live
    Alias /nagios3 /usr/share/nagios3/htdocs
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9001/usr/share/nagios3/htdocs/$1
    <DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)>
        Options FollowSymLinks ExecCGI
        AllowOverride AuthConfig
        Order Allow,Deny
        Allow From All
        AuthName "Nagios Access"
        AuthType Basic
        AuthUserFile /etc/nagios3/htpasswd.users
        require valid-user
    </DirectoryMatch>
    <Directory /usr/share/nagios3/htdocs>
        Options +ExecCGI
    </Directory>
</VirtualHost>

I also added this in my global Apache config: AddHandler cgi-script .cgi

Any help or instructions you can give me would be much appreciated. If more information is needed, let me know.

© Server Fault or respective owner

Related posts about apache2

Related posts about nagios