本文共 3141 字,大约阅读时间需要 10 分钟。
fcgiwrap - simple server to run CGI applications over FastCGIcollectd-core - statistics collection and monitoring daemon (core system)nginx - small, but very powerful and efficient web server and mail proxynginx-dbg - Debugging symbols for nginxphp5-fpm - server-side, HTML-embedded scripting language (FPM binary)
sudo apt-get install nginx
user www-data;worker_processes 1;error_log /var/log/nginx/error.log;pid /var/run/nginx.pid;events { worker_connections 1024; # multi_accept on;}http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; server { listen 9999; server_name 10.18.105.110; auth_basic "Restricted Nagios Area!"; auth_basic_user_file /opt/nagios/etc/htpasswd.users; charset utf-8; root /usr/share/nagios3/htdocs ; index index.html index.htm index.php; location /nagios3/stylesheets { alias /etc/nagios3/stylesheets; } location /nagios3/images { alias /usr/share/nagios3/htdocs/images; } location ~ \.cgi$ { root /usr/lib/cgi-bin/nagios3; rewrite ^/cgi-bin/nagios3/(.*)$ /$1; include /etc/nginx/fastcgi_params; fastcgi_param AUTH_USER $remote_user; fastcgi_param REMOTE_USER $remote_user; fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name; fastcgi_pass unix:/var/run/fcgiwrap.socket; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; }}}8.配置文件内着重注意的地方1,root /usr/share/nagios3/htdocs ,nagios首页页面所在位置,不要定位到example的index页面上去,2,样式以及图片的过滤路径,有可能找不到需要你去配置,3.找不到cgi脚本报脚本名或者document root错误,4,fastcgi参数有include /etc/nginx/fastcgi_params;老版本可能是一个配置文件,而不是一个文件夹,5,fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name; 这里最好重新定位一下你的脚本在哪里,否则fastcgi自带的配置文件仍然报找不到脚本
转载地址:http://hakdo.baihongyu.com/