歡迎您光臨本站 註冊首頁

Nginx nagios perl fcgi 取締apache

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0
Nginx nagios perl fcgi
通常使用:nginx 代理 apache CGI部分交給apache來處理
本文取消apache

Nginx nagios 安裝略
安裝perl cgi模塊
wget http://www.cpan.org/modules/by-module/FCGI/FCGI-0.67.tar.gz
tar -zxvf FCGI-0.67.tar.gz
cd FCGI-0.67
perl Makefile.PL
make && make install

安裝FCGI-ProcManager:
wget http://search.cpan.org/CPAN/authors/id/G/GB/GBJK/FCGI-ProcManager-0.18.tar.gz
tar -xzxf FCGI-ProcManager-0.18.tar.gz
cd FCGI-ProcManager-0.18
perl Makefile.PL
make make install
下載nginx-fcgi腳本
Wget http://www.nginx.eu/nginx-fcgi/nginx-fcgi.txt
放置在:/etc/nginx-fcgi
註釋掉nginx-fcgi.txt 中的
if ( $> == 「0″ ) {
print 「ntERRORtRunning as a root!n」;
print 「tSuggested not to do so !!!nn」;
exit 1;
}
否則會提示:ERROR Running as a root! Suggested not to do so !!!

啟動方法:
/etc/nginx-fcgi -l /var/log/nginx/nginx-fcgi.log -pid /var/run/nginx-fcgi.pid -S /var/run/nginx-fcgi.sock
注意給 nginx-fcgi.sock 777的許可權
運行前使用cpan 安裝 FCGI;  Getopt::Long; IO::All;  Socket;
配置文件參考:/usr/local/nginx/conf/vhosts/nagios.conf
server
{
listen 80;
server_name IP;
root /usr/local/nagios/share;
index index.php;
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include enable_php5.conf;
auth_basic "Nagios Login pain";
auth_basic_user_file /usr/local/nagios/etc/htpasswd;
}


[火星人 ] Nginx nagios perl fcgi 取締apache已經有489次圍觀

http://coctec.com/docs/linux/show-post-52494.html