Running VL Web in an Apache Virtual Host on IBM i

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
caseywhite
Posts: 100
Joined: Thu May 26, 2016 1:17 am

Running VL Web in an Apache Virtual Host on IBM i

Post by caseywhite » Sat Jun 04, 2016 7:51 am

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.

kelvinlee
Posts: 4
Joined: Wed May 25, 2016 5:15 pm

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

Post by kelvinlee » Tue Jun 07, 2016 11:04 am

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

caseywhite
Posts: 100
Joined: Thu May 26, 2016 1:17 am

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

Post by caseywhite » Wed Jun 08, 2016 6:07 am

Thanks. Modifying the data area and restarting the web server has resolved the issue.

Post Reply