Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-05

fpWeb Apache2 Windows

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo Rame

Hi, I'm trying to do some tests of fpWeb on Windows Seven 64bits using Apache2 (32bits). The first test I did was compiling the HelloWorld sample from c:\lazarus\components\fpweb \demo\helloworld\cgi and trying to execute it, but it doesn't work (500 Internal server error).

This is what my Apache's logs in error.log file:

[Sat May 22 17:12:34 2010] [notice] Child 996: Child process is running [Sat May 22 17:12:34 2010] [notice] Child 996: Acquired the start mutex. [Sat May 22 17:12:34 2010] [notice] Child 996: Starting 64 worker threads. [Sat May 22 17:12:34 2010] [notice] Child 996: Starting thread to listen on port 8080. [Sat May 22 17:21:37 2010] [error] [client 127.0.0.1] malformed header from script. Bad header= $0000000100015385: helloworld.exe

Any hint?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100522/ae2ae257/attachment.html>

Reply by email

Michael Van Canneyt
to Leonardo Rame
Leonardo Rame wrote 11 lines
Hi, I'm trying to do some tests of fpWeb on Windows Seven 64bits using Apache2 (32bits). The first test I did was compiling the HelloWorld sample from c:\lazarus\components\fpweb \demo\helloworld\cgi and trying to execute it, but it doesn't work (500 Internal server error). This is what my Apache's logs in error.log file: [Sat May 22 17:12:34 2010] [notice] Child 996: Child process is running [Sat May 22 17:12:34 2010] [notice] Child 996: Acquired the start mutex. [Sat May 22 17:12:34 2010] [notice] Child 996: Starting 64 worker threads. [Sat May 22 17:12:34 2010] [notice] Child 996: Starting thread to listen on port 8080. [Sat May 22 17:21:37 2010] [error] [client 127.0.0.1] malformed header from script. Bad header= $0000000100015385: helloworld.exe Any hint?

Can you execute the module in a minimal test environment (not apache) ? (you need at least REQUEST_METHOD QUERY_STRING and PATH_INFO environment variables)

I have a test-cgi application ready, but still need to put it in Subversion. (it sets up a minimal CGI environment, and then executes the CGI application - easier to debug)

Michael.

Reply by email

Leonardo Rame

Hi Michael, thanks for replying.

I created a basic example called 'cgiproject1' consisting of only an TFPWebModule's OnRequest method like this, with no action:

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

Without environment vars, the result is this:

exception at 000000010003B5DC:
No REQUEST_METHOD passed from server.

If I set the environment var REQUEST_METHOD using "set REQUEST_METHOD=POST", or "GET", the result is this:

An unhandled exception occurred at $000000010001FC05 : EWriteError : Stream write error
$000000010001FC05
$0000000100034C77
$0000000100037D54
$0000000100033DCA
$00000001000015DE main, line 13 of giproject1.lpr

It doesn't matter if I set QUERY_STRING and PATH_INFO, the result is the same.

Leonardo.

Earlier message 11 lines
----- Mensaje original ----- Fecha: Sun, 23 May 2010 11:12:51 +0200 (CEST) De: "Michael Van Canneyt" Para: "Lazarus mailing list" Asunto: Re: [Lazarus] fpWeb Apache2 Windows On Sat, 22 May 2010, Leonardo Rame wrote: > Hi, I'm trying to do some tests of fpWeb on Windows Seven 64bits using Apache2 (32bits). The first test I did was compiling the HelloWorld sample from c:lazaruscomponentsfpweb demohelloworldcgi and trying to execute it, but it doesn't work (500 Internal server error). > > This is what my Apache's logs in error.log file: > > [Sat May 22 17:12:34 2010] [notice] Child 996: Child process is running > [Sat May 22 17:12:34 2010] [notice] Child 996: Acquired the start mutex. > [Sat May 22 17:12:34 2010] [notice] Child 996: Starting 64 worker threads. > [Sat May 22 17:12:34 2010] [notice] Child 996: Starting thread to listen on port 8080. > [Sat May 22 17:21:37 2010] [error] [client 127.0.0.1] malformed header from script. Bad header= $0000000100015385: helloworld.exe > > Any hint? Can you execute the module in a minimal test environment (not apache) ? (you need at least REQUEST_METHOD QUERY_STRING and PATH_INFO environment variables) I have a test-cgi application ready, but still need to put it in Subversion. (it sets up a minimal CGI environment, and then executes the CGI application - easier to debug) Michael. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100523/a6b3a665/attachment.html>

