logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_fastcgi+Apache2.2+Perl+Catalyst
Author
ftc



Joined: 20 Dec 2012
Posts: 3
Location: Russia, Petrozavodsk

PostPosted: Thu 20 Dec '12 12:12    Post subject: mod_fastcgi+Apache2.2+Perl+Catalyst Reply with quote

Recently i've decided to switch several our Perl projects from LightTPD to Apache+mod_fastcgi under win32.

First problem was to run some fastcgi mechanism with Apache. I've tried both mod_fcgid and mod_fastcgi (by downloading binaries from here and from http://www.fastcgi.com/dist/), but no luck.

Under mod_fcgid I had following in error log:

Code:
mod_fcgid: get overlap result error


And under mod_fastcgi the result was as following:
Code:

FastCGI: comm with server "C:/www/cgi-bin/foo.pl" aborted: GetOverlappedResult() failed


So I decided to download sources of mod_fastcgi from here http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0910052141.tar.gz and debug them. There were the latest sources I could find. BTW, Visual C++ 2003 did not allow me to open included .dsp file, so I was to create project from scratch and rebuild the module.

Surprisingly, it worked. It seems, that there is no build of that sources in the net, so maybe it's reasonable to upload the build somewhere on this site?

And for last note about Catalyst. I had long time struggling with errors like "child process exited with code=9" when I realised, that Registry key for running perl for scripts had "-T" key, but Catalyst fails to run with this key.

Hope this will help someone.
Back to top
aras



Joined: 07 Dec 2012
Posts: 18
Location: USA

PostPosted: Thu 20 Dec '12 22:24    Post subject: Reply with quote

I have recently compiled mod_fastcgi.so from the original sources following the steps suggested by glsmith (https://www.apachelounge.com/viewtopic.php?t=5076). I was successful to build both the 32-bit and 64-bit modules. The purpose was that I wanted to try the module for comparison with the mod_fcgid.so (which I have currently well running). However, I had no luck with the setup of the module, which appears to be totally incomprehensive to me (https://www.apachelounge.com/viewtopic.php?t=5086). The last thing that I have tried was an attempt to run php-fpm (compiled into php-cgi to my knowledge) with the mod_fastcgi. No luck though. Would you please share your experience on how to setup the mod_fastcgi on windows?
Back to top
ftc



Joined: 20 Dec 2012
Posts: 3
Location: Russia, Petrozavodsk

PostPosted: Fri 21 Dec '12 7:18    Post subject: Reply with quote

Hello!

I have tested following configuration:
Code:

LoadModule fastcgi_module modules/mod_fastcgi.dll
ScriptInterpreterSource Registry-Strict

<Directory c:/www/cgi-bin>
   SetHandler fastcgi-script
    Options +ExecCGI
   # Customize the next two directives for your requirements.
   Order allow,deny
   Allow from all
</Directory>

Alias /fsystem/bin c:/work/fsystem/www/FSystem/script/fsystem_fastcgi.pl
Alias /fsystem c:/work/fsystem/www
FastcgiServer c:/work/fsystem/www/FSystem/script/fsystem_fastcgi.pl -processes 1
<Location /fsystem>
  Allow from all
</Location>


First part (about c:/www/cgi-bin) is a dynamic server (which is started on demand, when someone accesses the script.

foo.pl is a minimal example of Perl FastCGI script, like this:
Code:

#!c:/soft/perl5.14/bin/perl.exe -w
use FCGI;
use CGI::Fast;

while (my $q = CGI::Fast->new)
{
   foreach $var (sort(keys(%ENV)))
   {
      $val = $ENV{$var};
      $val =~ s|\n|\\n|g;
      $val =~ s|"|\\"|g;
      print "${var}=\"${val}\"\n";
   }
}


Second part is a Catalyst application. I've configured it as a static server (which starts with Apache and keeps running). Here I start only one process (for debugging purposes), but it works well with several processes too.

BTW, I have ActivePerl 5.14 and Catalyst 5.90019. Also I have a registry key configured to run Perl for *.pl files under Apache.
Back to top
ted.byers



Joined: 03 Jan 2013
Posts: 19

PostPosted: Fri 04 Jan '13 0:22    Post subject: Reply with quote

Would that configuration change much with Apache 24 and ActivePerl 5.12?
Back to top
ftc



Joined: 20 Dec 2012
Posts: 3
Location: Russia, Petrozavodsk

PostPosted: Fri 04 Jan '13 7:01    Post subject: Reply with quote

ted.byers wrote:
Would that configuration change much with Apache 24 and ActivePerl 5.12?


I suppose the configuration itself will be the same, except that you should rebuild mod_fastcgi for Apache 2.4
Back to top
daniel



Joined: 10 Nov 2013
Posts: 2

PostPosted: Wed 13 Nov '13 4:37    Post subject: Reply with quote

thanks ftc i got problem in doing the perl projects with my other friends, your way out solve it..
Back to top


Reply to topic   Topic: mod_fastcgi+Apache2.2+Perl+Catalyst View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules