Page 1 of 2

Harbour CGI

PostPosted: Tue Sep 20, 2022 6:58 am
by Otto
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

Re: Harbour CGI

PostPosted: Tue Sep 20, 2022 7:21 am
by Otto
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

Re: Harbour CGI

PostPosted: Tue Sep 20, 2022 9:57 am
by Antonio Linares
Dear Otto,

what does the PRG ?

Re: Harbour CGI

PostPosted: Tue Sep 20, 2022 12:06 pm
by Otto
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

Re: Harbour CGI

PostPosted: Tue Sep 20, 2022 2:15 pm
by Antonio Linares
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

Re: Harbour CGI

PostPosted: Tue Sep 20, 2022 3:12 pm
by Otto
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)

Re: Harbour CGI

PostPosted: Tue Sep 20, 2022 3:19 pm
by Otto
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">

Re: Harbour CGI

PostPosted: Tue Sep 20, 2022 4:03 pm
by Otto
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

Re: Harbour CGI

PostPosted: Thu Sep 22, 2022 5:25 pm
by Otto
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

Re: Harbour CGI

PostPosted: Fri Sep 23, 2022 3:49 am
by Antonio Linares
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 !!!

Re: Harbour CGI

PostPosted: Fri Sep 23, 2022 4:41 am
by Antonio Linares
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...

Re: Harbour CGI

PostPosted: Fri Sep 23, 2022 10:36 am
by Enrico Maria Giordano
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!

Re: Harbour CGI

PostPosted: Fri Sep 23, 2022 10:40 am
by Enrico Maria Giordano
A question: in what mod_harbour CGI differs from the normal Harbour CGI (that I've used for years)? What are the advantages?

Re: Harbour CGI

PostPosted: Fri Sep 23, 2022 12:28 pm
by Antonio Linares
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

Re: Harbour CGI

PostPosted: Fri Sep 23, 2022 12:46 pm
by Enrico Maria Giordano
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