FastCGIをApacheで使うには
mod_fastcgi
mod_fcgid
がある。
$ wget http://jaist.dl.sourceforge.net/sourceforge/mod-fcgid/mod_fcgid.2.2.tgz $ tar zxvf mod_fcgid.2.2.tgz $ cd mod_fcgid.2.2 $ make top_dir=/usr/lib/httpd $ sudo make top_dir=/usr/lib/httpd install
make 時に top_dir=/usr/lib/httpd を指定することでMakefileの書き換えが必要ない。
CentOS で mod_fcgid インストール (Apache+FastCGI) Kawanet Tech Blog/ウェブリブログ
必要なモジュール等
猫ITソリューションズ | mod_fcgiのインストール - 猫とLinuxがイノベーションを加速する
# yum install perl-FCGI httpd-devel
FCGI::ProcManager
Sub::Override
File::Slurp
検証用スクリプト
Perl/FastCGI環境でのFCGIスクリプトの実行 - yanor.net/wikiより
#!/usr/bin/perl use FCGI; my $request = FCGI::Request(); my $count = 0; while ( $request->Accept() >= 0 ) { print "content-type: text/html\r\n\r\n"; print ++$count; }