Forum

CGI binary executable

BarryK
31 July 2009, 19:06


Hiawatha version: 6.15
Operating System: Puppy Linux

Hi, I'm one of the developers of Puppy Linux. Puppy has Hiawatha as the default web server. One of its uses is to run the PPLOG personal blog, which is a Perl script.

We have another package, Quisp, which is a database system. It has a cgi which is a binary executable, named 'quisp' and we have previously used this with the 'nullhttpd' web server.

However, I want to get Quisp going with Hiawatha, but there is a problem. I havn't got a clue how to get a binary executable to be recognised and run by Hiawatha.

Even if I was to rename 'quisp' to say 'quisp.bin' then tell Hiawatha:

CGIextension = bin

What do I put into this variable?

CGIhandler =

It would be very good if Hiawatha could be made to recognise a directory, say 'cgi-bin' and then allow any files in it to run.

Your response eagerly awaited!

Regards,
Barry Kauler
puppylinux.com/blog
Prit
31 July 2009, 19:18
Hi Barry,

On this forum post, someone asks something similar. See Hugo's response:
http://www.hiawatha-webserver.org/forum/topic/166

Hugo Leisink
31 July 2009, 19:20
There are two kinds of CGI programs: binaries and scripts. Binaries are normal executables which can be run directly. The CGIextension is used to specify the extension of the CGI binaries. CGI scripts cannot be run directly. They need an interpreter. Perl, PHP and Pythons are such interpreters. Hiawatha runs the interpreter with the script as a parameter. The CGIhandler is used to specify which extension needs which interpreter. For example: CGIhandler: /usr/bin/php-cgi:php tells Hiawatha to handle every request to a .php script by executing /usr/bin/php-cgi with the requested script as a parameter.

You said Quisp has a binary CGI program, so you need to use CGIextension and give the CGI binary an extension. If renaming the binary is a problem (because the binary generates links to itself without the extension), you can use the NoExtension setting or write a UrlToolkit rule to rewrite the URL without the extension to an URL with the extension. The NoExtension setting is described in the manual page, for the UrlToolkit there is even a HOWTO page.

Hiawatha can have a cgi-bin directory. Just use the Directory setting to allow CGI execution in the cgi-bin directory (see manual page).

Most of the things I mentioned are described in the manual pages and HOWTO pages on this website. If you still have any question, just let me know.
BarryK
1 August 2009, 07:56
Thanks very much for the reply, it works!
I used the method of renaming the 'quisp' executable to 'quisp.bin'.

My blog posts on QUISP and Hiawatha:

http://puppylinux.com/blog/?viewDetailed=00935
http://puppylinux.com/blog/?viewDetailed=00936

Regards,
Barry Kauler
This topic has been closed.