The iSeries™ server stores some CGI programs in QSYS.LIB. You can write the programs in C++, REXX, ILE C, ILE RPG, or ILE COBOL. If the UserID directive is not active, the server profile QTMHHTP1 needs access to the *PGM object and all objects the program accesses. If the UserID directive is active, the UserID profile needs access to the *PGM object and all objects the program accesses. The ScriptAlias directive is required in HTTP Server (powered by Apache) configuration to run a CGI program on the server.
Here is a summary of the steps you need to take to enable your server to run CGI programs:
http://hostname/sample
EXEC /REXX/* /QSYS.LIB/AS400CGI.LIB/QREXSRC.FILE/*
Or in HTTP Server (powered by Apache):
ScriptAlias /REXX /QSYS.LIB/AS400CGI.LIB/QREXSRC.FILE/*
The URL is :
http://hostname/REXX/samplecgi.REXX