[Lazarus] fpWeb FCGI Setup

silvioprog silvioprog at gmail.com
Fri May 27 12:45:16 CEST 2011


2011/5/26 ABorka <fpc-devel at aborka.com>:
> OK, here is what I did to make your downloaded project work (was not
> trivial):
>
> 1. Unzipped it and moved everything to the same directories
> 2. Edited the project main .lpr file and changed it to
> ...<snip>...
> uses
>  fpFCGI, Unit1, iniwebsession {for the error message}, custfcgi {for the
> poStripContentLength};
>
> begin
>  Application.Port := 2015; //Port the FCGI application is listening on
>  Application.ProtocolOptions := Application.ProtocolOptions +
> [poStripContentLength];//on windows, without this the response can be cut
> short
>  Application.Initialize;
>  Application.Run;
> end.
> ...<snip>...
>
> Note, without the iniwebsession we just get an exception complaining about
> it (this requirement should be removed from fpweb).
> Also, custfcgi is needed so we can add the protocolotions line, so on
> Windows the reply is not cut short by Apache (like error messages about the
> iniwebsession, for example).
>
> 3. in the httpd.conf
> LoadModule fastcgi_module
> "C:/xampp/apache/modules/mod_fastcgi-2.4.6-AP22.dll"
> <IfModule mod_fastcgi.c>
>  ScriptAlias /myfcgi "C:/xampp/htdocs/fcgi/test.exe"
>  <Directory "C:/xampp/htdocs/fcgi">
>    Order allow,deny
>    Allow from all
>  </Directory>
>  FastCgiExternalServer "C:/xampp/htdocs/fcgi/test.exe" -host 127.0.0.1:2015
> -idle-timeout 30 -flush
>
> 4. Start apache
> 5. Start the test.exe application from a cmd window
> 6. Navigate to http://127.0.0.1:8080/myfcgi/index from my browser to see:
> Test
>
> Note, your response generation only sends back the text "Test" instead of a
> proper web page. It should be at least something like
>
>  Handled := True;
>  AResponse.Content := '<html><body>Test</body></html>';

Oh, same error again. :S

http://imagebin.org/155410

Another error:

"Unit1.pas(1,1) Fatal: Can't find unit iniwebsession used by fcgiproject1".

I looked in every folder of Lazarus and did not find this unit. :(

My environment:

Lazarus 0.9.31 r30896 FPC 2.5.1 i386-win32-win32/win64
Windows: http://imagebin.org/155412

Thanks.

> AB

-- 
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
LazSolutions - <code.google.com/p/lazsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================




More information about the Lazarus mailing list