[Lazarus] fp-Web and FastCGI

Leonardo M. Ramé l.rame at griensu.com
Sun Oct 10 20:00:14 CEST 2010


On 2010-10-10 13:34:30 -0300, Leonardo M. Ramé wrote:
> 
>   exception at 0000000000466EEA:
>   Failed to open input-handle passed from server. Socket Error: 88. 
> 
> Now I'm stuck, somebody can help me with this?.
> 

I figured out that I was configuring wrongly my apache2. Instead of
using FastCgiExternalServer I changed it for this:


FastCgiServer /var/www/fcgi-bin/myfastcgiapp.fcgi -idle-timeout 3

Also, I was using a symbolic link to
/var/www/fcgi-bin/myfastcgiapp.fcgi, and now I just copied my app to
that directory.

Then, I restarted apache2, and went to
http://localhost/fcgi-bin/myfastcgiapp.fcgi and, got a *more friendly*
response.

I removed my TFPWebModule actions, and added just this global request
handler:

procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest:
TRequest;
  AResponse: TResponse; var Handled: Boolean);
begin
  AResponse.Content := 'Hello World!';
  Handled := True;
end;   

In a normal cgi app, when the user goes to
http://localhost/cgi-bin/mycgiapp.cgi, the browser should show "Hello
World!", but in the case of this fastcgi app, it only shows "He", the
first two characters of "Hello World!".

My environment is this:

Ubuntu 10.04 X86-64
Apache2 2.2.14
Lazarus 0.9.29 - Rev. 27637
FPC 2.5.1 - Rev. 16123

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list