<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content="HTML Tidy, see www.w3.org" /> <title>The Apache TPF Port</title> </head> <body> <a id="top" name="top"></a> <center> <h1>Overview of the Apache TPF Port</h1> </center> <hr /> <center> [ <a href="#configuration_files">Configuration Files</a> | <a href="#whats_available">What's Available</a> | <a href="#cgi">CGI Scripts</a> | <a href="#options">Options</a> | <a href="#porting_notes">Porting Notes</a> ] </center> <hr /> <p>This version of Apache includes changes allowing it to run on IBM's EBCDIC-based <a href="http://www.ibm.com/software/ts/tpf/index.html">TPF</a> (Transaction Processing Facility) operating system.<br /> Unless otherwise noted TPF version 4.1 PUT09 is required. </p> <p>Refer to <a href="install-tpf.html">install-tpf.html</a> for step-by-step installation instructions. </p> <p>This port builds upon the <a href="http://httpd.apache.org/docs/ebcdic.html">EBCDIC changes</a> previously made to Apache. <br /> <a id="configuration_files" name="configuration_files"></a></p> <center> <h2>Apache Configuration Files</h2> </center> 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.<br /> <a id="whats_available" name="whats_available"></a> <center> <h2>What's Available in this Version</h2> </center> The Apache organization provides <a href="http://httpd.apache.org/docs/">online documentation</a> describing the various modules and components of the server. <h3>Components/modules tested on TPF:</h3> <ul> <li>alloc.c </li> <li>ap_base64.c </li> <li>ap_checkpass.c </li> <li>ap_cpystrn.c </li> <li>ap_ebcdic.c </li> <li>ap_fnmatch.c </li> <li>ap_md5c.c </li> <li>ap_sha1.c </li> <li>ap_signal.c </li> <li>ap_slack.c </li> <li>ap_snprintf.c </li> <li>buff.c </li> <li>buildmark.c </li> <li>gen_test.char.c </li> <li>gen_uri_delims.c </li> <li>htpasswd.c <em>(requires PUT10) </em></li> <li>http_config.c </li> <li>http_core.c </li> <li>http_log.c </li> <li>http_main.c </li> <li>http_protocol.c </li> <li>http_request.c </li> <li>http_vhost.c </li> <li>logresolve.c <em>(requires PUT10) </em></li> <li>mod_access.c <em>(Use of mod_access directives "<tt>allow from</tt>" & "<tt>deny from</tt>" with host <u>names</u> (verses ip addresses) requires PUT10) </em></li> <li>mod_actions.c </li> <li>mod_alias.c </li> <li>mod_asis.c </li> <li>mod_auth.c </li> <li>mod_auth_anon.c </li> <li>mod_autoindex.c </li> <li>mod_cern_meta.c </li> <li>mod_cgi.c <em>(requires PUT10)</em> </li> <li>mod_digest.c </li> <li>mod_dir.c </li> <li>mod_env.c </li> <li>mod_example.c </li> <li>mod_expires.c </li> <li>mod_headers.c </li> <li>mod_imap.c </li> <li>mod_include.c <em>(CGI execution requires TPF version 4.1 PUT10) </em></li> <li>mod_info.c </li> <li>mod_log_agent.c </li> <li>mod_log_config.c </li> <li>mod_log_referer.c </li> <li>mod_mime.c </li> <li>mod_mime_magic.c </li> <li>mod_negotiation.c </li> <li><a href="http://hpwww.ec-lyon.fr/~vincent/apache/mod_put.html">mod_put.c</a> <em>(third party module) </em></li> <li>mod_proxy.c </li> <li>mod_setenvif.c </li> <li>mod_speling.c </li> <li>mod_status.c </li> <li>mod_tpf_shm_static.c <em>(third party module, requires PUT10) </em></li> <li>mod_unique_id.c <em>(requires PUT10)</em> </li> <li>mod_userdir.c </li> <li>mod_usertrack.c </li> <li>os.c </li> <li>os-inline.c </li> <li>proxy_cache.c </li> <li>proxy_connect.c </li> <li>proxy_ftp.c </li> <li>proxy_http.c </li> <li>proxy_util.c </li> <li>regular expression parser </li> <li>regular expression test tool <em>(requires PUT10) </em></li> <li>rfc1413.c </li> <li>rotatelogs.c <em>(requires PUT10) </em></li> <li>util.c </li> <li>util_date.c </li> <li>util_md5.c </li> <li>util_script.c </li> <li>util_uri.c </li> </ul> <h3>Components/modules not yet supported on TPF:</h3> <ul> <li>htdigest.c </li> <li>lib/expat-lite </li> <li>mod_auth_digest.c </li> <li>mod_rewrite.c </li> <li>mod_vhost_alias.c </li> </ul> <h3>Components/modules that don't apply or that probably won't ever be available on TPF:</h3> <ul> <li>ab.c </li> <li>ap_getpass.c </li> <li>mod_auth_db.c </li> <li>mod_auth_dbm.c </li> <li>mod_auth_db.module </li> <li>mod_mmap_static.c </li> <li>mod_so.c </li> <li>suexec.c </li> </ul> <a id="cgi" name="cgi"></a> <center> <h2>How to Use CGI Scripts</h2> </center> <p>The following is a very simple example of a CGI script ("Hello World") and the necessary steps to run it.<br /> Refer to the <a href="http://httpd.apache.org/docs/mod/mod_cgi.html">mod_cgi module</a> for additional information.</p> <h3>Add necessary directives to httpd.conf:</h3> <div style="margin-left: 2em"> Example: <tt><br /> </tt> <div style="margin-left: 2em"> <tt>ScriptLog logs/script_log<br /> ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/</tt> </div> <br /> A request for <tt>http://myserver/cgi-bin/filename.cgi</tt> would cause the server to run the script <tt>/usr/local/apache/cgi-bin/filename.cgi</tt> </div> <h3>Create the CGI script:</h3> <div style="margin-left: 2em"> <p>For this example <tt>QZZ1</tt> is the name of the TPF program that will be executed by the CGI script.<br /> The directory path must match what is in the httpd.conf file for <tt>ScriptAlias</tt> directive.</p> <div style="margin-left: 2em"> <tt>zfile echo "#!QZZ1" > /usr/local/apache/cgi-bin/filename.cgi<br /> zfile cat /usr/local/apache/cgi-bin/filename.cgi </tt> (this should display <tt>#!QZZ1</tt>)<br /> <br /> </div> </div> <h3>Mark the script as executable:</h3> <div style="margin-left: 2em"> <tt>zfile chmod 755 /usr/local/apache/cgi-bin/filename.cgi<br /> <br /> </tt> </div> <h3>Create, load, and activate a loadset containing the CGI program (QZZ1xx):</h3> <div style="margin-left: 2em"> <code>/** QZZ1-- simple "Hello world" program to demonstrate basic CGI output **/<br /> <br /> #include <stdio.h><br /> <br /> void main() {<br /> <br /> </code> <div style="margin-left: 2em"> <code>/** Print the CGI response header, required for all HTML output. **/<br /> /** Note the extra \n, to send the blank line. **/<br /> <br /> printf("Content-type: text/html\n\n");<br /> <br /> /** Print the HTML response page to stdout. **/<br /> printf("<html>\n");<br /> printf("<head><title> CGI Output </title></head>\n");<br /> printf("<body>\n");<br /> printf("<h1> Hello world </h1> \n");<br /> printf("</body>\n");<br /> printf("</html>\n");<br /> <br /> </code> </div> <code>}<br /> </code> </div> <h3>Request the CGI script from a browser:</h3> <div style="margin-left: 2em"> <tt>http://myserver/cgi-bin/filename.cgi</tt><br /> </div> <a id="options" name="options"></a> <center> <h2>How to Use Apache Command Line Options</h2> </center> <p>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.</p> <h3>Supported Apache options:</h3> <div style="margin-left: 2em"> <p>-d <i>directory</i><br /> Specify an alternate initial ServerRoot <i>directory</i>. Default is <tt>/usr/local/apache</tt>.</p> <p>-f <i>file</i><br /> Specify an alternate server configuration <i>file</i>. Default is <tt>conf/httpd.conf</tt>.</p> <p>-h<br /> List a short summary of available command line options. (Note that this outputs all options, not just those supported on TPF.)</p> <p>-l<br /> List modules compiled into the server.</p> <p>-L<br /> List available configuration directives. (Note that this outputs all configuration directives, not just those supported on TPF.)</p> <p>-S<br /> Show the settings as parsed from the configuration file. Currently only shows the virtualhost settings.</p> <p>-t<br /> Run syntax tests for configuration files (with document root checks)</p> <p>-T<br /> Run syntax tests for configuration files (without document root checks)</p> <p>-v<br /> Show the version number.</p> <p>-V<br /> Show the version number and various compile settings.</p> <p>See <a href="http://httpd.apache.org/docs/programs/httpd.html">http://httpd.apache.org/docs/programs/httpd.html</a> for more information about these command line options.</p> <p>Note: On TPF Apache arguments are supported only on the command line, not through the ZINET XPARM field.</p> </div> <h3>Setup</h3> <div style="margin-left: 2em"> <p>Ensure Apache (CHTA) is loaded</p> <p>Create the httpd script:</p> <div style="margin-left: 2em"> <tt>zfile echo "#!CHTA" > /bin/httpd<br /> zfile cat /bin/httpd </tt> (this should display <tt>#!CHTA</tt>) </div> <br /> <br /> <p>Mark the script as executable:<br /> </p> <div style="margin-left: 2em"> <tt>zfile chmod 755 /bin/httpd</tt> </div> <br /> <br /> <p>(See "<em>ZFILE-Activate a TPF Segment or Script</em>" in the <em>Operations</em> guide for more information: <a href="http://www.ibm.com/tpf/pubs/tpfpubs.htm">http://www.ibm.com/tpf/pubs/tpfpubs.htm</a>.)</p> </div> <h3>Example 1</h3> <div style="margin-left: 2em"> <p><tt>zfile httpd -v</tt></p> <p><tt>FILE0001I 11.43.09 START OF DISPLAY FROM httpd -v<br /> Server version: Apache/1.3.20 (TPF)<br /> Server built: May 23 2001 09:39:22<br /> END OF DISPLAY</tt></p> </div> <h3>Example 2</h3> <div style="margin-left: 2em"> <p><tt>zfile httpd -t -f /usr/local/apache/conf/httpd.conf.new</tt></p> <p><tt>FILE0002I 11.47.26 START OF ERROR DISPLAY FROM httpd -t ...<br /> Syntax OK<br /> END OF DISPLAY</tt></p> </div> <a id="porting_notes" name="porting_notes"></a> <center> <h2>Porting Notes</h2> </center> <h3>Changes made due to differences between UNIX and TPF's process models:</h3> <ul> <li><b>Signals</b>: On TPF a signal that is sent to a process remains unhandled until the process explicitly requests that signals be handled using the <tt>tpf_process_signals()</tt> function. Additionally, the default action for an alarm on TPF is to take an OPR-7777 dump and exit. (On UNIX the default is the equivalent of <tt>exit()</tt> with no dump taken.) These differences necessitated a few modifications: </li> <li style="list-style: none"> <br /> <ul> <li>bypass the use of <tt>ap_block_alarms()</tt> & <tt>ap_unblock_alarms()</tt> </li> <li>add <tt>tpf_process_signals()</tt> calls </li> <li>add <tt>select()</tt> calls to prevent blocking. </li> </ul> </li> </ul> <h3>Find that function...</h3> Some simple functions & definitions initially needed to be added on TPF, such as <tt>FD_SET()</tt>. We've put these in src/os/tpf/os.h for now. <h3>EBCDIC changes:</h3> TPF-specific conversion tables between US-ASCII and EBCDIC (character set IBM-1047 to be exact) were created. <h3>Miscellaneous, minor changes:</h3> Various minor changes (such as casting) were made due to differences in how some functions are implemented on TPF. <br /> <hr /> <center> [ <a href="#top">top</a> | <a href="#configuration_files">Configuration Files</a> | <a href="#whats_available">What's Available</a> | <a href="#cgi">CGI Scripts</a> | <a href="#options">Options</a> | <a href="#porting_notes">Porting Notes</a> ] </center> </body> </html>