For CGI Programs you can use the SetEnv QIBM_CGI_LIBRARY_LIST keyword within an Apache Virtual Host file. httpd.conf
You can specify the directive at multiple levels. Here are three different examples.
Here is an example of setting the library list from within a Location directive.
Here two entry libraries are defined.
I think this example might be the closest to what you are trying to accomplish.
ScriptAlias /rest /QSYS.LIB/LIB1.LIB
ScriptAlias /test /QSYS.LIB/LIBB.LIB
<Directory /QSYS.LIB/LIB1.LIB>
SetHandler cgi-script
Options +ExecCGI
Order Allow,Deny
Allow From all
</Directory>
<Directory /QSYS.LIB/LIBA.LIB>
SetHandler cgi-script
Options +ExecCGI
Order Allow,Deny
Allow From all
</Directory>
<Location /rest/>
SetEnv QIBM_CGI_LIBRARY_LIST "LIB1;LIB2;LIB3"
</Location>
<Location /test/>
SetEnv QIBM_CGI_LIBRARY_LIST "LIBA;LIB1;LIB2;LIB3"
</Location>
Here is an example of setting the library list from within a Virtual Host.
<VirtualHost *:10088>
ServerName uniqueServerName:10088
ServerAlias uniqueServerName.domain.com
DocumentRoot /www/zendsvr6/htdocs/DEV
<Directory /www/zendsvr6/htdocs/DEV>
Options FollowSymLinks
order allow,deny
allow from all
AllowOverride all
</Directory>
SetEnv QIBM_CGI_LIBRARY_LIST "LIB1;LIB2;LIB3"
...
</VirtualHost>
Here is an example of setting the library list from within a Directory directive.
ScriptAliasMatch ^/rest/(.*) /QSYS.LIB/LIB1.LIB/$1.PGM
ScriptAliasMatch ^/test/(.*) /QSYS.LIB/LIBA.LIB/$1.PGM
<Directory /QSYS.LIB/LIB1.LIB>
SetHandler cgi-script
Options +ExecCGI
Order Allow,Deny
Allow From all
SetEnv QIBM_CGI_LIBRARY_LIST "LIB1;LIB2;LIB3"
</Directory>
<Directory /QSYS.LIB/LIBA.LIB>
SetHandler cgi-script
Options +ExecCGI
Order Allow,Deny
Allow From all
SetEnv QIBM_CGI_LIBRARY_LIST "LIBA;LIB1;LIB2;LIB3"
</Directory>
From what I've found, the web server needs to know which library the initial CGI program is in.
With the last example, that means all usages of "/rest" would always access a program in the LIB1 library.
And all usages of "/test" would always access a program in the LIBA library.
But once the program is active it will have the specified library list.
I have been unable to find a way for the Apache webserver to "search" the specified library list for the CGI program.
Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of p.Caroti
Sent: Tuesday, October 27, 2015 9:10 AM
To: web400@xxxxxxxxxxxx
Subject: [WEB400] How setup different library depending by the Url
Hi all
I would need to setup library list via http httpd.conf file depending the url content; example, if in the url I type
http://myibmi/ :10068/rest/wsage.pgm I would setup a libl like LIB1;LIB2;LIB3, instead if in the url I type
http://myibmi/ :10068/test/wsage.pgm I would setup a libl like LIBA;LIBC;LIB2;LIB3 . How I have to configure my httpd.conf to do that ? (If it is possible)
Thanks in advance
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.