[Lazarus] fpWeb FCGI Setup

Lee Jenkins lee at datatrakpos.com
Mon May 23 12:56:00 CEST 2011


On 5/22/2011 11:32 PM, ABorka wrote:
>>>> Hi all,
>>>>
>>>> I'm trying to get fcgi setup and running on my windows box so I can test
>>>> some of modules and I'm still try to figure out what I need to do.
>>>>
>>>> A sample fcgi project produces an exception when run "Failed to open
>>>> input handle passed from server. Socket error 10038.".
>>>>
>>>> I had thought that the fcgi server just started and waited for
>>>> connections from the webserver but it looks like it is trying to connect
>>>> to an assume socket as soon as it starts. Sorry, I can't tell exactly,
>>>> the ide won't let me debug down passed Application.Run line in the .lpr.
>>>>
>>>> Not sure how I would debug like without it being started already...
>>>>
>>>> Windows Vista, Lazarus snapshot a week or so old.
>>>>
>>>> Thanks,
>>>>
>>>> --
>>>> Warm Regards,
>>>>
>>>> Lee
>>>
>>> You need to specify the port your FCGI application will be listening
>>> on in your
>>> project main file (.lpr):
>>>
>>> .
>>> .
>>> .
>>> Application.Title:='My FCGI Application';
>>> Application.Port:=2015;//Port the FCGI application is listening on
>>> Application.Initialize;
>>> Application.Run;
>>> .
>>
>> I know its a bit off topic, but I've been trying to get fastcgi
>> configured with apache off and on for a week now and I have yet to
>> figure out the specific combination. My httpd.conf looks like this for
>> fcgi:
>>
>> LoadModule fcgid_module modules/mod_fcgid.so
>>
>> <Directory "www/fcgi-bin">
>> SetHandler fcgid-script
>> Options execCGI
>> AllowOverride None
>> Order allow,deny
>> Allow from all
>> </Directory>
>>
>> <ifModule mod_fastcgi.c>
>> AddHandler fastcgi-script .fcgi .fcg
>> Alias /fastcgi-bin "M:\LazProjs\test_projects\test_fpweb\www\pos.fcgi"
>> FastCgiExternalServer
>> "M:\LazProjs\test_projects\test_fpweb\www\pos.fcgi" -host 127.0.0.1:2015
>> </IfModule>
>>
>> I've downloaded the fcgid .so and put it in the modules folder.
>>
>> I've tried all manner of combination of directories, changing
>> directories vs. settings in httpd.conf, etc. Just can't seem to get
>> apache configured correctly. Most of what I've been able to find is
>> scattered around in terms of any real examples of setting up fastcgi on
>> apache. The apache server never hits the fcgi server for requests.
>>
>> I convinced the client to let me put a prototype together and I'm about
>> 5 days of trying at this point so any suggestion anyone might have about
>> getting fastcgi with apache connecting to the lazarus fcgi server would
>> be really appareciated. :-)
>>
>> --
>> Warm Regards,
>>
>> Lee
>
> It seems you are trying to use the fcgid module that comes with Apache and Linux
> distributions.
> That will not work most probably. You need the original fastcgi from the
> official website http://www.fastcgi.com/dist/ .
>
> I did list steps for both Windows and Linux (you have to compile from sources on
> Linux) in this forums thread somewhere:
>
> http://www.lazarus.freepascal.org/index.php/topic,12817.0.html
>

Wow, I was way off.  Thank you for that.  Great stuff.  Got me up and working 
like a champ.  Thanks for your help.

--
Warm Regards,

Lee





More information about the Lazarus mailing list