0

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?

ppaulojr
  • 3,579
  • 4
  • 29
  • 56
  • 1
    You need to attach your DLL to a host process, like the message says. This would be your Apache server. – Jerry Dodge Aug 26 '13 at 20:10
  • Please bear with me. So what would the HTTP: line look like with info I provided. my localhost alias is 'darts' – Tony Taylor Aug 26 '13 at 20:44
  • I'm sorry I've never used Apache so that's all I know what to tell you. All DLL's must be run from a host application. – Jerry Dodge Aug 26 '13 at 20:50
  • If the httpd.conf has a line like `Listen 8080` the URL would be `http://localhost:8080/` If you use the SetHandler line in a section, e.g. `` then it's `http://localhost:8080/test/` – Stijn Sanders Aug 26 '13 at 21:43

2 Answers2

2

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.

Stijn Sanders
  • 35,982
  • 11
  • 45
  • 67
0

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.