ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Can we use ScriptAlias with /qsys.lib/*libl.lib/mypgm.pgm ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can we use ScriptAlias with /qsys.lib/*libl.lib/mypgm.pgm ?

    Hi

    I am exposing my RPGLE program as a webserivce using IBM HTTP server (Apache).


    I want the program to be picked from the library list but I think ScripAlias directive does work when *LIBL is mentioned.

    There a way I can use multiple ServerUserId to run CGI programs. I think it is a global var and cannot be defined twice.

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    if the above two cannot work, then I have a problem as I have multiple environments and I cannot work with all environments in HTTP server configuration.

    Any help will be useful

  • #2
    I'm not sure that would be a good idea. That being said, have you tried "/qsys.lib/*.lib/mypgm.pgm"?

    Comment


    • jtaylor___
      jtaylor___ commented
      Editing a comment
      I think my path there would match any library. I don't think it would work for your *LIBL request.

  • #3
    "if the above two cannot work, then I have a problem as I have multiple environments and ..."

    Don't know if it would help but have you looked at using virtual hosts for dealing with different library lists etc? As to the User Id it is more common with CGI programs to change the profile to the one you want to use from within the called program. There's a great example of how to code for this here: https://archive.midrange.com/web400/.../msg00032.html

    Comment


    • #4
      For multiple environments, I've worked with three different approaches.

      1. Have different URLs for each environment, the program ccode can be the same, but the HTTP server can be configured to use a different library list. There's no need to use ServerUserId here (ServerUserId has nothing to do with the library list, anyway.)

      2. Have a CL program that handles all ScriptAliases. It can set up the library list, et al, based on whatever criteria you can write into the program. This CL program itself would not be in either environment, but would be the only program that needs to have a hard-coded ScriptAlias and the only program that needs to be aware of the existence of the environments.

      3. Use a separate instance for each environment. This requires each environment to have its own port number (or less commonly, a different IP address). Each instance would have its own httpd.conf that is configured with the appropriate libraries for the instance. That would be the only thing that needs to be configured separately for each instance. It'd also be possible to do this with a single instance using virtual hosts, but there's not much reason to do it that way, since its less flexible, and with VirtualHosts if you wanted to change the configuration of one instance you'd have to take them all down, which is not usually desirable.

      Comment


      • #5
        Hi Scott & JonBoy,

        Thank you for your input and help.

        Scott Klement - I mentioned about ServerUserId because this way we can use the library list mentioned for this user (jobd). This can help in setting up the initial library list.


        1) yes we cannot use *libl in CGI script as it needs a fully qualified path.
        2) CL program could be a good method in this case.
        3) I think creating multiple HTTP s\erver instances could be an overhead for the system. However, I would try the virtual host approach just for my learning.

        Thanks,
        AS_Developer

        Comment

        Working...
        X