Page 1 of 1

Running VL Web in an Apache Virtual Host on IBM i

Posted: Sat Jun 04, 2016 7:51 am
by caseywhite
I tried to run VL Web within an Apache config that uses virtual hosts to distinguish between development and production. It looks like the the following statement will only allow one instance of vlweb_module to run, which would be the first one it encounters. You can list the LoadModule twice but it only loads the first one it encounters in the config file.

LoadModule vlweb_module /QSYS.LIB/XXXCOMLIB.LIB/MOD_VLWEB.SRVPGM
LoadModule vlweb_module /QSYS.LIB/YYYCOMLIB.LIB/MOD_VLWEB.SRVPGM

Is there a way to use VL Web in an apache config that uses virtual hosts.

Re: Running VL Web in an Apache Virtual Host on IBM i

Posted: Tue Jun 07, 2016 11:04 am
by kelvinlee
It is a limitation that Apache web server cannot load an Apache module for more than once.
However, MOD_VLWEB is designed to support serving VLWeb contents from multiple LANSA systems but the configuration is manual for now.
The configuration for MOD_VLWEB is inside MOD_VLWEB.DTAARA from the same library of the loaded MOD_VLWEB.SRVPGM.
The data area contains 6 blocks of 296 bytes for supporting maxium six LANSA systems.
The first 10 bytes of each block contains the program library of a LANSA system.
So for a default installation, only the first 10 bytes of the data area is set to the program library in use.
To add a second system, use command like: CHGDTAARA DTAARA(XXXCOMLIB/MOD_VLWEB (297 10)) VALUE('YYYPGMLIB')
Assuming the loaded Apache module is XXXCOMLIB/MOD_VLWEB and XXXPGMLIB is already set as the first system.
In case a third system is needed, the position would be 593 (296*2+1) instead and so on.
You need to restart the Apache web server after the changes.
You can check the job log of the Apache job (looks for job with function PGM-QZSRHTTP) to check if configuration is loaded correctly.
Of course, for Server Module to work, additional CGI configuration for the second system is also required.
Basically, httpd.conf needs these lines:

LoadModule vlweb_module /QSYS.LIB/XXXCOMLIB.LIB/MOD_VLWEB.SRVPGM
ScriptAliasMatch ^/xxxcomlib/lansaweb(.*) /qsys.lib/xxxpgmlib.lib/lansaweb.pgm$1
ScriptAliasMatch ^/yyycomlib/lansaweb(.*) /qsys.lib/yyypgmlib.lib/lansaweb.pgm$1

Re: Running VL Web in an Apache Virtual Host on IBM i

Posted: Wed Jun 08, 2016 6:07 am
by caseywhite
Thanks. Modifying the data area and restarting the web server has resolved the issue.