Harbour CGI

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

Harbour CGI

Postby Otto » Tue Sep 20, 2022 6:58 am

Dear Antonio,
Code: Select all  Expand view


Simply copy modharbour.exe and libcurl-x64.dll from here to the cgi-bin folder of your Apache:
https://github.com/FiveTechSoft/mod_harbour/blob/master/cgi/windows/modharbour.exe
https://github.com/FiveTechSoft/mod_harbour/blob/master/cgi/windows/libcurl-x64.dll

Now copy a simple test.prg to the same folder:
https://github.com/FiveTechSoft/mod_harbour/blob/master/cgi/windows/test.prg

And run:
your_domain_name/cgi-bin/modharbour.exe?test.prg

 




Can you please tell me how to make the settings in Apache so that the whole htdocs folder works with CGI?

Is it possible to run mod harbour and CGI in parallel?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Harbour CGI

Postby Otto » Tue Sep 20, 2022 7:21 am

Dear Antonio,
If I copy one of my prg projects to cgi-bin and run the prg file I get the following error.
Can you please help me. What do I miss?

file:///C:/mppcgi-bin%07ssetscssheme.css

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Harbour CGI

Postby Antonio Linares » Tue Sep 20, 2022 9:57 am

Dear Otto,

what does the PRG ?
regards, saludos

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

Re: Harbour CGI

Postby Otto » Tue Sep 20, 2022 12:06 pm

Dear Antonio,
here it is running from mod harbour:

https://winhotel.org/submarine_yellow/index.prg

And here I try with CGI.
I copied the whole folder submarine_yellow to cgi-bin.

https://winhotel.org/cgi-bin/modharbour.exe?index.prg

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Harbour CGI

Postby Antonio Linares » Tue Sep 20, 2022 2:15 pm

Dear Otto,

In the first example you have:
<link rel="stylesheet" href="assets/css/theme.css">

and in the second one you have:
<link rel="stylesheet" href="https://winhotel.org/submarine_yellow/assets/css/theme.css.map">

I think thats where the difference is coming from
regards, saludos

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

Re: Harbour CGI

Postby Otto » Tue Sep 20, 2022 3:12 pm

Dear Antonio,
Thank you.
I read today, that css is not allowed inside cgi-bin folder.

I think it is better I start with a tiny sample.
What is the right way to link in js and css?

Best regards,
Otto

https://winhotel.org/cgi-bin/modharbour ... /index.prg

Here I get:

T https://winhotel.org/cgi-bin/assets/css ... ter-v2.css net::ERR_ABORTED 404 (Not Found)
modharbour.exe:35
GET https://winhotel.org/cgi-bin/assets/js/jquery.min.js net::ERR_ABORTED 404 (Not Found)
modharbour.exe:10
GET https://winhotel.org/cgi-bin/assets/css/styles.css net::ERR_ABORTED 404 (Not Found)
modharbour.exe:36
GET https://winhotel.org/cgi-bin/assets/boo ... rap.min.js net::ERR_ABORTED 404 (Not Found)
modharbour.exe:8
GET https://winhotel.org/cgi-bin/assets/boo ... ap.min.css net::ERR_ABORTED 404 (Not Found)
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Harbour CGI

Postby Otto » Tue Sep 20, 2022 3:19 pm

Dear Antonio,

If I place the files js and css inside htdocs and prg into cgi-bin it works fine.
Best regards,
Otto

Code: Select all  Expand view
<link rel="stylesheet" href="https://mydomain.com/mh_newsletter/assets/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://mydomain.com/mh_newsletter/assets/css/Newsletter-v2.css">
  <link rel="stylesheet" href="https://mydomain.com/mh_newsletter/assets/css/styles.css">
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Harbour CGI

Postby Otto » Tue Sep 20, 2022 4:03 pm

Dear Antonio,
Can you please help me again?
How do you have to pass the parameters? (example /index.prg?edit=edit)

https://mydomain.org/cgi-bin/modharbour ... /index.prg

https://mydomain.org/cgi-bin/modharbour ... ?edit=edit

