|
I have my v5r1 system, original web server, serving basic .htm files.
But CGI is not working. How to config for cgi?
here are the WRKHTTPCFG CONFIG entries:
Welcome index.htm
AlwaysWelcome On
DirAccess Off
PASS /* /web/*
Exec /cgi-bin/* /QSYS.LIB/SRICHTER.LIB/*.PGM %%EBCDIC%%
start the server like so:
STRTCPSVR SERVER(*HTTP) HTTPSVR(default)
the CGI pgm exists in library SRICHTER. *PUBLIC has *ALL authority to
it. *PUBLIC also has *ALL authority to library SRICHTER.
from the browser I can navigate to:
http://192.168.1.160/index2.htm
but I get a 404 - page not found when navigate to:
http://192.168.1.160/http5001.pgm or http://192.168.1.160/http5001
the source of the CGI pgm:
D WPError DS
D EBytesP 1 4B 0 INZ(40)
D EBytesA 5 8B 0
D EMsgID 9 15
D EReserverd 16 16
D EData 17 56
*
D HTTPHeader C CONST('Content-type: text/html')
D NewLine C CONST(X'15')
*
D WrtDta S 1024
D WrtDtaLen S 9B 0
****************************************************************
C EXSR $Main
*
C eval *INLR = *On
****************************************************************
* Main Subroutine
****************************************************************
C $Main BEGSR
*
C eval WrtDta = '<html><head>' +
C '<title>Hello World</title>' +
C '</head><body>' +
C 'Hello World!' +
C '</body></html>' +
C NewLine
C EXSR $WrStout
*
C ENDSR
****************************************************************
* Write to Standard Output
****************************************************************
C $WrStout BEGSR
*
C ' ' CHECKR WrtDta:1024 WrtDtaLen
*
C CALLB 'QtmhWrStout'
C PARM WrtDta
C PARM WrtDtaLen
C PARM WPError
*
C ENDSR
**********************************************************
* Initialization Subroutine
**********************************************************
C *INZSR BEGSR
*
C eval WrtDta = %trim(HTTPHeader) +
C NewLine + NewLine
C EXSR $WrStout
*
C ENDSR
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.