mod_harbour + ADS on linux server

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

mod_harbour + ADS on linux server

Postby berpa » Wed Nov 30, 2022 7:51 am

Hello everybody,
I'm trying to set up a small site that uses mod_harbour with ADS libraries on a linux server.
The same application is already working on Windows (XAMPP) but I can't find anywhere how to configure a linux server to do the same thing.

The mod_harbour application is installed in /var/www/html/top.
Following this guide https://github.com/FiveTechSoft/mod_harbour/tree/master/linux I have put libharbour.so.3.2.0 in /var/www/html and mod_harbour.so in /usr/lib/apache2/modules.
I found a small guide about mod_harbour + ADS on linux here https://github.com/FiveTechSoft/mod_harbour/wiki/Using-ADS-from-mod-harbour-on-Linux that says to use libace.so and libadsloc.so in the same way as ace32.dll and AdsLoc32.dll are used in Windows.
In Windows I put ace32.dll and AdsLoc32.dll in apache/bin directory (eg. c:\xampp\apache\bin).

Where should I put libace.so and libadsloc.so to make them visible to mod_harbour? Is there a libharbour.so specific to use with ADS?

By the way, the error shown by the application is this:
Error: Unknown or unregistered symbol
operation: ADSSETSERVERTYPE
called from: HB_HRBLOAD, line: 0
called from: ../source/exec.prg, LOADHRB, line: 167
called from: ../source/exec.prg, (b)REPLACEBLOCKS, line: 141
called from: ../source/exec.prg, REPLACEBLOCKS, line: 141
called from: ../source/exec.prg, EXECUTE, line: 63

Thank you in advance.
berpa
 
Posts: 16
Joined: Tue Nov 29, 2022 2:23 pm

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Wed Nov 30, 2022 8:49 am

Dear Paolo,

What Linux version are you using ? 32 or 64 bits ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: mod_harbour + ADS on linux server

Postby berpa » Wed Nov 30, 2022 3:08 pm

Dear Antonio,

thank you for you kind reply.

I am using Ubuntu Server 20.04 64 bit.
I also forget to mention the version of the ADS libraries which is 11.10.0.24. I tried with the 64 bit version of libace.so and libadsloc.so.
berpa
 
Posts: 16
Joined: Tue Nov 29, 2022 2:23 pm

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Thu Dec 01, 2022 8:33 am

Dear Paolo,

We are trying to build it for you but we get these errors:
/usr/bin/ld: /home/anto/harbour/lib/linux/gcc/libhbvmmt.a(hvmall.o): relocation R_X86_64_TPOFF32 against `hb_stack_ptr' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/anto/harbour/lib/linux/gcc/libhbpcre.a(pcreexec.o): relocation R_X86_64_PC32 against symbol `_pcre_ucd_stage2' can not be used when making a shared object; recompile with -fPIC

Now trying this possible solution:
$ cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON (other option) ..
$ make -j

seen at https://github.com/gabime/spdlog/issues/1405
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Thu Dec 01, 2022 8:37 am

same error...

looking for a solution
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Thu Dec 01, 2022 9:04 am

next try using export HB_USER_CFLAGS=-fPIC before building Harbour
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Thu Dec 01, 2022 9:11 am

Problem solved :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: mod_harbour + ADS on linux server

Postby berpa » Thu Dec 01, 2022 9:15 am

Thank you for your effort.

I also tried to compile mod_harbour following this guide https://github.com/FiveTechSoft/mod_harbour/tree/master/linux but did not succeed.
I got stuck on the step
Code: Select all  Expand view
chmod +x go.sh
./go.sh

because I could not find the go.sh script mentioned in the guide.

Anyway, I think that I should also include something from ADS while compiling harbour/mod_harbour but I don't know what...

Thanks again.
berpa
 
Posts: 16
Joined: Tue Nov 29, 2022 2:23 pm

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Thu Dec 01, 2022 9:17 am

Dear Paolo,

I just emailed you mod_harbour for Ubuntu 20.04 64 bits including ADS support

Please try it and let us know how it works for you :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: mod_harbour + ADS on linux server

Postby berpa » Thu Dec 01, 2022 9:31 am

I am trying, but now it does not work anymore (even the examples bundled with harbour).
Maybe it's something about the permissions.

I will try to reconfigure mod_harbour environment from the start and I'll let you know if it works.

Thank you.
berpa
 
Posts: 16
Joined: Tue Nov 29, 2022 2:23 pm

Re: mod_harbour + ADS on linux server

Postby berpa » Thu Dec 01, 2022 9:38 am

Ok, I got it... I had to restart apache... :oops:

Now I get this error (both in my application and in mod_harbour examples):

mod_harbour version Dec 1 2022, 10:10:00
/tmp/libharbour.-846395648.-210844650: undefined symbol: HB_FUN_ADS
failed to load hb_apache()

Am I doing something wrong?
berpa
 
Posts: 16
Joined: Tue Nov 29, 2022 2:23 pm

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Thu Dec 01, 2022 10:04 am

Dear Paolo,

I have just emailed you a new libharbour.so.3.2.0

Please replace it and try it again

many thanks for your feedback :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Thu Dec 01, 2022 10:17 am

As a reminder for the future, here are the instructions to build it:

1. git clone https://github.com/harbour/core harbour

2. Install these packages:
sudo apt install libssl-dev
sudo apt install libcurl4-openssl-dev

3. before building Harbour use this export from the terminal:
export HB_USER_CFLAGS=-fPIC

4. run make in harbour folder and Harbour will get built

5. To build librddads.a we need ace.h that we can get from here (installing the ADS SDK):
https://github.com/FiveTechSoft/harbour_and_xharbour_builds/blob/master/aceapi_x86_64.exe

6. copy ace.h from above step into harbour/contrib/rddads

7. Manually compile each C file this way:
gcc -c -fPIC -I../../include ads1.c
gcc -c -fPIC -I../../include adsfunc.c
gcc -c -fPIC -I../../include adsmgmnt.c
gcc -c -fPIC -I../../include adsx.c

8. to build the librddads.a for Linux do this:
ar rc ./librddads.a ads1.o adsx.o adsfunc.o adsmgmnt.o

9. copy librddads.a to harbour/lib/linux/gcc

10. In mod_harbour/linux add this lib name to libs.txt:
-lrddads

11. In mod_harbour apache.prg modify this to force the use of ADS:
#define HB_WITH_ADS // new !!!
#ifdef HB_WITH_ADS
#define __HBEXTERN__RDDADS__REQUEST
#include "../../harbour/contrib/rddads/rddads.hbx"
#endif

12. build mod_harbour running ./go.sh from mod_harbour/linux folder
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: mod_harbour + ADS on linux server

Postby berpa » Thu Dec 01, 2022 10:35 am

Thank you for the instruction on how to compile mod_harbour with ADS.

I've tried the file you sent me but I'm sorry to say that it does not work.
The browser receives no response from the server and in apache error.log there is the error:
/usr/sbin/apache2: symbol lookup error: /tmp/libharbour.-318593280.-1236078313: undefined symbol: AdsSetDateFormat

I hope that this could help you.

If you think that is better I will give you my next feedback by email.
berpa
 
Posts: 16
Joined: Tue Nov 29, 2022 2:23 pm

Re: mod_harbour + ADS on linux server

Postby Antonio Linares » Thu Dec 01, 2022 10:53 am

Dear Paolo,

Do you have libace.so and libadsloc.so in the same folder where libharbour.so.3.2.0 is placed ?

Yes, you can write me to alinares@fivetechsoft.com or we continue here, as you prefer :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 6 guests