Start the *ADMIN instance to use the IBM Web Administration for IBM i to configure your server.
You will then need to create a Web Server alias for this library. By default, LANSA Web assigns the alias as AUTHLIB. Once the AUTHLIB alias is set up, you will then configure your LANSA Communications library, DCXCOMLIB, to require user authentication. This means that the CGI-BIN library does not require user authentication, but when processes require authentication, the request is always redirected to the AUTHLIB URL path for identification.
Create the Web Server alias for authentication.
Using the Web Administration for IBM i, expand the Server Properties menu tree.
LANSAWEB CGI program to ^/authlib/lansaweb(.*)./QSYS.LIB/DCXCOMLIB.LIB/lansaWEB.PGM$1./QSYS.LIB/DCXCOMLIB.LIB/lansaXML.PGM$1.ScriptAliasMatch ^/authlib/lansaweb(.*) /QSYS.LIB/DCXCOMLIB.LIB/lansaWEB.PGM$1 ScriptAliasMatch ^/authlib/lansaxml(.*) /QSYS.LIB/DCXCOMLIB.LIB/lansaXML.PGM$1Define the location path for authentication.
Define the scope of protection and set the security.
<Location /authlib> PasswdFile QGPL/USERLIST AuthType Basic AuthName "My Auth Realm" Require valid-user </Location>Following is a sample IBM HTTP Server Instance configured for standard authentication running under V5R3 or later.
This Instance will run on Port 80.
The CGI library is DCXCOMLIB.
The Authenticated library is DCXCOMLIB.
The Validation List it uses is USERLIST in QGPL.
Once a LANSA Web Process is configured for Process Authentication using the Web Administrator, the following IBM HTTP Server Configuration will prompt the User for User ID and Password. This is validated against the USERLIST Validation List in QGPL.
# LANSA Web Apache HTTP Configuration File Alias /images /lansaIMG/ ScriptAliasMatch ^/cgi-bin/jsmdirect(.*) /QSYS.LIB/JSMLIB.LIB/JSMDIRECT.PGM$1 ScriptAliasMatch ^/cgi-bin/lansaweb(.*) /QSYS.LIB/DCXCOMLIB.LIB/lansaWEB.PGM$1 ScriptAliasMatch ^/cgi-bin/lansaxml(.*) /QSYS.LIB/DCXCOMLIB.LIB/lansaXML.PGM$1 ScriptAliasMatch ^/authlib/lansaweb(.*) /QSYS.LIB/DCXCOMLIB.LIB/lansaWEB.PGM$1 ScriptAliasMatch ^/authlib/lansaxml(.*) /QSYS.LIB/DCXCOMLIB.LIB/lansaXML.PGM$1 Listen *:80 DocumentRoot /www/dcxpgmlib/htdocs # DirectoryIndex /index.html ServerRoot /www/dcxpgmlib Options -ExecCGI -FollowSymLinks -SymLinksIfOwnerMatch -Includes -IncludesNoExec -Indexes -MultiViews DefaultFsCCSID 37 DefaultNetCCSID 819 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%{Cookie}n \"%r\" %t" cookie LogFormat "%{User-agent}i" agent LogFormat "%{Referer}i -> %U" referer LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog logs/access_log combined SetEnvIf "User-Agent" "Mozilla/2" nokeepalive SetEnvIf "User-Agent" "JDK/1\.0" force-response-1.0 SetEnvIf "User-Agent" "Java/1\.0" force-response-1.0 SetEnvIf "User-Agent" "RealPlayer 4\.0" force-response-1.0 SetEnvIf "User-Agent" "MSIE 4\.0b2;" nokeepalive SetEnvIf "User-Agent" "MSIE 4\.0b2;" force-response-1.0 SetEnvIf "User-Agent" ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 ServerUserID DCXPGMLIB <Directory /> Order Deny,Allow Deny From all </Directory> <Directory /QSYS.LIB/JSMLIB.LIB> Order Allow,Deny Allow From all </Directory> <Directory /QSYS.LIB/DCXCOMLIB.LIB> Order Allow,Deny Allow From all </Directory> <Directory /lansaIMG> Order Allow,Deny Allow From all </Directory> <Directory /www/dcxpgmlib/htdocs> Order Allow,Deny Allow From all </Directory> <Location /authlib> PasswdFile QGPL/USERLIST AuthType Basic AuthName "My Auth Realm" Require valid-user </Location>
You must enable the GET and POST methods.
Please be sure to review, on the LANSA Web site, www.LANSA.com/support, the Important Notes for IBM HTTP Server Configuration in the Example IBM HTTP Server Configuration in Configuration of IBM HTTP Server using CGI.
Go to Step 3. Execute Administrator to Define Process Authentication.