If you want to quickly set up an Apache HTTP server that has been pre-configured
for the purpose of demonstration then there is a script that you can download which
will create a pre-configured Apache server for you.
The setup script is available at Quick Start Script
This is a REXX script which you must copy into a regular source member. Just as
CLP source is usually stored in QCLSRC, REXX source is usually stored in QREXSRC
but any source file will suffice. Create a source member named CRTHTTPSVR and
insert the source from the link above. Ensure that the source type for the member
is REXX.
Before you can run the CRTHTTPSVR script you must first decide what you wish
the HTTP server to be named. You must then create a library with that name.
For example, if the HTTP server is to be named MYDEMO then you must first create
a library named MYDEMO e.g. CRTLIB(MYDEMO).
Now you are ready to run the script.
Let us assume that you have placed the REXX source code for CRTHTTPSVR in source
member CRTHTTPSVR of source file QGPL/QREXSRC.
The script can be executed as follows -
STRREXPRC SRCMBR(CRTHTTPSVR) SRCFILE(PETER/QREXSRC) PARM(MYDEMO)
The script will issue some diagnostics as it runs. It should complete in a few
seconds. Successful completion should result in the following -
An Apache HTTP server configuration in folder /www/mydemo
A Net.data source folder named /www/home/mydemo/macros
The IBM Net.data program DB2WWW residing in library MYDEMO
A Net.data INI file named INI in library MYDEMO
An HTTP server instance member MYDEMO in file QUSRSYS/QATMHINSTC
An html welcome page named /www/mydemo/htdocs/index.html
A Net.data Hello World page named /home/mydemo/macros/hello
Now the HTTP server can be started using the command -
STRTCPSVR SERVER(*HTTP) HTTPSVR(MYDEMO)
NOTE: The HTTP server MYDEMO has been configured to listen on port 2008.
Now you can test the server. Your host name should be the name of your
iSeries or its' IP address.
First request the welcome page from a browser using the url -
http://yourhost:2008
The response should be a one line page
Hello World from MYDEMO
Then request the Net.data Hello World page using the url -
http://yourhost/cgi/hello/macro
The response should be a one line page