Reply by email

ABorka
to Leonardo Rame: Hi, I'm trying to do some tests of fpWeb on Windows Seven 64bits using Apache2 (32bits).…
Leonardo Rame wrote 16 lines
Hi, I'm trying to do some tests of fpWeb on Windows Seven 64bits using Apache2 (32bits). The first test I did was compiling the HelloWorld sample from c:\lazarus\components\fpweb \demo\helloworld\cgi and trying to execute it, but it doesn't work (500 Internal server error). This is what my Apache's logs in error.log file: [Sat May 22 17:12:34 2010] [notice] Child 996: Child process is running [Sat May 22 17:12:34 2010] [notice] Child 996: Acquired the start mutex. [Sat May 22 17:12:34 2010] [notice] Child 996: Starting 64 worker threads. [Sat May 22 17:12:34 2010] [notice] Child 996: Starting thread to listen on port 8080. [Sat May 22 17:21:37 2010] [error] [client 127.0.0.1] malformed header from script. Bad header= $0000000100015385: helloworld.exe Any hint?

Make sure you compile for the right Apache version. In your FPC directory under /units/... there are 3 subdirectories

.../httpd13
.../httpd20
and
.../httpd22

Delete all but the version you have. For example, if you have Apache 2.2 then only leave the httpd22 directory there and delete the other two. This might not be the problem for CGI, but for Apache modules it was important when I played with it.

AB

Reply by email

Joost van der Sluis
to Leonardo Rame: Hi Michael, thanks for replying. I created a basic example called 'cgiproject1'…
Leonardo Rame wrote 31 lines
Hi Michael, thanks for replying. I created a basic example called 'cgiproject1' consisting of only an TFPWebModule's OnRequest method like this, with no action: procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: TRequest; AResponse: TResponse; var Handled: Boolean); begin AResponse.Content := 'Hello'; Handled := True; end; Without environment vars, the result is this: exception at 000000010003B5DC: No REQUEST_METHOD passed from server. If I set the environment var REQUEST_METHOD using "set REQUEST_METHOD=POST", or "GET", the result is this: An unhandled exception occurred at $000000010001FC05 : EWriteError : Stream write error $000000010001FC05 $0000000100034C77 $0000000100037D54 $0000000100033DCA $00000001000015DE main, line 13 of giproject1.lpr It doesn't matter if I set QUERY_STRING and PATH_INFO, the result is the same.

Should work, which version of fpc are you using? And you are really creating a cgi-app, not a f(ast)cgi one?

Joost.

Reply by email

Leonardo M. Ramé
to Joost van der Sluis

El mar, 25-05-2010 a las 12:45 +0200, Joost van der Sluis escribi?:

Show quoted text 37 lines
On Sun, 2010-05-23 at 23:13 -0300, Leonardo Rame wrote: > Hi Michael, thanks for replying. > > I created a basic example called 'cgiproject1' consisting of only an > TFPWebModule's OnRequest method like this, with no action: > > procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: > TRequest; > AResponse: TResponse; var Handled: Boolean); > begin > AResponse.Content := 'Hello'; > Handled := True; > end; > > Without environment vars, the result is this: > > exception at 000000010003B5DC: > No REQUEST_METHOD passed from server. > > If I set the environment var REQUEST_METHOD using "set > REQUEST_METHOD=POST", or "GET", the result is this: > > An unhandled exception occurred at $000000010001FC05 : > EWriteError : Stream write error > $000000010001FC05 > $0000000100034C77 > $0000000100037D54 > $0000000100033DCA > $00000001000015DE main, line 13 of giproject1.lpr > > It doesn't matter if I set QUERY_STRING and PATH_INFO, the result is > the same. Should work, which version of fpc are you using? And you are really creating a cgi-app, not a f(ast)cgi one? Joost.

