Hi,
My intention is to use PostgreSQL with PostGIS in a Apache loadable module on Ubuntu server.
I downloaded the demo data from Lee County, Florida as a shape file and, using QGIS, imported it into Postgres and created a spatial table (containing the geom column).
The idea is to execute typical spatial related SQL in XDataWebClient, e.g.
SELECT round((ST_Distance('SRID=4326;POINT(-25.745994 28.203887)'::geography,
'SRID=4326;POINT(-26.211253 28.025733)'::geography)/1000)::numeric, 0) as dist
I'm able to compile the program (my libmod_slimzulu.so) and deploy it to Ubuntu server but if I start Apache (sudo service apache2 start), I get the following response:
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Tue 2020-08-11 11:39:43 SAST; 22s ago
Docs: man:systemd-sysv-generator(8)
Process: 2146 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 2398 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
Aug 11 11:39:43 ubuntu apache2[2398]: *
Aug 11 11:39:43 ubuntu apache2[2398]: * The apache2 configtest failed.
Aug 11 11:39:43 ubuntu apache2[2398]: Output of config test was:
Aug 11 11:39:43 ubuntu apache2[2398]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/
Aug 11 11:39:43 ubuntu apache2[2398]: Action 'configtest' failed.
Aug 11 11:39:43 ubuntu apache2[2398]: The Apache error log may have more information.
Aug 11 11:39:43 ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 11 11:39:43 ubuntu systemd[1]: Failed to start LSB: Apache2 web server.
Aug 11 11:39:43 ubuntu systemd[1]: apache2.service: Unit entered failed state.
Aug 11 11:39:43 ubuntu systemd[1]: apache2.service: Failed with result 'exit-code'.
If I then comment out all lines referring to the geom column, compile and deploy to Ubuntu server then I'm able to successfully restart Apache.
I attach the unit containing the entities created by TAureliusConnection from the database. Note that all lines referring to the geom column are commented out.
If I can't do spatial SQL queries using XDATA server then my other option is to create the rest server by using PostgREST
Regards,
Nols SmitUnit1.zip (1.6 KB)