Net Print/400 - Configuring CGI Environments
Once the product is installed, the service programs, and other objects, can be moved into a library that you have set up on your system for other CGI programs. This will enable you to conveniently use the CGI library/directory that you have already set up on your server, keeping all of your CGI's in one place rather than having multiple libraries, and multiple CGI directories. If you solely move the NETPRTIB program out of the product library, you must add the product library (NETPRTINET) to your server's library list. Other configuration elements specific to each type of server must also be put in place to enable the execution of the Net.Data macros and NETPRTIB CGI program. These may include, but are not necessarily limited to, alias, script library, additional document directory, map, and exec directives. Please refer to the corresponding server documentation for assistance in making these modifications.
Note: If you should choose to move the product from the product library to your CGI library, refer to Table 4.1 for the programs and service programs you will need to move. In addition, the installation of product PTFs will not effect these moved objects. As a result, you may need to duplicate them again after a PTF is processed.
Table 4.1 Programs and Service Programs.
|
Programs |
Service Programs |
NETPRTSP
|
NPWBASESRV
|
NETPRTIB
|
NPWBIOSRV
|
|
NPWBTSRV
|
When executing the NETPRTIB CGI program directly, the URL that is constructed for the call must be appropriate to the configuration of the web server being used to serve the CGI results, i.e. the location of the NETPRTIB program, as well as port number and other path variables.
Configuration elements must be added to each type of server to enable the server to serve CGI and to help point the browser request to the correct server location. This allows the server to execute the NETPRTIB program and run the Netprtsp.d2w Net.Data macro.
You must install the current PTFs for Net.Data to ensure that Net Print/400 will work properly. For more information on Net.Data PTFs see IBM's website at:
http://www.as400.ibm.com/netdata
Note: If using Net.Data macros with Commerce Server/400 or Web Server/400, it is important to first install the special IBM CGI enablement PTF
WWW130021, or a previous PTF depending on your OS/400 version, and closely follow the included instructions to move programs and modify server configurations for the execution of Net.Data macros. For instructions on downloading and installing PTF's, visit the I/NET website at:
http://www.inetmi.com/iseries/support
For all servers you must do 1 of 2 options.
Option 1. Running CGI from the product library (NETPRTINET)
a.) You must copy the DB2WWW program into the product library from the QTCP library.
b.) If you are using Web Server/400 or Commerce Server/400, you must copy either WWWADOPT or WWWADOPT2, depending on which version of OS/400 you are running, into the product library.
c.) You must enable the product library as a CGI/Script library.
Option 2. Using an existing CGI/Script library.
You must copy the NETPRTIB program from the product library to the CGI library. If you are not copying the service programs, then the product library must be included in the server's library list.
If not already done, you must copy the DB2WWW program into the CGI library from the QTCP library.
If you are using Web Server/400 or Commerce Server/400 and this has not already been done, you must copy either WWWADOPT or WWWADOPT2, depending on which version of OS/400 you are running, into the CGI library.
In the following basic setup instructions, references to "netprtinet.lib" should be replaced with your CGI library (in yourcgilib.lib format).
Setting up Commerce Server/400 or Web Server/400 to work with Net Print/400
Web Server/400 PTF WWW130021, or a previous PTF depending on your OS/400 release, must be installed to execute the Net.Data sample macro. For instructions visit the website at the following URL:
http://www.inetmi.com/iseries/support
Within the Work with WWW Aliases (WRKWWWALS) command:
- Add 1st alias entry: ALIAS = /net.data/netprint/ VALUE = /netprtinet.lib/wwwadopt[2]/db2www.pgm/[path of Netprtsp.d2w]/netprtsp.d2w/ SRCTYPE = *QSYS.
- Add 2nd alias entry: ALIAS = /cgi-bin/netprint/ VALUE = /netprtinet.lib/ SRCTYPE = *QSYS.
Other configuration requirements:
- Script Library: Make sure the server is configured to allow for running scripts. Also, NETPRTINET should be added to the list of script libraries if using the default. Read the information regarding this at
this link.
- The product library (NETPRTINET) must be included in the library list for the server jobs.
The Program URL statement in the net.data macro should read:
ProgramURL="/cgi-bin/netprint/netprtib.pgm".
With the settings above, to begin the Net Print/400 session, the URL at the browser should read:
http://your.host.com:port number/net.data/netprint/basic
Setting up Netscape Enterprise Server to work with Net Print/400
Within the `Programs | CGI Directory' configuration section of your server instance:
- Add 1st entry: PREFIX = /net.data/netprint CGI Directory = /qsys.lib/netprtinet.lib/db2www.pgm/[path of Netprtsp.d2w]/netprtsp.d2w
You will get a warning message, click OK.
- Add 2nd entry: PREFIX = /cgi-bin/netprint CGI Directory = /qsys.lib/netprtinet.lib
The Program URL statement in the net.data macro should read: ProgramURL="/cgi-bin/netprint/netprtib.pgm".
With the settings above, to begin the Net Print/400 session, the URL at the browser should read:
http://your.host.com:port number/net.data/netprint/basic
Setting up the IBM HTTP Server to work with Net Print/400
Within the server instance configuration, using the Work with HTTP Configuration (WRKHTTPCFG) command:
- Add MAP configuration entry: /net.data/netprint/* /NETPRTINET/db2www.pgm/[path of Netprtsp.d2w]/netprtsp.d2w/*
- Add EXEC configuration entry: /NETPRTINET/* /qsys.lib/netprtinet.lib/*
- Add a 2nd EXEC configuration entry: /cgi-bin/netprint/* /qsys.lib/netprtinet.lib/*
Note: These entries should be placed before any generic "cgi-bin" entries that may already exist in the configuration.
The Program URL statement in the net.data macro should read: ProgramURL="/cgi-bin/netprint/netprtib.pgm".
With the settings above, to begin the Net Print/400 session, the URL at the browser should read:
http://your.host.com:port number/net.data/netprint/basic
Advanced setup concepts
As a reminder, you should make sure that the appropriate configuration elements are completed and other setup topics are covered to insure proper execution of the Net Print/400 product in your advanced CGI environment. A few items to check before continuing include:
- Duplicate programs, service programs, and other objects into a library that you have set up for other CGI programs.
- If the NETPRTIB program is used from a CGI library (not the product library) and the product service programs are are not also duplicated in the CGI library, the product library must be added to the server's library list.
- Duplicate the Net.Data macro in a directory that you have set up for other macros.
- Set up the appropriate alias, CGI Directory, map, and exec entries within the server's configuration.
- Make sure that the server has authority to run all service programs and cgi programs.
- Construct a URL that is appropriate for your configuration.
- If running within Web Server/400 or Commerce Server/400, the WWWADOPT[2] program is used to work with the Net.Data macro. It is important to note that the NETPRTIB program itself is called directly through the server's CGI functionality (outside of the WWWADOPT[2] environment).
Copyright © I/NET
All rights reserved.