[Lazarus] fpWeb FCGI Setup

ABorka fpc-devel at aborka.com
Thu May 26 20:10:40 CEST 2011


On 5/26/2011 10:28, silvioprog wrote:
> 2011/5/26 ABorka<fpc-devel at aborka.com>:
> [...]
>> For now, I suggest you use the FastCgiExternalServer way on Windows and
>> specify a port in your FCGI app/Apache conf. You need to start the FCGI
>> application before sending the requests to it though because this way Apache
>> does not do it for you.
>
> Hm..., and how I do it? (is there any article?) :/
>
> Thx AB.

1. Specify a port number in your project main file (.lpr)
...<snip>...
   Application.Title:='My FCGI Application';
   Application.Port:=2015;//Port the FCGI application is listening on
   Application.Initialize;
   Application.Run;
...<snip>...

2. In your apache config file (ex: httpd.conf) put something like
LoadModule fastcgi_module "C:/path to the dll/mod_fastcgi-2.4.6-AP22.dll"
<IfModule mod_fastcgi.c>
   ScriptAlias /myfcgi "C:/path to your fcgi application/yourfcgi.exe"
   <Directory "C:/path to your fcgi application">
     SetHandler fastcgi-script
     Order allow,deny
     Allow from all
   </Directory>
   FastCgiExternalServer "C:/path to your fcgi application/yourfcgi.exe" 
-host 127.0.0.1:2015 -idle-timeout 30 -flush
</IfModule>

Note, the port number in the .conf file and in your app must match

3. Restart your Apache
4. Start up your FCGI application in a command prompt window or from 
Lazarus if you want to run in debug mode
5. Open your web browser and go try to call your FCGI application
(ex: http://127.0.0.1:8080/myfcgi/ActionName )

AB





More information about the Lazarus mailing list