Best regards,
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Harbour CGI

Postby Otto » Thu Sep 22, 2022 5:25 pm

Dear Antonio,
Thank you. You were right. I had a very old modharbour.exe.
I have now downloaded the update and everything worked right away.
I downloaded the new modharbour.exe from here:
https://github.com/FiveTechSoft/mod_har ... arbour.exe
and copied it into my cgi-bin folder.
I changed this rule in my c:\xampp\apache\conf\httpd.conf and restarted the server:

<directory C:/xampp/htdocs>
RewriteEngine a
RewriteRule ^([a-zA-Z]*)$ /cgi-bin/modharbour.exe?prg=$1 [NC,QSA]
</directory>

It is explained here:
https://github.com/FiveTechSoft/mod_har ... master/cgi

I haven't done extensive testing yet, but it seems much more performant to me.

Thanks a lot.

Best regards,
Otto



Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Harbour CGI

Postby Antonio Linares » Fri Sep 23, 2022 3:49 am

Dear Otto,

thank you for testing it. It works real fine, super stable and finally we are just using a Harbour EXE again ;-)

Easier to build, to understand and to maintain :-)

Sometimes we have to accept that things can be done in a better way... for me it was a frustration at the first time, then I accepted that it is the way :-)
Simplicity always win. Now we have a modharbour rock solid !!!
regards, saludos

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

Re: Harbour CGI

Postby Antonio Linares » Fri Sep 23, 2022 4:41 am

It took almost three years to discover it, but thanks God, that light came in and the way was revealed...

modharbour CGI or simply Harbour CGI is the best after the bread and butter. Now you can come and blame me: "Antonio you fooled us for several years" and you are right. I have changed my ideas many times, trying to get things done in a simpler and easier way.

But thats how research and development works. Life too I would say. You have to accept the facts and the learnings...
regards, saludos

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

Re: Harbour CGI

Postby Enrico Maria Giordano » Fri Sep 23, 2022 10:36 am

Antonio Linares wrote:Dear Otto,

thank you for testing it. It works real fine, super stable and finally we are just using a Harbour EXE again ;-)

Easier to build, to understand and to maintain :-)

Sometimes we have to accept that things can be done in a better way... for me it was a frustration at the first time, then I accepted that it is the way :-)
Simplicity always win. Now we have a modharbour rock solid !!!


I like it! It is a pity that commercial web space providers don't allow CGI EXE to run anymore. :-(

Anyway, it is great for dedicated web servers!
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Harbour CGI

Postby Enrico Maria Giordano » Fri Sep 23, 2022 10:40 am

A question: in what mod_harbour CGI differs from the normal Harbour CGI (that I've used for years)? What are the advantages?
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Harbour CGI

Postby Antonio Linares » Fri Sep 23, 2022 12:28 pm

Dear Enrico,

We first invented mod_harbour, then we turned it into a CGI exe, keeping the functionality (commands, defines, etc) and functions, classes, etc that we originally developed for the mod_harbour.

I don't know how is your Harbour CGI, so I can't compare them

Here you have all the source code for mod_harbour cgi:
https://github.com/FiveTechSoft/mod_harbour/tree/master/cgi
regards, saludos

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

Re: Harbour CGI

Postby Enrico Maria Giordano » Fri Sep 23, 2022 12:46 pm

Antonio Linares wrote:Dear Enrico,

We first invented mod_harbour, then we turned it into a CGI exe, keeping the functionality (commands, defines, etc) and functions, classes, etc that we originally developed for the mod_harbour.

I don't know how is your Harbour CGI, so I can't compare them


I haven't MY harbour CGI. It is just an Harbour (or xHarbour) console app like this:

Code: Select all  Expand view
#include "Simpleio.ch"


FUNCTION MAIN()

    ?? [Content-type: text/html]
    ?
    ? [<HTML>]
    ? [<HEAD>]
    ? [<BODY>]
    ? [Param = ] + GETVAR( "Param" )
    ? [</BODY>]
    ? [</HTML>]

    RETURN NIL
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Next

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 7 guests