ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CGI-Questions

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

  • CGI-Questions

    After we have the web server configured and running, what is the next step towards building an application to display in a browser?
    I now have the http server running and have attached a jpeg of my website running on the iseries....
    Attached Files

  • #2
    Iseries running web page

    Sorry for the too small pic, here's a better one
    Attached Files

    Comment


    • #3
      download this save file

      Just download the save file on this page and put objects...source and all into the library we created called CGI_BIN.

      Make sure we get the entry back into your WKRHTTPCFG to map the cgi-bin.




      The save file contains iseries tables and programs to get you started.


      Thanks
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Save file

        How do you restore the save file and put the objects where you want them to go?

        Comment


        • #5
          restore save file

          For ease I put the savf in C:

          then create a save file in QGPL lets call it SAVF
          CRTSAVF QGPL/SAVF

          then hit Start then run

          type command

          then type FTP {your Iseries IP)

          then enter userid

          then password

          The type BIN

          and finally PUT C:\savf QGPL/SAVF (replace


          to get to library CGI_BIN

          then rstobj from QGPL/SAVF to library CGI_BIN


          Hope this helps
          All my answers were extracted from the "Big Dummy's Guide to the As400"
          and I take no responsibility for any of them.

          www.code400.com

          Comment


          • #6
            cgi-stuff

            Thanks we got it. Still trying to figure out how to run this thing though. If we try to run we get qtmhcgi not found or something similar. I think we have that api on the system so I'm not sure why we're getting this error.

            Comment


            • #7
              This may help...keep me in loop

              CGI Support

              The supporting API Service Programs for HTTP support is located in the QTCP library named QTMHCGI (QTCP/QTMHCGI)


              API Service Program Description

              QtmhWrStout Write Standard Output

              QtmhRdStin Read Standard Input

              QtmhGetEnv Get Environment Variable

              QtmhCvtDB Convert to DB

              QtmhPutEnv Put Environment Variable

              To display the service programs call the command DSPSRVPGM QTCP/QTMHCGI
              Library's

              To organize your collection of CGI specific programs I would advise to create a CGI Library - CGI_BIN After creating the library copy (DUP) into it all of the IBM API service programs

              Copy the API service program QTMHCGI to CGI_BIN

              CRTDUPOBJ OBJ(QTCP/QTMHCGI TYPE(*SRVPGM) TOLIB(CGI_BIN)





              Binding Directory

              Create a Binding Directory to hold a list of modules and service programs called CGIBNDDIR
              (CRTBNDDIR BNDDIR(CGI_BIN/CGIBNDDIR)
              Add the service program QTMHCGI to our new Binding Directory (ADDBNDDIRE BNDDIR(CGI_BIN/CGIBNDDIR) BNDDIRE(CGI_BIN/QTMHCGI)
              All my answers were extracted from the "Big Dummy's Guide to the As400"
              and I take no responsibility for any of them.

              www.code400.com

              Comment


              • #8
                cgi-stuff

                I'm posting a sample of our http config in hopes someone can shed some light on our problem.
                We have the http server running and can serve web pages, however, we are struggling to get our test program to run.
                We have created a test page called cgicl.html and placed it in folder called GBK under the root directory of the IFS. We can access this page no problem. However when we try to run our test app, we get no results. All our app does is send a message to qsysopr when your press the button on said webpage.
                We've compiled our CL program called 'testcl' and placed in cgibin.lib under qsys.lib on the IFS.
                I will attach a sample of our config (all comments are removed) ... If anyone can help it would be great!!!
                Here is the code for the page we are calling the program from...
                <html>

                <head>

                <title>Test CGICL program</title>

                </head>

                <body>

                <h1 align="center">Tester for CL CGI</h1>


                <form action="/CGIBIN/TESTCL.pgm"

                method="Post">

                Click the button below, then check the System Operator message queue.

                <br>

                If the HTTP server is set up correctly, you should have a message there.

                <br>

                <br>

                <input type="submit"

                value="Test call to CL program">

                </form>

                </body>

                </html>
                Attached Files

                Comment


                • #9
                  can you call program directly from browser?

                  Can you try this from browser.
                  Just skip the form for now.


                  http://"iseries ip"/cgibin/TESTCL


                  I have an Iseries coming in this week-end.
                  I will set up quickly and get back to you.
                  All my answers were extracted from the "Big Dummy's Guide to the As400"
                  and I take no responsibility for any of them.

                  www.code400.com

                  Comment


                  • #10
                    cgi-stuff

                    Nope, that was the reason for my post. When I submit from the webpage nothing happens, program is not called. I think something is not quite right with my config, it all appears to look ok.
                    We are slowly but surely getting a better handle on how to do this stuff, but right now the hurdle seems to be actually getting the CGI stuff configured correctly.
                    If we can get this simple app to run, I think we'll be set to start expanding our knowledge and skill with forms etc...
                    Thanks for the reply...

                    Comment


                    • #11
                      download this tool from IBM

                      Just go to this site.

                      This is IBM Italy they have developed many freeware utilities to set up Iseries as a webserver.



                      The toolkit you want is cgidev2

                      Just download and ftp back to Iseries it will help you set up your system.
                      All my answers were extracted from the "Big Dummy's Guide to the As400"
                      and I take no responsibility for any of them.

                      www.code400.com

                      Comment

                      Working...
                      X