FreePascal/Linux daemon or Apache extension

Hello

I need to develop a SOAP web service to be deployed on a headless linux machine.
Best would be a daemon/service app or an apache extension (DSO, FastCGI, etc…)
Where can I find a template or sample project?

Thanks, Rick

Bump…

Anyone can help me out with a FreePascal Apache DSO sample project?

Thx, Rickie

Hello,
Unfortunately, we doesn’t support FastCGI server.
Our DSO Apache project uses WebBroker, but FPC doesn’t contain it.
http://www.lazarus.freepascal.org/index.php?topic=14717.0
So it is only compatible with delphi.

I think is more easy to build a normal server, and use a fron-end server like apache to forward the request to it. Is possible with the rewrite:http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

This is very similar to what happend with a fastcgi server.

Thanks for the advice!

I started to set up a DEV environment (Ubuntu + Lazarus + Indy + RemObjects SDK).

With the RemObjects SDK installation in Lazarus I get an error:

OK -> …\Everwood\Source\Delphi\RemObjects_Everwood_Lazarus_Windows.lpk

OK -> …\RemObjects SDK for Delphi\Source\RemObjects_Synapse_Lazarus_Windows.lpk

PROBLEM -> …\RemObjects SDK for Delphi\Source\IDE\RemObjects_IDE_Lazarus_Windows.lpk

Hint: Start of reading config file C:\lazarus\fpc\2.4.4\bin\i386-win32\fpc.cfg
Hint: End of reading config file C:\lazarus\fpc\2.4.4\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.4.4 [2011/11/04] for i386
Copyright © 1993-2010 by Florian Klaempfl
Target OS: Win32 for i386
Compiling RemObjects_IDE_Lazarus_Windows.pas
Compiling uROIDETools_laz.pas
C:\lazarus\components\RemObjects\RemObjects SDK for Delphi\Source\IDE\uROIDETools_laz.pas(1,1) Fatal: Can’t find unit CompOptsIntf used by uROIDETools_laz

Where can I find “CompOptsIntf.pas” ?

P.S: “Windows” because I first test the process-step on Windows before applying it to the fresh Ubuntu setup.

Thanks,
Rick

Hi.

It is here http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/ideintf/?root=lazarus .

Hi there

Thanks, I made a small progress:

I downloaded the following Lazarus files into …\RemObjects SDK for Delphi\Source\IDE\

compoptsintf.pas
formeditingintf.pas
ideoptionsintf.pas
lazideintf.pas
projectintf.pas
srceditorintf.pas

Now when compiling Lazarus asks for the missing “uEWOTAHelpers_laz.pas”.

-> What do you recommend to do here? Seems to be part of everwood !?

Thanks,
Rick

Hi.

This file is in “RemObjects Software\Everwood\Source\Delphi” folder.

Hi there

Ok, I did add the following paths to the compiler settings:
(Units): “…\RODEC;…\ZLib;…\CodeGen;…\CodeGen2;…\Everwood\Source\Delphi”
(Include): “…\RODEC”

However when I try to install the compiled package I get messages like:

The unit uEWAbout exists twice in the unit path of the IDE:

  1. “…\RemObjects SDK for Delphi\DCU\Lazarus\i386-win32\uEWAbout.ppu”
  2. “…\RemObjects…\uEWAbout.ppu”

I push “Ignore all…” to continue…

And then I get an error saying that “compoptsintf.pas” could not be found!

-> What can I configure more resp. where do I need to copy this to?

P.S: All other packages do compile and install correctly :slight_smile:

Thanks
Rickie

Hi.

  1. About duplicate units, just remove all *.ppu and rebuild.

  2. compoptsintf.pas is in http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/ideintf/?root=lazarus .

Hi there

Sorry but this is not working somehow.

Compile the IDE package -> OK
Install the IDE package -> ERROR

(See attached sshot1 for the settings)

When I push “install” I get first several errors (sshot2) and then an error (sshot3)

The file “compoptsintf.pas” is correctly in c:\lazarus\ideintf\ so I don’t understand why it is not working !?

P.S: I have lazarus 0.9.30-2 installed. Initial compilation of the RemObjects IDE package gave me some errors so I downloaded the following lazarus files (that the RemObjects package uses) and replaced them in c:\lazarus\ideintf. Don’t know if I can do that…

compoptsintf.pas
formeditingintf.pas
ideoptionsintf.pas
lazideintf.pas
projectintf.pas
srceditorintf.pas

Thanks,
R.

Hi there

As I can not continue on the Windows machine I tried to make some progress on the Ubuntu machine (the actual target).

-> The everwood package can be compiled and installed.
-> The core package gives error when compiling:

  1. The files “uROcipher.inc” and “uROcipher1.inc” can not be found. In the directory /RODEC I created 2 symbolic links to the existing files “uROCipher.inc” and “uROCipher1.inc” to fix that.

  2. then in file “uROClasses” I get the next error on the code line “
    if sem_timedwait(FEvent, inttimeout) = 0 then”

