[Lazarus] New application type: HTTP standalone server

Leonardo M. Ramé l.rame at griensu.com
Thu Jun 2 19:46:22 CEST 2011


On 2011-06-02 18:30:06 +0200, Michael Van Canneyt wrote:
> Hi,
> 
> In revision 31011 I committed support for a HTTP server application in
> Lazarus, in the lazwebextra package. This is similar in functionality to the
> embweb package by Joost, but it does not use any external packages: you only
> need the latest FPC for this (at least rev. 17633).
> 
> It has an option to be able to serve regular files out-of-the-box. This is
> implemented as a regular fpWeb HTTP module, which simply sends a file if it
> finds it. This module is implemented in a (new) unit fpwebfile. It works
> similar to the Apache server's Alias directive:
>  RegisterFileLocation('files','/some/existing/directory');
> will map /files/index.html to /some/existing/directory/index.html and send it.
> Multiple locations can be registered.
> if a mime.types file is present, the correct content-type is sent.
> 
> The FPC packages/fcl-web/examples/httpapp directory contains an example of how to use all this.
> 
> This means that FPC can now be used out of the box to implement web applications/pages
> as
> - CGI.
> - FastCGI.
> - Apache module.
> - Standalone webserver.
> IIS ISAPI support is planned.
> 
> Comments/suggestions welcome.
> 

Michael, I added a webmodule to testhttp and got two problems.

1 - Could not determine HTTP module for request "". Even if I call it
the same way as I use with fpCGI and fpEmbWeb.

2 - The 2nd time I run the program I get. ESocketError "Binding of
socket failed: 8080".

I'm running Ubuntu 11.04 - 64bits. 

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




More information about the Lazarus mailing list