I'm using 2.5.1 from trunk, and yes, I'm creating a CGI Application. I'll come back to debugging this in a couple of weeks.

Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979

Reply by email

Joost van der Sluis
to Leonardo M. Ramé
Leonardo M. Ram? wrote 40 lines
El mar, 25-05-2010 a las 12:45 +0200, Joost van der Sluis escribi?: > On Sun, 2010-05-23 at 23:13 -0300, Leonardo Rame wrote: > > Hi Michael, thanks for replying. > > > > I created a basic example called 'cgiproject1' consisting of only an > > TFPWebModule's OnRequest method like this, with no action: > > > > procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: > > TRequest; > > AResponse: TResponse; var Handled: Boolean); > > begin > > AResponse.Content := 'Hello'; > > Handled := True; > > end; > > > > Without environment vars, the result is this: > > > > exception at 000000010003B5DC: > > No REQUEST_METHOD passed from server. > > > > If I set the environment var REQUEST_METHOD using "set > > REQUEST_METHOD=POST", or "GET", the result is this: > > > > An unhandled exception occurred at $000000010001FC05 : > > EWriteError : Stream write error > > $000000010001FC05 > > $0000000100034C77 > > $0000000100037D54 > > $0000000100033DCA > > $00000001000015DE main, line 13 of giproject1.lpr > > > > It doesn't matter if I set QUERY_STRING and PATH_INFO, the result is > > the same. > > Should work, which version of fpc are you using? And you are really > creating a cgi-app, not a f(ast)cgi one? > > Joost. I'm using 2.5.1 from trunk, and yes, I'm creating a CGI Application.

Thought so. Please try with fpc 2.4.0.

Joost.

Reply by email

Leonardo M. Ramé
to Joost van der Sluis

El mar, 25-05-2010 a las 18:54 +0200, Joost van der Sluis escribi?:

Show quoted text 46 lines
On Tue, 2010-05-25 at 12:35 -0300, Leonardo M. Ram? wrote: > El mar, 25-05-2010 a las 12:45 +0200, Joost van der Sluis escribi?: > > On Sun, 2010-05-23 at 23:13 -0300, Leonardo Rame wrote: > > > Hi Michael, thanks for replying. > > > > > > I created a basic example called 'cgiproject1' consisting of only an > > > TFPWebModule's OnRequest method like this, with no action: > > > > > > procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: > > > TRequest; > > > AResponse: TResponse; var Handled: Boolean); > > > begin > > > AResponse.Content := 'Hello'; > > > Handled := True; > > > end; > > > > > > Without environment vars, the result is this: > > > > > > exception at 000000010003B5DC: > > > No REQUEST_METHOD passed from server. > > > > > > If I set the environment var REQUEST_METHOD using "set > > > REQUEST_METHOD=POST", or "GET", the result is this: > > > > > > An unhandled exception occurred at $000000010001FC05 : > > > EWriteError : Stream write error > > > $000000010001FC05 > > > $0000000100034C77 > > > $0000000100037D54 > > > $0000000100033DCA > > > $00000001000015DE main, line 13 of giproject1.lpr > > > > > > It doesn't matter if I set QUERY_STRING and PATH_INFO, the result is > > > the same. > > > > Should work, which version of fpc are you using? And you are really > > creating a cgi-app, not a f(ast)cgi one? > > > > Joost. > > I'm using 2.5.1 from trunk, and yes, I'm creating a CGI Application. Thought so. Please try with fpc 2.4.0. Joost.

I'll try it. The root of my fault is that I thougth fpWeb was a Lazarus package, now I know it's an fcl one...

Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979

Reply by email