3 open OUT, ">remote.fpl";
4 print OUT "#!$Config{perlpath}\n";
5 print OUT while <DATA>;
7 chmod 0755, "remote.fpl";
9 # An example of using a remote script with an Apache webserver.
10 # Run this Perl program on "otherhost" to bind port 8888 and wait
11 # for FCGI requests from the webserver.
13 ## Sample Apache configuration on the webserver to refer to the
14 ## remote script on "otherhost"
15 # <IFModule mod_fastcgi.c>
16 # AddHandler fastcgi-script fcgi
17 # FastCgiExternalServer /path-to/cgi-bin/external.fcgi -host otherhost:8888
20 # Access the URL: http://webserver/cgi-bin/external.fcgi
22 # Contributed by Don Bindner <dbindner@truman.edu>
26 my $socket = FCGI::OpenSocket( ":8888", 5 );
27 my $request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR,
31 while( $request->Accept() >= 0 ) {
32 print "Content-type: text/html\r\n\r\n";
36 FCGI::CloseSocket( $socket );