For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > November 2006 > cgi -> fastcgi









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cgi -> fastcgi
Robert Hicks

2006-10-30, 6:55 pm

What do I need to do to move from plain CGI to FastCGI? I have the DLL
loaded in apache conf file. Do I just need to make an application type
of .fcgi (or whatever) so apache knows to use that? Do I need to modify
my plain CGI scripts in any way?

Robert
Zentara

2006-11-01, 7:55 am

On Thu, 26 Oct 2006 20:13:24 -0400, sigzero@gmail.com (Robert Hicks)
wrote:

>What do I need to do to move from plain CGI to FastCGI? I have the DLL
>loaded in apache conf file. Do I just need to make an application type
>of .fcgi (or whatever) so apache knows to use that? Do I need to modify
>my plain CGI scripts in any way?
>
>Robert


I'm not an expert on it, but this is what I needed to do to make it
work.

You might want to google for more recent setup instructions, but under
Apache-1 you needed to add lines to your httpd.conf file, and at the top
of your scripts,
use FCGI;

Example for httpd.conf setup

</IfModule>
<IfModule mod_fastcgi.c>
AddType application/x-httpd-fcgi .fcgi .fpl
# URIs that begin with /fcgi-bin/, are found in /var/www/fcgi-bin/

FastCgiConfig -restart

alias /fcgi-bin/ /srv/www/fcgi-bin/
# Anything in here is handled as a "dynamic" server if not defined
# as "static" or "external"
<Directory /srv/www/fcgi-bin/>
SetHandler fastcgi-script
AddHandler fastcgi-script .fcgi .fpl
Options +ExecCGI
</Directory>

<Directory /home/zz/public_html/cgi-bin/store>
SetHandler fastcgi-script
AddHandler fastcgi-script .fcgi .fpl
Options +ExecCGI
</Directory>

# Anything with one of these extensions is handled as a "dynamic"
# server if not defined as "static" or "external".
# Note: "dynamic" servers require ExecCGI to be on in their directory.

AddHandler fastcgi-script .fcgi .fpl

# Start a "static" server at httpd initialization inside the scope of
the SetHandler
#FastCgiServer /var/www/fcgi-bin/echo -processes 5
# Start a "static" server at httpd initialization inside the scope of
the AddHandler
#FastCgiServer /var/www/htdocs/some/path/echo.fcgi
# Start a "static" server at httpd initialization outside the scope of
the Set/AddHandler

FastCgiServer /home/zz/public_html/cgi-bin/store/perlshop.fcgi
-processes 2 -restart-delay 0
FastCgiServer /home/zz/public_html/cgi-bin/store/boacc.fcgi -processes 2
-restart-delay 0
FastCgiServer /home/zz/public_html/cgi-bin/store/respgen.fcgi -processes
2 -restart-delay 0

</IfModule>



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
???

2006-11-06, 7:55 am

if your CGI script like this

#!/usr/bin/perl
use strict;
use CGI;
my $cgi = new CGI;
print $cgi->header();
print "Hello World!\n";
undef $cgi;

your FastCGI will like this

#!/usr/bin/perl
use strict;
use FCGI;
use CGI;
my $request = FCGI::Request();
while($request->Accept() >= 0) {
my $cgi = new CGI;
print $cgi->header();
print "Hello World!\n";
undef $cgi;
}

if your CGI script not strong and strict enough, cover your CGI sctipt to
FastCGI have many works to do, suggest you cover your CGI sctipt to
mod_perl, FastCGI like has been forgotten, I can't find FCGI.PM at CPAN

--
I want a job about Perl, please visit my resume at
http://wanmyome.googlepages.com/resume.html
"Robert Hicks" <sigzero@gmail.com>
??????:20061027001325.32657.qmail@lists.develooper.com...
> What do I need to do to move from plain CGI to FastCGI? I have the DLL
> loaded in apache conf file. Do I just need to make an application type of
> .fcgi (or whatever) so apache knows to use that? Do I need to modify my
> plain CGI scripts in any way?
>
> Robert



???

2006-11-06, 7:55 am

sorry, i forget print it

print $cgi->redirect('...');

--
I want a job about Perl, please visit my resume at
http://wanmyome.googlepages.com/resume.html
"Robert Hicks" <sigzero@gmail.com>
??????:20061027001325.32657.qmail@lists.develooper.com...
> What do I need to do to move from plain CGI to FastCGI? I have the DLL
> loaded in apache conf file. Do I just need to make an application type of
> .fcgi (or whatever) so apache knows to use that? Do I need to modify my
> plain CGI scripts in any way?
>
> Robert



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com