/usr/lib/lazarus/0.9.30/components/RemObjects/RemObjects SDK for Delphi/Source/uROClasses.pas(2404,40) Error: Incompatible type for arg no. 2: Got “timespec”, expected “ptimespec”

Thanks,
R.

Hello,
You wrote:

The core package gives error when compiling:
This is known issue #52379

The files “uROcipher.inc” and “uROcipher1.inc” can not be found.
On package call popup menu command ‘Fix files case’

then in file “uROClasses” I get the next error on the code line
Use sem_timedwait(@FEvent, @inttimeout) instead of sem_timedwait(FEvent, inttimeout)

Hi there

Ok, after that I get a few more simmilar compiling error where i also add the “@” operator in the code. I hope these fixes are correct !?

Then finally I get an error in “uROMime” with the definition of “size_t”:

/usr/lib/lazarus/0.9.30/components/RemObjects/RemObjects SDK for Delphi/Source/uROMime.pas(443,77) Error: Identifier not found “size_t”

My fix is that I redeclare:

{$IFNDEF FPC}
TLibHandle = HModule;
size_t = Cardinal;
{$ENDIF}
size_t = Cardinal; // <- Add this!

Then I can compile and install the “core” package!

After that “Indy” and “Synapse” packages went fine compiling and installing. So in theory the Ubuntu Linux DEV environment is OK.

I will now try to compile the “FPC Server” sample project…

Thanks,
R.

Hello,

You wrote:

I hope these fixes are correct !?
Your fix is correct

Then finally I get an error in “uROMime” with the definition of “size_t”:
Add baseunix module to ‘uses’ list in uROMime.

Thanks. I am getting closer!

There are still two problems:

  1. The “IDE” package can be compiled but not installed -> See my message above with the attached screenshots. Am I correct that this package is not essential to work with RO SDK?

  2. I did compile the “FPC Server” sample project. Compilation is OK. The client-part starts well but the server-part gives an error:

rickie@FPC:~/Desktop/FPC_Server$ ./SimpleServer
RemObjects SDK for Delphi - Command Line Server
This binary has no thread support compiled in.
Recompile the application with a thread-driver in the program uses clause before other units using thread.
Runtime error 232 at $0805D182
$0805D182
$081F289E TIDTHREAD__CREATE, line 417 of IdThread.pas
$081F0FA7 TIDLISTENERTHREAD__CREATE, line 870 of IdCustomTCPServer.pas
$081F0744 TIDCUSTOMTCPSERVER__STARTLISTENING, line 677 of IdCustomTCPServer.pas
$081F0E31 TIDCUSTOMTCPSERVER__STARTUP, line 836 of IdCustomTCPServer.pas
$081F02A2 TIDCUSTOMTCPSERVER__SETACTIVE, line 561 of IdCustomTCPServer.pas
$081D8BDF TIDCUSTOMHTTPSERVER__SETACTIVE, line 1044 of IdCustomHTTPServer.pas
$0806BAFD TROIDHTTPSERVER__INDYSETACTIVE, line 860 of uROIndyHTTPServer.pas
$0806AE89 TROINDYHTTPSERVER__INTSETACTIVE, line 194 of uROIndyHTTPServer.pas
$080688AE TROSERVER__SETACTIVE, line 1264 of uROServer.pas

P.S: Are there some other sample projects running on Linux?

Thanks,
Rick

Hello,

P.S: Are there some other sample projects running on Linux?
Please add cthreads unit first to ‘uses’ list in server project.

Hi there

Ok this works. Thank you!

Can you just tell me a few words about the IDE package? Are working on that resp. will this be fixed in the next SDK release?

In the meantime how do you recomend me to start developing my application? Use delphi & RO service-builder on windows to setup a base “structure” of my application (_Intf & _Invk files) and then try to port these to FPC/linux?

Thanks
R.

Hello,
You wrote:

Can you just tell me a few words about the IDE package? Are working on that
resp. will this be fixed in the next SDK release?
We are working on it. We will send you answer at the nearest time.

In the meantime how do you recomend me to start developing my application?
Use delphi & RO service-builder on windows to setup a base “structure” of
my application (_Intf & _Invk files) and then try to port these to FPC/linux?
Yes, the simple way is using of delphi & RO service-builder on windows to setup a base “structure” of your application (_Intf & _Invk files) and then port these to FPC/linux.

Ok, I tried to migrate a working “Skeleton” project from Delphi to Lazarus. It is very basic standalone application with a TROIndyHTTPServer and a TROSOAPMessage.

The app compiles & starts fine. However when I try to access it in a browser using

http://192.168.20.17:8099/soap?service=NewService

I get an error:

{0AF102FA-E20F-42BD-A68B-232A4787DACE}EResNotFoundResource “RODLFILE” not found

P.S: The RODLFILE.res and as copy as RODLFile.res are both in the project directory !?

Thanks,
R.