4.1.3 JSMDirect Set up on IBM i
The Apache server can be configured to run CGI programs in %%BINARY/MIXED%%, %%BINARY/BINARY%% or BINARY mode.
The preferred mode is BINARY.
By default, the JSMDirect CGI program runs under the user profile QTMHHTP1.
Following is an example IBM Apache Server Configuration:
# Apache Configuration - JSM Services
Options None
Listen 10.2.0.170:1099
ServerRoot /www/jsmapache
DocumentRoot /www/jsmapache/htdocs
# DefaultFsCCSID 37
# DefaultNetCCSID 819
# ServerUserID USERPROFILE
#
LogLevel Warn
LogCycle Daily
ErrorLog logs/error_log
CustomLog logs/access_log combined
LogFormat "%{User-agent}i" agent
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{Cookie}n \"%r\" %t" cookie
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" 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
#
# StartCGI 1
# SendBufferSize 32768
# ReceiveBufferSize 32768
#
# Use name-based virtual hosting
NameVirtualHost 10.2.0.170
#
<VirtualHost 10.2.0.170>
# The first virtual host directive will become the default host
# This traps the use of the IP address, unsupported or no host name
# It also has no authority to access the document root directory
Options None
ServerName 10.2.0.170
DocumentRoot /www/jsmapache/htdocs
</VirtualHost>
#
<VirtualHost 10.2.0.170>
Options None
ServerName LANSA01
ServerAlias LANSA01.LANSA.COM.AU
DocumentRoot /www/jsmapache/htdocs-site1
CGIConvMode BINARY
ScriptAliasMatch ^/cgi-bin/jsmproxy(.*) /qsys.lib/devjsm.lib/jsmproxy.pgm$1
ScriptAliasMatch ^/cgi-bin/jsmdirect(.*) /qsys.lib/devjsm.lib/jsmdirect.pgm$1
TimeOut 3000
#
<Directory /www/jsmapache/htdocs-site1>
Options None
Order Allow,Deny
Allow from all
AllowOverride None
</Directory>
#
<Directory /qsys.lib/devjsm.lib>
Options None
Order Allow,Deny
Allow from all
AllowOverride None
# Require valid-user
# AuthType Basic
# AuthName "Restricted Service"
# UserID QTMHHTP1
# PasswdFile %%SYSTEM%%
</Directory>
</VirtualHost>
#
<VirtualHost 10.2.0.170>
Options None
ServerName STUDIOADMIN
DocumentRoot /www/jsmapache/htdocs-site2
CGIConvMode BINARY
ScriptAliasMatch ^/cgi-bin/jsmadmin(.*) /qsys.lib/devjsm.lib/jsmadmin.pgm$1
#
<Directory /www/jsmapache/htdocs-site2>
Options None
Order Allow,Deny
Allow from all
AllowOverride None
</Directory>
#
<Directory /qsys.lib/devjsm.lib>
Options None
Order Allow,Deny
Allow from 10.2.1.46
Allow from 10.2.1.47
Allow from 10.2.1.48
AllowOverride None
</Directory>
</VirtualHost>
#
<VirtualHost 10.2.0.170>
Options +Includes
ServerName LANSA01WEB
DocumentRoot /LANSA_xyzpgmlib/webserver/www/htdocs
ServerUserID XYZPGMLIB
CGIConvMode EBCDIC
Alias /images /LANSA_xyzpgmlib/webserver/images
ScriptAliasMatch ^/cgi-bin/lansaweb(.*) /qsys.lib/xyzcomlib.lib/lansaweb.pgm$1
TimeOut 3000
#
<Directory /qsys.lib/xyzcomlib.lib>
Order Allow,Deny
Allow from all
</Directory>
#
<Directory /LANSA_xyzpgmlib/webserver/images>
Order Allow,Deny
Allow from all
</Directory>
#
<Directory /LANSA_xyzpgmlib/webserver/www/htdocs>
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
#
# Global server directives
#
<Directory />
Options None
Order Allow,Deny
Deny from all
AllowOverride None
</Directory>
#
<Directory /www/jsmapache/htdocs>
Options None
Order Allow,Deny
Deny from all
AllowOverride None
</Directory>