Forums >> Programming >> Proof of Concept (POC) >>
Powered by Apache HTTP Configuration for the IBM i (AS/400)


Powered by Apache HTTP Configuration for the IBM i (AS/400)

Powered by Apache HTTP Configuration for the IBM i (AS/400)

Setting up HTTP Instances and configuration files can be tricky.  Some choose to use "Wizards" or the HTTP Sever Admin service.  Both I feel are overly complicated for the majority of sites.

When we set up a new site, the first thing we do is create the server instance.  This is as easy as creating a member in file QUSRSYS/QATMHINSTC with the name of the instance we want.  In this case, we called in GREENBOARD.

The sole purpose of this member is to tell the IBM HTTP server where to find the configuration file, as well as a few other settings:

-apache -d /www/conf -f greenboard.conf -AutoStartY -uiMin 10 -uiMax 300  

The only things you need to worry about changing are the path (/www/conf) and the name (greenboard.conf) of the HTTP configuration file that will be used.

The other parameters, such as AutoStart and uiMin and uiMax (which tell the server how many threads/job to start right away, and the maximum number of threads/jobs to run) can be tweaked along the way.  I've found that with busy sites that use a lot of Server Side Includes (SSIs) it's good to have a larger uiMax number or sometimes the server will "choke" on all the requests.

The next step is to create our configuration file.  In this case, it will be in the IFS and will be /www/conf/greenboard.conf.  The contents are as simple as the following:

Listen xx.xx.xx.23:80

LogFormat "%h %l %u %t \"%r\" %s %b\"" Common
ScriptLog /www/logs/greenboard/cgierrorlog
ErrorLog /www/logs/greenboard/errorlog
UseCanonicalName Off
CustomLog /www/logs/greenboard/accesslog Common
CustomLog /www/logs/greenboard/refererlog "%{Referer}i -> %U"
ErrorDocument 404 /index.html



DocumentRoot /www/greenboard/html
DirectoryIndex index.html
ScriptAliasMatch ^/forum/(.*) /qsys.lib/greenboard.lib/$1.pgm

<Directory />
   Options None
   order deny,allow
   deny from all

<Directory /www/greenboard/html>
   order allow,deny
   allow from all
   <FilesMatch "\.html(\..+)?$">
       Options +Includes
       SetOutputFilter Includes

<Directory /qsys.lib/greenboard.lib>
   allow from all
   order allow,deny
   Options +ExecCGI +Includes
   SetOutputFilter Includes

As far as HTTP configurations go, this one is pretty simple.

It tells the server the document root, how to run CGI programs (ie, /forum maps to /qsys.lib/greenboard.lib) and sets authorities to directories and libraries used by the web site.  It also sets up the ability to use Server Side Includes (SSI) in both static and dynamic (CGI) pages.

One special thing in this setup is the use of the SetEnv keyword.  What this allows us to do is set environment variables for the entire site.  In this case, we set the value of a environment varialble named GREENBOARD_SYSID to "fieldexit".  This is really the top level key to the databases that are used on the site to store posts and designed the forum  layout.  This was done so that if we ever created a new discussion forum (with a new name) we could key it differently by specifying a different environment variable for GREENBOARD_SYSID.

So, in our applications we simply use the following to retrieve the environment variable:


The #GetEnv() subprocedure is part of the eRPG SDK, but with most systems like CGIDEV2 there are similar methods for this.

Now I invite you to go take a look at a configuration created by a "wizard".  I think you'll find it's quite cumbersome and complicated and really doesn't do much more, and possibly even does less than this simple configuration.

Last edited 08/20/2014 at 11:22:31


Copyright 1983-2017 BVSTools
GreenBoard(v3) Powered by the eRPG SDK, MAILTOOL Plus!, GreenTools for Google Apps, jQuery, jQuery UI, BlockUI, CKEditor and running on the IBM i (AKA AS/400, iSeries, System i).