Run Intraweb .so on apache

1.4k Views Asked by At

I made a stand alone app and it works find Intraweb 9.4.2' Create an apache 2 .so

project info ---
library DartsDLL;
uses
    ApacheTwoApp,
    IWInitApacheTwo,
    DLogin in 'DLogin.pas' {IWForm1: TIWAppForm},
    ServerController in 'ServerController.pas' {IWServerController:
    TIWServerControllerBase},
    UserSessionUnit in 'UserSessionUnit.pas' {IWUserSession: TIWUserSessionBase},
    DartDM in 'DartDM.pas' {dm: TDataModule},
    plyrshow in 'plyrshow.pas' {plyrs: TIWAppForm},
    plyrdetail in 'plyrdetail.pas' {weekdtail: TIWAppForm},
    NPlyr in 'NPlyr.pas' {FrmNewPlyr: TIWAppForm},
    pidlweeks in 'pidlweeks.pas' {Tseasweeks: TIWAppForm};

{$E so}

{$R *.res}

exports
    apache_module name 'webdarts_mod';

begin  
   IWRun; 
end.

conf files have been modified
httpd2.pas has been modified
apache restarts ok.

I get no errors in apache logs. When I try to run inside delphi I get:

Can not run unless host application is defined.

Question how do you run it?

2

There are 2 best solutions below

0
On

From the menu open Run Parameters and set the host application to C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe or the path where you installed Apache httpd. Another tip is to add -X to the parameters to force Apache httpd to run from a single process to not confuse the debugger.

0
On

Looking at project files the two important items are library DartsDll and apache_module name 'webdarts_mod'. Presuming project compiles DartsDll.so will be created along with apache_module name.

Notice where apache_module name and library are used in LoadModule directive and where library name is used without ext in SetHandler.

Next you need to modify Apache httpd.conf file by adding four lines as follows;

LoadModule webdarts_mod modules/Dartsdll.so

< Location /??????>

SetHandler DartsDll-handler

< Location>

Replace the question marks with anything you desire (except any name you have already used as a apache alias) I used 'guessd'

You must copy the DartsDll.so file to the apache modules directory.

Restart Apache. In browser just enter - localhost/guessd If your apache has been configured correctly your .so(dll) will run.