Overview of the Apache TPF Port


[ Configuration Files  | What's Available  | CGI Scripts  | Options  | Porting Notes  ]

This version of Apache includes changes allowing it to run on IBM's EBCDIC-based TPF (Transaction Processing Facility) operating system.
Unless otherwise noted TPF version 4.1 PUT09 is required. 

Refer to install-tpf.html for step-by-step installation instructions. 

This port builds upon the EBCDIC changes previously made to Apache. 

Apache Configuration Files

The distributed configuration files (httpd.conf-dist and mime.types, both located in the conf subdirectory) work on TPF. Performance considerations may dictate setting KeepAlive to "Off" (the default is "On") or lowering the Timeout value from the default 300 seconds (5 minutes) in order to reduce the number of active ECBs on your system.

What's Available in this Version

The Apache organization provides online documentation describing the various modules and components of the server. 

Components/modules tested on TPF:

Components/modules not yet supported on TPF:

Components/modules that don't apply or that probably won't ever be available on TPF:

How to Use CGI Scripts

The following is a very simple example of a CGI script ("Hello World") and the necessary steps to run it.
Refer to the mod_cgi module for additional information.

Add necessary directives to httpd.conf:

Example:
ScriptLog logs/script_log
ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/

A request for http://myserver/cgi-bin/filename.cgi would cause the server to run the script /usr/local/apache/cgi-bin/filename.cgi

Create the CGI script:

For this example QZZ1 is the name of the TPF program that will be executed by the CGI script.
The directory path must match what is in the httpd.conf file for ScriptAlias directive.

zfile echo "#!QZZ1" > /usr/local/apache/cgi-bin/filename.cgi
zfile cat /usr/local/apache/cgi-bin/filename.cgi    
(this should display #!QZZ1)

Mark the script as executable:

zfile chmod 755 /usr/local/apache/cgi-bin/filename.cgi

Create, load, and activate a loadset containing the CGI program (QZZ1xx):

/** QZZ1-- simple "Hello world" program to demonstrate basic CGI output **/

#include <stdio.h>

void main() {

/** Print the CGI response header, required for all HTML output. **/
/** Note the extra \n, to send the blank line. **/

printf("Content-type: text/html\n\n");

/** Print the HTML response page to stdout. **/
printf("<html>\n");
printf("<head><title> CGI Output </title></head>\n");
printf("<body>\n");
printf("<h1> Hello world </h1> \n");
printf("</body>\n");
printf("</html>\n");

}

Request the CGI script from a browser:

http://myserver/cgi-bin/filename.cgi

How to Use Apache Command Line Options

You cannot run Apache from the command line on TPF. However you can use those Apache command line options which don't actually start the server. This requires PJ27277 which shipped on PUT13.

Supported Apache options:

-d directory
Specify an alternate initial ServerRoot directory. Default is /usr/local/apache.

-f file
Specify an alternate server configuration file. Default is conf/httpd.conf.

-h
List a short summary of available command line options. (Note that this outputs all options, not just those supported on TPF.)

-l
List modules compiled into the server.

-L
List available configuration directives. (Note that this outputs all configuration directives, not just those supported on TPF.)

-S
Show the settings as parsed from the configuration file. Currently only shows the virtualhost settings.

-t
Run syntax tests for configuration files (with document root checks)

-T
Run syntax tests for configuration files (without document root checks)

-v
Show the version number.

-V
Show the version number and various compile settings.

See http://httpd.apache.org/docs/programs/httpd.html for more information about these command line options.

Note: On TPF Apache arguments are supported only on the command line, not through the ZINET XPARM field.

Setup

Ensure Apache (CHTA) is loaded

Create the httpd script:

zfile echo "#!CHTA" > /bin/httpd
zfile cat /bin/httpd  
(this should display #!CHTA)


Mark the script as executable:

zfile chmod 755 /bin/httpd


(See "ZFILE-Activate a TPF Segment or Script" in the Operations guide for more information: http://www.ibm.com/tpf/pubs/tpfpubs.htm.)

Example 1

zfile httpd -v

FILE0001I 11.43.09 START OF DISPLAY FROM httpd -v
Server version: Apache/1.3.20 (TPF)
Server built: May 23 2001 09:39:22
END OF DISPLAY

Example 2

zfile httpd -t -f /usr/local/apache/conf/httpd.conf.new

FILE0002I 11.47.26 START OF ERROR DISPLAY FROM httpd -t ...
Syntax OK
END OF DISPLAY

Porting Notes

Changes made due to differences between UNIX and TPF's process models:

Find that function...

Some simple functions & definitions initially needed to be added on TPF, such as FD_SET(). We've put these in src/os/tpf/os.h for now. 

EBCDIC changes:

TPF-specific conversion tables between US-ASCII and EBCDIC (character set IBM-1047 to be exact) were created. 

Miscellaneous, minor changes:

Various minor changes (such as casting) were made due to differences in how some functions are implemented on TPF. 

[ top  | Configuration Files  | What's Available  | CGI Scripts  | Options  | Porting Notes ]