Information Systems:Apache Web Server Configuration on IBM i
Overview
IBM HTTP Server for i is the built-in web server (licensed program) that serves, amongst other things, Infonet and Web Orders. It is a fork of Apache that IBM maintains. There are 4 important instances running:
- WEBSMART (Web Orders)
- WEBINTER (Infonet)
- WEBTEST (Web Orders / Infonet Test Server, on a different port)
- ADMIN (IBM Navigator)
To view and configure these instances:
- Log in to IBM i Navigator using a browser.
- The 'Welcome' tab should be open after the page is loaded. Click IBM i Tasks Page.
- Click IBM i HTTP Server Administration.
For reference, here is the legacy way of viewing the configuration files:
Access the Apache servers from a green screen command line by keying in WRKLNK and pressing enter. Option 5=Display on Object Link www. Option 5=Display beside a server, for example WEBINTER. Option 5=Display beside conf. Option 5=Display beside HTTPD.CONF.
General Configuration
The Apache servers are configured to only run programs from explicit libraries. The following code for WEBINTER denies access to all directories (or libraries).
<Directory /> Order Deny,Allow Deny From all </Directory>
This code allows access to programs in the PC environment.
<Directory /webroot/unipharm> Order Allow,Deny Allow From all </Directory>
This code allows access to the programs on the System i created by WebSmart.
<Directory /QSYS.LIB/WEBPRDP.LIB/> Order Allow,Deny Allow From All </Directory>
All our programs enforce the logon of a valid user. If a user tries to bypass this by simply keying a program name into the address line, the session is redirected to the log on program.
Specific configuration can be found here:
Infonet Proxy
With the introduction of Python/Django (2017-2018), the WEBINTER instance was modified to be a reverse-proxy, so that users can access and navigate between Infonet (WebSmart) and Infonext (Django) pages seamlessly and using the same URL/port. Thus, when users navigate to http://infonet.unipharm.local/unipharm/some_infonet_program.pgm
, Apache will know to look for a WebSmart program, while a user navigating to http://infonet.unipharm.local/inx/123abcxyz
, Apache will route the request to Django (or more specifically, the gunicorn HTTP server).