Home > Archive > PERL CGI Beginners > October 2005 > Fast CGI.
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]
|
|
|
| I am a new dedicated server where: FastCGI: Enabled
I am at a loss as what I need in my scripts to run them with Fast CGI? ..fcgi extension? and what else.
Thanks for any help.
Sara.
| |
| Zentara 2005-10-11, 9:55 pm |
| On Sun, 9 Oct 2005 19:51:54 +0500, sara.samsara@gmail.com (Sara) wrote:
>I am a new dedicated server where: FastCGI: Enabled
>I am at a loss as what I need in my scripts to run them with Fast CGI? .fcgi extension? and what else.
>Thanks for any help.
I have a test setup running using FastCGI. This is what I needed to do.
Of course googling will always help, there may be better ways to do it.
1. Put "use FCGI"; at the top of your script
2. You have to setup the apache config file, and tell it how many (and
what type) of fcgi servers to start for each fcgi script. I have it in
my global httpd.conf, but you might be able to customize it and put it
in a per directory .htaccess file.
########################################
###################
<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
| |
| Paul Lalli 2005-10-11, 9:55 pm |
|
Sara wrote:
> I am a new dedicated server where: FastCGI: Enabled
>
> I am at a loss as what I need in my scripts to run them with Fast CGI? .fcgi extension? and what else.
>
Sara,
I confess that I'd never heard of "FastCGI" until reading your post.
However, a quick search of CPAN turned up this likely candidate for
assistance: http://search.cpan.org/~lds/CGI.pm-3.11/CGI/Fast.pm It
seems to be a module written by the author of the standard CGI.pm, and
detailing how to take advantage of the FastCGI standard.
Hope you find it useful,
Paul Lalli
|
|
|
|
|