Configurare Apache + FastCGI su Windows
Non riesco a configurare i moduli mod_fcgid o mod_fastcgi con windows. :incazzat:
Ho provato questo codice:
Codice:
#!/server/perl/perl/bin/perl -w
use CGI;
use FCGI;
use strict;
my $count = 0;
my $lives = 10;
my $request = FCGI::Request();
while($request->Accept() >= 0){
my $cgi = new CGI;
print $cgi->header();
print $cgi->start_html('FCGI');
print "Process ID: $$; Count is: ", ++$count;
print $cgi->end_html();
last unless $lives--;
}
exit 0;
e ricevo errore 500.
Con mod_fastcgi ricevo:
Citazione:
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" started (pid 920)
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" (pid 920) terminated with exit with status '0'
[error] [client 127.0.0.1] (OS 109)Pipe terminata. : FastCGI: comm with server "C:/server/fcgi-bin/print5.fpl" aborted: GetOverlappedResult() failed
[error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "C:/server/fcgi-bin/print5.fpl"
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" restarted (pid 2076)
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" (pid 2076) terminated with exit with status '0'
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" restarted (pid 3580)
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" (pid 3580) terminated with exit with status '0'
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" restarted (pid 4048)
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" (pid 4048) terminated with exit with status '0'
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" restarted (pid 2428)
[error] [client 127.0.0.1] (OS 109)Pipe terminata. : FastCGI: comm with server "C:/server/fcgi-bin/print5.fpl" aborted: GetOverlappedResult() failed
[error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "C:/server/fcgi-bin/print5.fpl"
[warn] FastCGI: (dynamic) server "C:/server/fcgi-bin/print5.fpl" (pid 2428) terminated with exit with status '0'
con mod_fcgid ricevo:
Citazione:
[info] mod_fcgid: server localhost:/server/perl/perl/bin/perl.exe(1980) started
[warn] [client 127.0.0.1] (OS 109)Pipe terminata. : mod_fcgid: get overlap result error
[error] [client 127.0.0.1] Premature end of script headers: print5.fpl
[info] mod_fcgid: server localhost:/server/perl/perl/bin/perl.exe(916) started
[info] mod_fcgid: process /server/perl/perl/bin/perl.exe(1980) exit(communication error), return code 9
[warn] [client 127.0.0.1] (OS 109)Pipe terminata. : mod_fcgid: get overlap result error
[error] [client 127.0.0.1] Premature end of script headers: print5.fpl
Apache è in ascolto sulla porta 8080 e nginx sulla 80 come reverse proxy, il file httpd.conf:
Codice:
LogLevel debug
<LocationMatch /f?cgi-bin>
Options ExecCGI
</LocationMatch>
<IfModule alias_module>
Alias /cgi-bin /server/cgi-bin/
Alias /fcgi-bin /server/fcgi-bin/
</IfModule>
<IfModule mime_module>
<IfModule fcgid_module>
AddHandler fcgid-script .fcgi .fpl .fpy
</IfModule>
<IfModule fastcgi_module>
AddHandler fastcgi-script .fcgi .fpl .fpy
</IfModule>
AddHandler cgi-script .cgi .lua .pl .py .rb .sh .exe .bat
</IfModule>
<IfModule fcgid_module>
FcgidConnectTimeout 8
FcgidWrapper /server/python/python.exe .fpy
FcgidWrapper /server/perl/perl/bin/perl.exe .fpl
</IfModule>
<IfModule fastcgi_module>
FastCgiConfig -restart -restart-delay 10 -maxprocesses 5
</IfModule>