How can I use library list in HTTP configuration in scriptaliasmatch
Last Post 21 Nov 2012 08:23 AM by Ringer. 12 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
ltc
New Member
New Member
Posts:6

--
13 Nov 2012 05:05 PM

I have a test and a production envienment. How can I set the configuration file so that my url for test will be able to find cgi program in production libarray if not in test libarray

 

The scriptaliasmatch is set to test onlt, hoew can I set it to search through test and production library.

            ScriptAliasMatch ^/LTCCGI/(.*) /QSYS.LIB/TestLIB.LIB/$1.pgm

 

 

 

 

Ringer
Veteran Member
Veteran Member
Posts:1768
Avatar

--
14 Nov 2012 10:11 AM
I believe you can use a QIBM_CGI_LIBRARY_LIST inside the directory container.

[Directory /QSYS.LIB/MYCGILIB.LIB]
SetEnv QIBM_CGI_LIBRARY_LIST "QTEMP;TESTLIB;PRODLIB;QGPL;LIBHTTP;etc"
[/Directory]

http://www-03.ibm.com/systems/i/sof...s/faq.html

Chris Ringer
ltc
New Member
New Member
Posts:6

--
14 Nov 2012 10:28 AM

I have try to use the setenv but it does not work.

 

Peter M
New Member
New Member
Posts:30

--
19 Nov 2012 03:23 PM
I have also used the SetEnv directive with no problems.
Another technique I used was the CgiInitialUrl directive.
I was working on a system which in the green screen world, used a data area to store the library list for each environment. A program would retrieve and change the library list based on the contents of the data area when a user signed onto an environment from the main menu of the green screen application. I simply had this data area coded as follows in the HTTP servers configuration.
CgiInitialUrl /qsys.lib/GLDGWI.lib/yu005.pgm?sysid$=GLD
In this example. the program YU005 would retrieve the data area "GLD" and set up the library list based on its contents.
The end result is the jobs started under the HTTP server( PGM-QZSRCGI) would have the correct library list.
I liked this technique because it meant the library list used by both the green screen and HTTP servers were all stored in one place.

Peter M

ltc
New Member
New Member
Posts:6

--
19 Nov 2012 04:12 PM
The SETEnv only work for data file but not program. This is my HTTP Configuratio. Please have a loonk and let me know where I have done wrong. Thanks.

Test is the libraray that contains program under development.

Waterous is librray that contains program in production.



ScriptAliasMatch ^/test/(.*) /QSYS.LIB/test.LIB/$1.pgm
ScriptAliasMatch ^/test/*htm /qsys.lib/LTCCGI.lib/*.htm


AuthType Basic
AuthName "Application test"
PasswdFile %%SYSTEM%%
UserID %%CLIENT%%
Require valid-user

SetEnv QIBM_CGI_LIBRARY_LIST "QTEMP;TEST;FILETRAN;WATEROUS"

Rory Hewitt
Veteran Member
Veteran Member
Posts:1311
Avatar

--
19 Nov 2012 05:02 PM
Itc,

Basically, you can't easily do what you want. Your best bet might well be to create a 'wrapper' program which is called which searches for the test instance of your CGI program and calls that if found, otherwise calls the production instance. You might need to mess around with some Location directives to enable the wrapper program to know what CGI program to call, since the ScriptAliasMatch directiove would simply name the wrapper program, no matter what.

Alternatively, you might want to simply have different URLs for testing and production - that avoids runtime problems where a test program is accidentally called in production, but makes it harder to do testing where you are embedding links in other web pages etc.

Rory
Ringer
Veteran Member
Veteran Member
Posts:1768
Avatar

--
20 Nov 2012 10:43 AM
A related thread: http://comments.gmane.org/gmane.com....web/10464

Chris Ringer
ltc
New Member
New Member
Posts:6

--
20 Nov 2012 10:56 AM
Thanks, Ringer. But what is CL Wrapper? (Following is the copy and paste from one of the replies).

Don,

I think you can write a wrapper CL to accomplish what you want. The way you have it configured now, it is always
going to call your program in library CGIBIN. The library list environment variable isn't going to have
any effect on the call because the server is using a fully qualified name.

If you write a CL wrapper, the CL can call the program without using the fully qualified name and I think that
will do what you want.

Another option is to create additional ScriptAliasMatch's for specific CGI programs. If you do that, make
sure they are located before the existing one in httpd.conf.

Matt

Tommy Holden
Senior Member
Senior Member
Posts:2833
Avatar

--
20 Nov 2012 10:57 AM
wrapper CL = CL program that calls the other programs in that job stream
ltc
New Member
New Member
Posts:6

--
20 Nov 2012 11:01 AM
Can you please give me an example that it can be use to call programs reside in a librray by searching through in the library list (i.e. regardless where itn is reside, test or production)?
Tommy Holden
Senior Member
Senior Member
Posts:2833
Avatar

--
20 Nov 2012 11:39 AM

CL example:

Pgm

call mypgm
endpgm

 
ltc
New Member
New Member
Posts:6

--
20 Nov 2012 11:41 AM
But how can I designate the library list in a HTTP environment?
Ringer
Veteran Member
Veteran Member
Posts:1768
Avatar

--
21 Nov 2012 08:23 AM
I thought I already explained that. Use QIBM_CGI_LIBRARY_LIST. Maybe you need to word your question more carefully.

Chris Ringer
You are not authorized to post a reply.

Acceptable Use Policy