1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<IfModule mod_fcgid.c>
FcgidIPCDir /var/lib/apache2/fcgid/sock
FcgidIOTimeout 20
FcgidConnectTimeout 10
FcgidOutputBufferSize 0
<Location />
Options Indexes FollowSymLinks Multiviews
AddHandler fcgid-script .php .pl .fcgi
Options +ExecCGI
FcgidWrapper /usr/lib/cgi-bin/php5-fcgi .php
FcgidWrapper /usr/lib/cgi-bin/fastcgi-wrapper.pl .pl
Order allow,deny
allow from all
</Location>
</IfModule>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl use Data::Dumper; use FCGI; my $socket = FCGI::OpenSocket( "/var/lib/apache2/fcgid/sock/test.sock", 20 ); my $request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%ENV, $socket ); print "Request-Data:\n". Dumper($request). "\n"; while($request->Accept() >=0) { print ( "ENV-Data:\r\n" ); my $env = $request->GetEnvironment(); print Dumper($env); print ( "\r\n" ); }
1
2
3
4
5
[Wed May 18 15:55:35 2011] [info] mod_fcgid: server 10.58.77.240:/usr/lib/cgi-bin/fastcgi-wrapper.pl(26625) started
[Wed May 18 15:55:55 2011] [warn] [client 122.35.53.138] mod_fcgid: read data timeout in 20 seconds
[Wed May 18 15:55:55 2011] [error] [client 122.35.53.138] Premature end of script headers: foo.pl
[Wed May 18 15:55:59 2011] [debug] fcgid_pm_main.c(357): mod_fcgid: gracefully terminated 1 processes
[Wed May 18 15:56:05 2011] [info] mod_fcgid: process /usr/lib/cgi-bin/fastcgi-wrapper.pl(26625) exit(communication error), get stop signal 15