Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

What are best practices for Fast CGI nowadays?

by mldvx4 (Friar)
on Mar 21, 2018 at 15:43 UTC ( [id://1211435]=perlquestion: print w/replies, xml ) Need Help??

mldvx4 has asked for the wisdom of the Perl Monks concerning the following question:

Where can I look for the current best practices regarding implementing a perl script using Fast CGI? Which module(s) should I look at and which should I avoid? I'm starting to process data from HTML forms using Fast-CGI, but have done quite a lot with slow CGI in the distant past. The perl script will be communicating with the web server via UNIX sockets.

Also, should the script fork ever? If so, when and what should be done with the UNIX socket to handle the forking?

  • Comment on What are best practices for Fast CGI nowadays?

Replies are listed 'Best First'.
Re: What are best practices for Fast CGI nowadays?
by karlgoethebier (Abbot) on Mar 21, 2018 at 20:00 UTC

    In a hurry: probably this is a starting point.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      Ok, thanks. I've seen that and pretty much anything similar that can be found with Startpage.com. I can get the environment variables with FCGI no problem.

      ... HTTP_CONTENT_TYPE = application/x-www-form-urlencoded ...

      I'm still left wondering how to get at the form data. I'd like the FCGI equivalent of ->params from old, slow CGI to get the idea behind FCGI.

      use CGI; my $q = CGI->new; # Process an HTTP request my @values = $q->multi_param('form_field'); my $value2 = $q->param('param2_name');

      It has to be Fast CGI because that is the API used by nginx and OpenBSD's httpd.

        I'm still left wondering how to get at the form data.

        heh, use CGI ; its magic like that

Re: What are best practices for Fast CGI nowadays?
by rizzo (Curate) on Mar 21, 2018 at 20:22 UTC
    You can find a clone of the official docs here:
    FastCGI.com Archives

    Also, should the script fork ever?
    You typically start one or more instances of your script.
Re: What are best practices for Fast CGI nowadays?
by mldvx4 (Friar) on Mar 22, 2018 at 12:16 UTC

    Ok. Thanks everybody. The links and the tip helped.

    A reply falls below the community's threshold of quality. You may see it by logging in.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1211435]
Approved by stevieb
Front-paged by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-20 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found