nginx under centos configures perl to run bugzilla

Before configuring bugzilla, you need to install the epel library and the rpmforge library. nginx itself does not have the function of perl analysis, need to use fcgi-perl, install: yum install fcgi-perl Write a script fastcgi service script: vim /usr/local/fcgi-perl/fastcgi-wrapper.pl #!/usr/bin/perl use FCGI; use Socket; use POSIX qw(setsid); require ‘syscall.ph’; &daemonize; #this keeps the program alive or something after exec’ing perl scripts END() { } BEGIN() { } *CORE::GLOBAL::exit = sub { die “fakeexit\nrc=”.shift().”\n”; }; eval q{exit}; if ($@) { exit unless $@ =~ /^fakeexit/; }; &main; sub daemonize() { chdir ‘/’ or die “Can’t chdir to /: $!”; defined(my $pid = fork) or die “Can’t fork: $!”; exit if $pid; setsid or die “Can’t start a new session: $!”; umask 0; } sub main { $socket = FCGI::OpenSocket( “127.0.0.1:8999”, 10 ); #use IP sockets $request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%req_params, $socket ); if ($request) { request_loop()}; FCGI::CloseSocket( $socket ); } sub request_loop { while( $request->Accept() >= 0 ) {   #processing any STDIN input from WebServer (for CGI-POST actions) $stdin_passthrough = ”; $req_len = 0 + $req_params{‘CONTENT_LENGTH’}; if (($req_params{‘REQUEST_METHOD’} eq ‘POST’) && ($req_len != 0) ){ my $bytes_read = 0; while ($bytes_read <$req_len) { my $data = ”;…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索