i wanted to post what i went thru to get both fastCGI and mod_perl working.
being seriously ‘technically challenged’, it took me quite a bit longer than it will take most normal people.
according to this chart:
http://dmst.aueb.gr/dds/pubs/conf/20…throughput.gif
http://dmst.aueb.gr/dds/pubs/conf/20…l/dyncont.html
it appears that fastCGI is better, but i have no opinion (yet)
below are the steps i went thru to get both working. good luck!
===== f a s t C G I ==========================
- http://www.fastcgi.com/devkit/doc/fa…de/ch3perl.htm
#this little program worked out of the box, once i installed fastCGI on the westhost Site Applications manager
#! /usr/bin/perl
use FCGI; # Imports the library; required line
- Initialization code
$cnt = 0;
- Response loop
while (FCGI::accept >= 0) {
print “Content-type: text/html\r\n\r\n”;
print “
print “
FastCGI Demo Page (perl)
\n”;print “This is coming from a FastCGI server.\n
\n”;
print “Running on $ENV{SERVER_NAME} to $ENV{REMOTE_HOST}\n
\n”;
$cnt++;
print “This is connection number $cnt\n”;
}
====== m o d p e r l ==========================
http://www.perl.com/pub/a/2002/03/22…rl.html?page=2
- 1) go to your home directory
cd ~ ;
- 2) create a testModPerlDirectory
mkdir testModPerlDirectory;
- 3) set the testModPerlDirectory to world read/execute
chmod 755 testModPerlDirectory;
- 4) go into that directory
cd testModPerlDirectory;
- 5) create the myTestProgram.pl program
cat > myTestProgram.pl;
print “Content-type: text/plain\n\n”;
print “mod_perl rules!\n”;
perl -c myTestProgram.pl; ## 06) make sure the program works!
- 07) add the following lines to the bottom of your mod-perl.conf file:
cat >> /etc/httpd/conf.d/mod_perl.conf;
Alias /perl/ /home/yourHomeDirectoryName/testModPerlDirectory/
PerlModule ModPerl::Registry
SetHandler perl-script
PerlHandler ModPerl::Registry
Options +ExecCGI
PerlSendHeader On
allow from all
- 08) stop the apache server
apachectl stop ;
- 09) (re)start the apache server
apachectl start ;
- 10) make sure your apache restarted!
ps -ef | grep httpd ;
- look for /usr/sbin/httpd -k start a couple times
now, in your favorite browser: http://yourHostName/perl/myTestProgram.pl