Weblog entry #111 for simonw
#111
Apache2 Fast CGI for Catalyst on Debian Sarge
Posted by simonw on Thu 30 Nov 2006 at 11:13
Motivation: We were using mod-perl, but we wanted several instances of the same Catalyst application for different developers and designers.
libapache2-mod-fastcgi is in non-free, because you are only allowed to use the code to implement approved Fast CGI specifications. There is a DFSG compliant binary compatible package called libapache2-mod-fcgid, we'll probably try that at some point. Although for our purposes the code is "free enough" since I can only see us fixing bugs (if any). The licence here* looks like it is DFSG compatible, so perhaps a Debian Developer might review if the "non-free" label is still applicable!
* http://www.fastcgi.com/om_archive/kit/LICENSE.TERMS
This is the first non-free package we've needed in supplying a pretty chunky set of ISP services. So we added "non-free" to the end of various lines in "sources.list", and did "apt-get update" "apt-get install libapache2-mod-fastcgi", "a2enmod fastcgi".
Catalyst applications use Perl module "FCGI", so "apt-get install libfcgi-perl". I was concerned that the packages version in Sarge might be an old version, but it seems to work fine.
Before the VirtualHost directive in the sites Apache2 config file added;
"FastCgiServer /..blah../appname/script/appname_fastcgi.pl -processes 3"
Changed our rewrite rules so that requests are passed to the appname_fastcgi.pl.
A more general Catalyst explanation of Fast CGI is here;
http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7006/lib/Catalyst/Engine/FastCGI.pm
/etc/init.d/apache2 restart
# Less aggressive restarts may not kick off the Fast CGI server processes.
# One can use "ps" to see that the processes kicked off as expected.
The "FastCgiServer" directive has context "Server config", which is a tad annoying, as we put our DocumentRoot in the same config file twice, once to say where the application is, and then again in the VirtualHost section, I guess we could use a variable for it.
It seems fast, and we are looking at hacks to the "appname_fastcgi.pl" script to restart stuff as and when needed, without bothering Apache.
libapache2-mod-fastcgi is in non-free, because you are only allowed to use the code to implement approved Fast CGI specifications. There is a DFSG compliant binary compatible package called libapache2-mod-fcgid, we'll probably try that at some point. Although for our purposes the code is "free enough" since I can only see us fixing bugs (if any). The licence here* looks like it is DFSG compatible, so perhaps a Debian Developer might review if the "non-free" label is still applicable!
* http://www.fastcgi.com/om_archive/kit/LICENSE.TERMS
This is the first non-free package we've needed in supplying a pretty chunky set of ISP services. So we added "non-free" to the end of various lines in "sources.list", and did "apt-get update" "apt-get install libapache2-mod-fastcgi", "a2enmod fastcgi".
Catalyst applications use Perl module "FCGI", so "apt-get install libfcgi-perl". I was concerned that the packages version in Sarge might be an old version, but it seems to work fine.
Before the VirtualHost directive in the sites Apache2 config file added;
"FastCgiServer /..blah../appname/script/appname_fastcgi.pl -processes 3"
Changed our rewrite rules so that requests are passed to the appname_fastcgi.pl.
A more general Catalyst explanation of Fast CGI is here;
http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7006/lib/Catalyst/Engine/FastCGI.pm
/etc/init.d/apache2 restart
# Less aggressive restarts may not kick off the Fast CGI server processes.
# One can use "ps" to see that the processes kicked off as expected.
The "FastCgiServer" directive has context "Server config", which is a tad annoying, as we put our DocumentRoot in the same config file twice, once to say where the application is, and then again in the VirtualHost section, I guess we could use a variable for it.
It seems fast, and we are looking at hacks to the "appname_fastcgi.pl" script to restart stuff as and when needed, without bothering Apache.
Comments on this Entry
The more generous licence terms appear to apply only to the associated software, not the module itself.
[ Parent | Reply to this comment ]