I have problem with installation Nagios on LEMP (Linux nginx mysql php) in my Monitoring VPS. My OS is Debian 8. I following guides :
Code: Select all
http://www.tokiwinter.com/installing-nagios-under-nginx-on-ubuntu-14-04-lts/
http://idevit.nl/node/93
http://unix.rocks/2014/nginx-and-nagios-a-howto/
https://www.digitalocean.com/community/tutorials/how-to-install-nagios-4-and-monitor-your-servers-on-ubuntu-14-04
https://atlgeek.wordpress.com/2014/05/12/nagios-4-nginx-ubuntu-14-04-lts/Code: Select all
==> nagios-error.log <==
2015/12/21 20:22:33 [error] 29212#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.10.12.151, server: _, request: "GET /nagios/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "xxx"Code: Select all
server {
server_name _;
access_log /var/log/nginx/nagios-access.log;
error_log /var/log/nginx/nagios-error.log;
auth_basic "Restricted Nagios Area!";
auth_basic_user_file /usr/local/nagios/etc/htpasswd.users;
root /usr/local/nagios/share;
index index.php index.html;
location / {
try_files $uri $uri/ index.php;
}
location /nagios {
alias /usr/local/nagios/share/;
}
location ~ \.php$ {
root html;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/local/nagios/share$fastcgi_script_name;
fastcgi_split_path_info ^(.+.php)(.*)$;
}
location ~ ^/nagios/(.*\.php)$ {
alias /usr/nagios/share/$1;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
location ~ \.cgi$ {
root /usr/local/nagios/sbin/;
rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;
fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}