PERL FastCGI (like PHP)
Added by Alexey over 15 years ago
Hi all,
Yesteray I tried to activate PERL fastCGI mod on Lighttpd, but it wasn't a success ...
I think I have to install the CPAN FCGI module here : http://search.cpan.org/~skimo/FCGI-0.67/FCGI.PL
I also installed this package under Ubuntu : libcgi-fast-perl
Then I thought I had to put something new in the Lighttpd config, but in fact I don't know what ... I think it is in /etc/lighttpd/conf-enabled/10-fastcgi.conf
I'm posting the content of this file :
## FastCGI programs have the same functionality as CGI programs, ## but are considerably faster through lower interpreter startup ## time and socketed communication ## ## Documentation: /usr/share/doc/lighttpd-doc/fastcgi.txt.gz ## http://www.lighttpd.net/documentation/fastcgi.html server.modules += ( "mod_fastcgi" ) ## Start an FastCGI server for php (needs the php5-cgi package) fastcgi.server = ( ".php" => (( "bin-path" => "/usr/bin/php-cgi", "socket" => "/tmp/php.socket", "max-procs" => 2, "idle-timeout" => 20, "bin-environment" => ( "PHP_FCGI_CHILDREN" => "4", "PHP_FCGI_MAX_REQUESTS" => "10000" ), "bin-copy-environment" => ( "PATH", "SHELL", "USER" ), "broken-scriptfilename" => "enable" )) )
Does someone know how to use Perl with FastCGI (and not CGI...) with Lighttpd ?
I mean I would like the same usage that PHP (which runs very well) but with PERL ... to do perl scripting with .pl files.
Thanks You.
Alexey
Replies (7)
RE: PERL FastCGI (like PHP) - Added by Alexey over 15 years ago
The documentation http://redmine.lighttpd.net/wiki/lighttpd/Docs%3AModFastCGI
h2. says : For Perl you have to install the FCGI module from CPAN.
But how to do this ?
RE: PERL FastCGI (like PHP) - Added by Alexey over 15 years ago
Finally I installed the FCGI Perl MODULE with cpan.
So I can exec it with perl : /usr/bin/perl -mFCGI
What must I write in /etc/lighttpd/conf-enabled/10-fastcgi.conf ?
RE: PERL FastCGI (like PHP) - Added by canit0 over 15 years ago
Here is an example given to me by another lighty user.
server.modules += ("mod_fastcgi")
fastcgi.server = (
".cgi" => ( # suffix-match if it starts with "."
# List of servers load-balanced by Lighttpd
( "host" => "localhost", # FastCGI over TCP/IP
"port" => 1234 ),
# FastCGI over UNIX domain sockets
( "socket" => "/var/sock/lighttpd-fcgi.sock" ),
# FastCGI application started by Lighttpd
( "bin-path" => "/usr/bin/perl",
"docroot" => "/var/www/myperlapp" )
),
"/cgi-bin" => ( # prefix-match if it starts with "/"
( "bin-path" => "/usr/bin/php-fcgi", "broken-scriptfilename" => "enable",
"min-procs" => 1,
"max-procs" => 4 # ... other options folllow
)
)
)