HTTP Configuration Directives

| Home | Agenda |
  • HTTP Configuration Directives are statements that instruct the HTTP server about the services it should provide.
  • HTTP configuration directives are members of file QATMHTTPC in library QUSRSYS.
  • HTTP configuration directives are maintained
    • explicitly through command wrkhttpcfg
    • impliciyly through the HTTP server Admin
  • The reference manual for HTTP directives is
    SC41-5434 HTTP Server for AS/400 Webmaster's Guide

Generating HTTP Configuration Directives for your Web pages

Assume the following:
  • you want to develop some CGI programs
  • the library containing your CGI programs and source file HTMLSRC (dynamic html texts) is named mylib
  • the IFS root directory containing images (pc files extension .gif and .jpg) and, if you wish, html static pages (pc files extension .htm) is /mylib
If you sign on a 5250 screen as QSECOFR and you enter command
          cgidev2/setcgilib mylib
you'll get a screen asking whether you want HTTP directives generated for you.
If you reply Y (for Yes), the following directives are generated:
Pass /mylib/*
Exec /mylibp/* /QSYS.LIB/MYLIB.LIB/* %%EBCDIC%%
Let us comment the above directives:
    This directive instructs the server that any time it meets a URL request containing /mylibh/
    (* = whatever is attached to it), it should translate it to /QSYS.LIB/MYLIB.LIB/HTMLSRC.FILE/
    and attach whatever was attached to the first sentence.
    In other words, the Map directive is a nice way to allow short names in your html to be interpreted in their full meanings by your http server.
    This directive instructs the server to accept requests to access members of file htmlsrc in library mylib.
  • Pass /mylib/*
    This directive instructs the server to accept requests to access whatever file in root directory /mylib.
  • Exec /mylibp/* /QSYS.LIB/MYLIB.LIB/* %%EBCDIC%%
    This directive instructs the server to accept requests to run CGI programs in library mylib.
      The %%EBCDIC%% value overrides the value specified on the CGIConvMode directive (which defaults to %%MIXED%%).
    CGIConvMode instructs the HTTP about the conversion rule to be used to pass the environment variables (including the QUERY_STRING, that is the input data from the browser) to a CGI.
    %%EBCDIC%% is mandatory to correctly operate procedure zhbGetInput, and is compatible with procedure getInput.
    In your html, the request to run program (say) mycgi1 in library mylib should be written as
  1. For more iunformation about command setcgilib please see this page.

| Home | Agenda |