Apache won't start with XData server application

Hi,

Since I could not figure out how to attach files, I also send this question, with attachments, to info@tmssoftware.com

Using Oracle VM VirtualBox, On my desktop PC, I installed Ubuntu Server 16.04 and also PostgreSQL 12.

I also installed PostgreSQL client library for Ubuntu Server.

I configured the firewalling on Ubuntu server and using pgAdmin on my Windows laptop, I'm able to access the Postgres database in Ubuntu server on the desktop in VirtualBox.

Referring to the YouTube video:
Creating a REST Server on Apache Linux using Delphi and TMS XData - Part 5: TXData/Aurelius server

Following Part 4: TMS Sparkle with Apache, I created the Apache loadable module and after transferring it to Ubuntu and restarting Apache I do get the "Hello from Sparkle!" from Apache.

I then followed Part5: TXData/Aurelius server and created a loadable module with the same name as in Part4 and therefore I could use the same Apache config files as in Part4.

In Delphi, I created a new TMS Aurelius DBConnection and used the option to use a 3rd party component (Adapter Mode) with:
Adapter: FireDac
SQL dialect: PostgreSQL

I then, in Delphi, using the TAureliusConnection component do a successful "Generate entities from database ..."

After compiling for Linux 64 bit, I deployed the Apache loadable module to Ubuntu server and tried to restart Apache without success.

Apache gave the error message:
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

I attached the error.log file and also my program code.

Regards,

Nols Smit

You can attach files using the "upload" button while writing a text. See screenshot below. Note that not all extensions are allowed, but in worse case you can simply add all files to a zip file and then upload the zip.

According to the code you sent, you can try this:

  1. Comment the automatic creation of the data module in dpr:
  Web.ApacheApp.InitApplication(@GModuleData);
  Application.Initialize;
  Application.WebModuleClass := WebModuleClass;
//  Application.CreateForm(TFireDacPostgreSQLConnection, FireDacPostgreSQLConnection);
  Application.Run;
end.
  1. Manually create and destroy the data module in initialization and finalization sections of unit WebModule1:
initialization
  Server := TWebBrokerServer.Create;
  FireDacPostgreSQLConnection := TFireDacPostgreSQLConnection.Create(nil);

  TDatabaseManager.Update(TFireDacPostgreSQLConnection.CreateConnection);

  Server.Dispatcher.AddModule(TXDataServerModule.Create(
    'http://ubuntu/tms', TFireDacPostgreSQLConnection.CreateConnection
  ));
finalization
  Server.Free;
  FireDacPostgreSQLConnection.Free;
end.

Thanks, bullseye !

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.