Forum

CGI

ceroklis
11 April 2007, 08:16
Hello,

How can I configure Hiawatha so that it interprets every file below a certain directory as CGI scripts ?

More specifically I have standalone CGI executables without extension in /usr/lib/cgi-bin
and I cannot add extensions just to please Hiawatha. Any way out ?

Thanks for your reply
Hugo Leisink
11 April 2007, 12:09
No, Hiawatha uses the extension to determine if a file is a CGI or not.

Maybe you can make the thing work with the ErrorHandler option. Create the directory you want to use as your 'interprets-every-file-below-a-certain-directory-as-CGI-scripts' directory. Place a .hiawatha file in it with the ErrorHandler option in it:
ErrorHandler = /errorhandler.cgi, 200


This errorhandler.cgi is a shellscript which will execute the right CGI based on the URL. Be sure to only handle 404 (File Not Found) errors. This errorcode can be found in the environment variable 'HTTP_GENERATED_ERROR'. This should do the trick.
This topic has been closed.