FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour Installation of mod_harbour as module or fastcgi handler
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Fri May 28, 2021 10:46 AM

Yes, when you need the fastest speed fastCGI + mod_harbour is the way to go :-)

many thanks for your great feedback!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Fri May 28, 2021 12:11 PM

Dar Antonio,
Please be so kind as to explain the difference between the individual versions and where I can find the installation instructions.
Does fastcgi no longer need Apache? Can you use prgs?
Best regards,
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Fri May 28, 2021 05:04 PM
Dear Otto,

There is mod_harbour "standard" and the mod_harbour "fastCGI" versions. Both work with Apache and Microsoft IIS.

Each one has its pros and its cons:

* mod_harbour "fastCGI" is very fast but it uses only ONE virtual machine for ALL requests. It is built using "multi-threading"
so it can attend lots of customers but they ALL share the workareas, the public variables, the global symbol table, etc. This
can be very "weak" for security reasons and messy to be properly coded:

http://harbourlanguage.blogspot.com/2010/04/harbour-multi-thread.html

* mod_harbour "standard" uses ONE virtual machine for EACH request. You use Harbour standard code without having to worry
about the "multi-threading" difficulties. So you never share a virtual machine with anybody. libharbour.dll is copied
on each request. The penalty for this is around 100 ms but its design is very safe.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Sun May 30, 2021 07:14 AM

Hi Antonio.
Can you better explain what kind of problems can arise with FastCgi ?
We started to use it because with the standard one we had a lot of problems with Apache on the server.
With lot of users (sometimes more than 50) that are using an Ads connection with several tables open
Apache was stopping and the only thing you can do i to restart it. Two times we must reboot the server
because was not responding. With Fastcgi all these kind of problems disappear.
The only thing that is not working with Fastcgi are the ole calls and the connection with Excel that is giving error
with some commands.
Thanks a lot for your great work.
Massimo

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Sun May 30, 2021 08:49 AM
Dear Massimo,

You have nothing to worry about. If it is working fine for you, then its ok :-)

The web is "multi-threading" in the sense that several customers may do a request in the same moment, thus mod_harbour is built using multi-threading mode. You can check it running this: ? hb_mtvm(). You get .T. which means that multi-threading mode of Harbour is enabled.

fastCGI design requires a mod_harbour as an EXE. So this is a multi-threading EXE that will attend to all requests. Harbour coding for multi-threads requires some rules:

* if you need a static variable that it is NOT shared between threads then you have to use "THREAD static name"
* You have to "require" a workarea if it is being used from another thread ( dbRequest() / dbRelease() )
* You can use mutexes to temporarly stop other threads
* if a thread crashes it may block the other threads meanwhile the failing thread does not ends (mod_harbour kills it in 15 secs)

Harbour provides several MT examples to review:
https://github.com/harbour/core/tree/master/tests/mt
Full docs for Harbour multi-threading:
https://github.com/Petewg/harbour-core/wiki/MultiThreading
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Mon May 31, 2021 09:31 AM
Hi Antonio.
I'm making some tests with IIS and i have some problem
This is the content of the folder
Code (fw): Select all Collapse
Directory of c:\ModHarbour

31/05/2021  11:25    <DIR>          .
31/05/2021  11:25    <DIR>          ..
23/06/2015  08:00         1.757.136 ace64.dll
23/06/2015  08:21         2.418.640 adsloc64.dll
23/06/2015  07:44             2.394 adslocal.cfg
23/06/2015  07:57         2.696.656 aicu64.dll
23/06/2015  07:57           256.976 axcws64.dll
31/05/2021  09:46         3.405.824 libcrypto-1_1-x64.dll
31/05/2021  09:46         1.102.968 libcurl-x64.dll
31/05/2021  09:46         6.807.040 libharbour.dll
31/05/2021  09:46           681.472 libssl-1_1-x64.dll
31/05/2021  09:46            49.152 mod_harbour.dll
31/05/2021  11:19    <DIR>          samples


This is the test prg
Code (fw): Select all Collapse
#include "c:\include\ads.ch"

Static Ads_Handle

*************************************************
Function Main()

Setting_db()
IF !Connetti_db(@Ads_Handle,2)
    Return nil
ENDIF

USE UTENTI ALIAS UTENTI SHARED NEW
SET ORDER TO TAG CODICE
Dbgotop()
Seek str(73,4) + str(240,6)
IF Found()
    ? UTENTI->UTENTE
ENDIF

Dbcloseall()
AdsDisconnect(Ads_Handle)
AdsApplicationExit()

Return nil

**************************************************************************
Function Connetti_db(Ads_Handle)
local str_conn:="" , lGo:=.F.

str_conn:="\\DBMASTER:8132\C$\DATABASE\DATABASE.ADD"
IF AdsConnect60(str_conn, 7,"user" , "PassWord",,@Ads_Handle)
    lGo:=.T.
ENDIF
Return lGo

*********************
Function Setting_db()

REQUEST HB_LANG_IT
HB_LANGSELECT("IT")
REQUEST DBFCDX
REQUEST DBFFPT
REQUEST ADS
RddRegister( "ADS", 1 )
RddSetDefault("ADS")
SET SERVER REMOTE
SET FILETYPE TO ADT
SET(_SET_AUTORDER,1)
SET AUTOPEN ON
set(_SET_OPTIMIZE,.T.)
ADSLOCKING(.T.)

SET DATE BRITISH
SET DELETED ON
SET CENTURY ON

Return nil


And this is the error
Code (fw): Select all Collapse
Error: Unknown or unregistered symbol
operation: ADSDISCONNECT
called from: HB_HRBLOAD, line: 0
called from: ..\source\exec.prg, EXECUTE, line: 70
Source:
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Mon May 31, 2021 10:48 AM
Dear Massimo,

Please use this modharbour.exe for IIS with ADS and fastCGI:

https://github.com/FiveTechSoft/mod_harbour/blob/master/fastcgi/windows/IIS/ADS/modharbour.exe
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Wed Jun 02, 2021 08:24 AM

Hi Antonio,
can you give me all the instructions for installing this modharbour version on IIS ?
Thanks
Massimo

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Wed Jun 02, 2021 02:19 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 158
Joined: Tue Oct 11, 2005 03:10 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Sat Jun 19, 2021 03:13 PM

Antonio, Charly pueden indicarme en donde puedo obtener información para trabajar con MODHARBOUR en HOSTGATOR ? Instalarlo en mi dominio.
Ó si me pueden apoyar para trabajar con ese proveedor de hosting?
Saludos y muchas gracias

:?:

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Mon Jun 21, 2021 07:36 AM

Ricardo,

Necesitas tener un servidor dedicado. No puedes instalarlo en uno que sea compartido y no dedicado.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Mon Jun 21, 2021 10:35 AM
Ricardo,

Why not xBhosts.com from FiveTech?


https://mybergland.com/fwforum/xbhosts.mp4

Best regards,
Otto
Posts: 158
Joined: Tue Oct 11, 2005 03:10 PM
Re: Installation of mod_harbour as module or fastcgi handler
Posted: Mon Jun 21, 2021 06:03 PM

Muchisimas gracias Antonio, Otto, veré con mas detenimiento el servicio que Otto me sugiere.
De nuevo muchas gracias.


:D:D:D

Continue the discussion