[Lazarus] fpweb basic Apache module on Ubuntu not working

ABorka fpc-devel at aborka.com
Thu Sep 25 01:39:15 CEST 2008


Sorry, it seems I did not notice your question till now.
Here is the project source:
====================================
Library mod_testapache1;

{$mode objfpc}{$H+}

Uses fpWeb,lazweb,httpd,fpApache, unit1;

Const

{ The following constant is used to export the module record. It must
   always match the name in the LoadModule statement in the apache
   configuration file(s). It is case sensitive !}
   ModuleName='mod_apache1';

{ The following constant is used to determine whether the module will
   handle a request. It should match the name in the SetHandler statement
   in the apache configuration file(s). It is not case sensitive. }

   HandlerName=ModuleName;

Var
   DefaultModule : module; {$ifdef unix} public name ModuleName;{$endif 
unix}

{$ifdef windows}
Exports defaultmodule name ModuleName;
{$endif windows}

begin
   Application.Title:='mod_apache1';
   Application.ModuleName:=ModuleName;
   Application.HandlerName:=HandlerName;
   Application.SetModuleRecord(DefaultModule);
   Application.Initialize;
end.
======================================
When starting up apache2 in Ubuntu 8.04:

apache2: Syntax error on line 2 of /etc/apache2/apache2.conf: Can't 
locate API module structure `mod_apache1' in file .../mod_testapache1: 
.../mod_testapache1: undefined symbol: mod_apache1

apache2.conf entry:
LoadModule mod_apache1 "...path.../mod_testapache1"
<Location /myapache>
     SetHandler mod_apache1
     Order allow,deny
     Allow from all
</Location>



Michael Van Canneyt wrote:
> 
> On Sun, 21 Sep 2008, ABorka wrote:
> 
>> Well, the real question is whether Lazarus does that correctly when one
>> creates a vanilla apache module from the file menu and compiles it right
>> away unchanged. On Linux it did not work for me, maybe someone else could
>> confirm or deny.
> 
> Can you show the generated source ?
> 
> Michael.
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
> 




More information about the Lazarus mailing list