1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8 <title>The Apache EBCDIC Port - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body id="manual-page"><div id="page-header">
14 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
15 <p class="apache">Apache HTTP Server Version 2.3</p>
16 <img alt="" src="../images/feather.gif" /></div>
17 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
19 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.3</a> > <a href="./">Platform Specific Notes</a></div><div id="page-content"><div id="preamble"><h1>The Apache EBCDIC Port</h1>
21 <p><span>Available Languages: </span><a href="../en/platform/ebcdic.html" title="English"> en </a> |
22 <a href="../ko/platform/ebcdic.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
26 <div class="warning"><strong>Warning:</strong> This document
27 has not been updated to take into account changes made in
28 the 2.0 version of the Apache HTTP Server. Some of the
29 information may still be relevant, but please use it with care.
33 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#overview">Overview of the Apache EBCDIC Port</a></li>
34 <li><img alt="" src="../images/down.gif" /> <a href="#design">Design Goals</a></li>
35 <li><img alt="" src="../images/down.gif" /> <a href="#technical">Technical Solution</a></li>
36 <li><img alt="" src="../images/down.gif" /> <a href="#porting">Porting Notes</a></li>
37 <li><img alt="" src="../images/down.gif" /> <a href="#document">Document Storage Notes</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#modules">Apache Modules' Status</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#third-party">Third Party Modules' Status</a></li>
41 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
43 <h2><a name="overview" id="overview">Overview of the Apache EBCDIC Port</a></h2>
47 <p>Version 1.3 of the Apache HTTP Server is the first version
48 which includes a port to a (non-ASCII) mainframe machine which
49 uses the EBCDIC character set as its native codeset.</p>
51 <p>(It is the SIEMENS family of mainframes running the <a href="http://www.siemens.de/servers/bs2osd/osdbc_us.htm">BS2000/OSD
52 operating system</a>. This mainframe OS nowadays features a
53 SVR4-derived POSIX subsystem).</p>
55 <p>The port was started initially to</p>
58 <li>prove the feasibility of porting <a href="http://dev.apache.org/">the Apache HTTP server</a> to
61 <li>find a "worthy and capable" successor for the venerable
62 <a href="http://www.w3.org/Daemon/">CERN-3.0</a> daemon
63 (which was ported a couple of years ago), and to</li>
65 <li>prove that Apache's preforking process model can on this
66 platform easily outperform the accept-fork-serve model used
67 by CERN by a factor of 5 or more.</li>
70 <p>This document serves as a rationale to describe some of the
71 design decisions of the port to this machine.</p>
73 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
75 <h2><a name="design" id="design">Design Goals</a></h2>
79 <p>One objective of the EBCDIC port was to maintain enough
80 backwards compatibility with the (EBCDIC) CERN server to make
81 the transition to the new server attractive and easy. This
82 required the addition of a configurable method to define
83 whether a HTML document was stored in ASCII (the only format
84 accepted by the old server) or in EBCDIC (the native document
85 format in the POSIX subsystem, and therefore the only realistic
86 format in which the other POSIX tools like <code>grep</code> or
87 <code>sed</code> could operate on the documents). The current
88 solution to this is a "pseudo-MIME-format" which is intercepted
89 and interpreted by the Apache server (see below). Future versions
90 might solve the problem by defining an "ebcdic-handler" for all
91 documents which must be converted.</p>
93 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
95 <h2><a name="technical" id="technical">Technical Solution</a></h2>
99 <p>Since all Apache input and output is based upon the BUFF
100 data type and its methods, the easiest solution was to add the
101 conversion to the BUFF handling routines. The conversion must
102 be settable at any time, so a BUFF flag was added which defines
103 whether a BUFF object has currently enabled conversion or not.
104 This flag is modified at several points in the HTTP
108 <li><strong>set</strong> before a request is received
109 (because the request and the request header lines are always
110 in ASCII format)</li>
112 <li><strong>set/unset</strong> when the request body is
113 received - depending on the content type of the request body
114 (because the request body may contain ASCII text or a binary
117 <li><strong>set</strong> before a reply header is sent
118 (because the response header lines are always in ASCII
121 <li><strong>set/unset</strong> when the response body is sent
122 - depending on the content type of the response body (because
123 the response body may contain text or a binary file)</li>
126 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
127 <div class="section">
128 <h2><a name="porting" id="porting">Porting Notes</a></h2>
134 <p>The relevant changes in the source are <code>#ifdef</code>'ed
135 into two categories:</p>
138 <dt><code><strong>#ifdef
139 CHARSET_EBCDIC</strong></code></dt>
142 <p>Code which is needed for any EBCDIC based machine.
143 This includes character translations, differences in
144 contiguity of the two character sets, flags which
145 indicate which part of the HTTP protocol has to be
146 converted and which part doesn't <em>etc.</em></p>
149 <dt><code><strong>#ifdef _OSD_POSIX</strong></code></dt>
152 <p>Code which is needed for the SIEMENS BS2000/OSD
153 mainframe platform only. This deals with include file
154 differences and socket implementation topics which are
155 only required on the BS2000/OSD platform.</p>
161 <p>The possibility to translate between ASCII and EBCDIC at
162 the socket level (on BS2000 POSIX, there is a socket option
163 which supports this) was intentionally <em>not</em> chosen,
164 because the byte stream at the HTTP protocol level consists
165 of a mixture of protocol related strings and non-protocol
166 related raw file data. HTTP protocol strings are always
167 encoded in ASCII (the <code>GET</code> request, any Header: lines,
168 the chunking information <em>etc.</em>) whereas the file transfer
169 parts (<em>i.e.</em>, GIF images, CGI output <em>etc.</em>)
170 should usually be just "passed through" by the server. This
171 separation between "protocol string" and "raw data" is
172 reflected in the server code by functions like <code>bgets()</code>
173 or <code>rvputs()</code> for strings, and functions like
174 <code>bwrite()</code> for binary data. A global translation
175 of everything would therefore be inadequate.</p>
177 <p>(In the case of text files of course, provisions must be
178 made so that EBCDIC documents are always served in
183 <p>This port therefore features a built-in protocol level
184 conversion for the server-internal strings (which the
185 compiler translated to EBCDIC strings) and thus for all
186 server-generated documents. The hard coded ASCII escapes
187 <code>\012</code> and <code>\015</code> which are ubiquitous
188 in the server code are an exception: they are already the binary
189 encoding of the ASCII <code>\n</code> and <code>\r</code> and
190 must not be converted to ASCII a second time.
191 This exception is only relevant for server-generated strings;
192 and <em>external</em> EBCDIC documents are not expected to
193 contain ASCII newline characters.</p>
197 <p>By examining the call hierarchy for the BUFF management
198 routines, I added an "ebcdic/ascii conversion layer" which
199 would be crossed on every puts/write/get/gets, and a
200 conversion flag which allowed enabling/disabling the
201 conversions on-the-fly. Usually, a document crosses this
202 layer twice from its origin source (a file or CGI output) to
203 its destination (the requesting client): <code>file ->
204 Apache</code>, and <code>Apache -> client</code>.</p>
206 <p>The server can now read the header lines of a CGI-script
207 output in EBCDIC format, and then find out that the remainder
208 of the script's output is in ASCII (like in the case of the
209 output of a WWW Counter program: the document body contains a
210 GIF image). All header processing is done in the native
211 EBCDIC format; the server then determines, based on the type
212 of document being served, whether the document body (except
213 for the chunking information, of course) is in ASCII already
214 or must be converted from EBCDIC.</p>
218 <p>For Text documents (MIME types text/plain, text/html
219 <em>etc.</em>), an implicit translation to ASCII can be
220 used, or (if the users prefer to store some documents in
221 raw ASCII form for faster serving, or because the files
222 reside on a NFS-mounted directory tree) can be served
223 without conversion.</p>
225 <p><strong>Example:</strong></p>
227 <p>to serve files with the suffix <code>.ahtml</code> as a
228 raw ASCII <code>text/html</code> document without implicit
229 conversion (and suffix <code>.ascii</code> as ASCII
230 <code>text/plain</code>), use the directives:</p>
232 <div class="example"><p><code>
233 AddType text/x-ascii-html .ahtml <br />
234 AddType text/x-ascii-plain .ascii
237 <p>Similarly, any <code>text/foo</code> MIME type can be
238 served as "raw ASCII" by configuring a MIME type
239 "<code>text/x-ascii-foo</code>" for it using
240 <code>AddType</code>.</p>
244 <p>Non-text documents are always served "binary" without
245 conversion. This seems to be the most sensible choice for,
246 .<em>e.g.</em>, GIF/ZIP/AU file types. This of course
247 requires the user to copy them to the mainframe host using
248 the "<code>rcp -b</code>" binary switch.</p>
252 <p>Server parsed files are always assumed to be in native
253 (<em>i.e.</em>, EBCDIC) format as used on the machine, and
254 are converted after processing.</p>
258 <p>For CGI output, the CGI script determines whether a
259 conversion is needed or not: by setting the appropriate
260 Content-Type, text files can be converted, or GIF output can
261 be passed through unmodified. An example for the latter case
262 is the wwwcount program which we ported as well.</p>
267 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
268 <div class="section">
269 <h2><a name="document" id="document">Document Storage Notes</a></h2>
273 <h3><a name="binary" id="binary">Binary Files</a></h3>
277 <p>All files with a <code>Content-Type:</code> which does not
278 start with <code>text/</code> are regarded as <em>binary
279 files</em> by the server and are not subject to any conversion.
280 Examples for binary files are GIF images, gzip-compressed files
283 <p>When exchanging binary files between the mainframe host and
284 a Unix machine or Windows PC, be sure to use the ftp "binary"
285 (<code>TYPE I</code>) command, or use the
286 <code>rcp -b</code> command from the mainframe host (the
287 <code>-b</code> switch is not supported in unix
288 <code>rcp</code>'s).</p>
292 <h3><a name="text" id="text">Text Documents</a></h3>
296 <p>The default assumption of the server is that Text Files
297 (<em>i.e.</em>, all files whose <code>Content-Type:</code>
298 starts with <code>text/</code>) are stored in the native
299 character set of the host, EBCDIC.</p>
303 <h3><a name="ssi" id="ssi">Server Side Included Documents</a></h3>
307 <p>SSI documents must currently be stored in EBCDIC only.
308 No provision is made to convert it from ASCII before
313 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
314 <div class="section">
315 <h2><a name="modules" id="modules">Apache Modules' Status</a></h2>
319 <table class="bordered">
327 <td><code class="module"><a href="../mod/core.html">core</a></code></td>
328 <td class="centered">+</td>
333 <td><code class="module"><a href="../mod/mod_access.html">mod_access</a></code></td>
334 <td class="centered">+</td>
339 <td><code class="module"><a href="../mod/mod_actions.html">mod_actions</a></code></td>
340 <td class="centered">+</td>
345 <td><code class="module"><a href="../mod/mod_alias.html">mod_alias</a></code></td>
346 <td class="centered">+</td>
351 <td><code class="module"><a href="../mod/mod_asis.html">mod_asis</a></code></td>
352 <td class="centered">+</td>
357 <td><code class="module"><a href="../mod/mod_auth.html">mod_auth</a></code></td>
358 <td class="centered">+</td>
363 <td><code class="module"><a href="../mod/mod_auth_anon.html">mod_auth_anon</a></code></td>
364 <td class="centered">+</td>
369 <td><code class="module"><a href="../mod/mod_auth_dbm.html">mod_auth_dbm</a></code></td>
370 <td class="centered">?</td>
371 <td>with own <code>libdb.a</code></td>
375 <td><code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code></td>
376 <td class="centered">+</td>
381 <td><code class="module"><a href="../mod/mod_cern_meta.html">mod_cern_meta</a></code></td>
382 <td class="centered">?</td>
387 <td><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></td>
388 <td class="centered">+</td>
393 <td><code>mod_digest</code></td>
394 <td class="centered">+</td>
399 <td><code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code></td>
400 <td class="centered">+</td>
405 <td><code class="module"><a href="../mod/mod_so.html">mod_so</a></code></td>
406 <td class="centered">-</td>
407 <td>no shared libs</td>
411 <td><code class="module"><a href="../mod/mod_env.html">mod_env</a></code></td>
412 <td class="centered">+</td>
417 <td><code class="module"><a href="../mod/mod_example.html">mod_example</a></code></td>
418 <td class="centered">-</td>
419 <td>(test bed only)</td>
423 <td><code class="module"><a href="../mod/mod_expires.html">mod_expires</a></code></td>
424 <td class="centered">+</td>
429 <td><code class="module"><a href="../mod/mod_headers.html">mod_headers</a></code></td>
430 <td class="centered">+</td>
435 <td><code class="module"><a href="../mod/mod_imagemap.html">mod_imagemap</a></code></td>
436 <td class="centered">+</td>
441 <td><code class="module"><a href="../mod/mod_include.html">mod_include</a></code></td>
442 <td class="centered">+</td>
447 <td><code class="module"><a href="../mod/mod_info.html">mod_info</a></code></td>
448 <td class="centered">+</td>
453 <td><code>mod_log_agent</code></td>
454 <td class="centered">+</td>
459 <td><code>mod_log_config</code></td>
460 <td class="centered">+</td>
465 <td><code class="module"><a href="../mod/mod_log_referer.html">mod_log_referer</a></code></td>
466 <td class="centered">+</td>
471 <td><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></td>
472 <td class="centered">+</td>
477 <td><code class="module"><a href="../mod/mod_mime_magic.html">mod_mime_magic</a></code></td>
478 <td class="centered">?</td>
479 <td>not ported yet</td>
483 <td><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></td>
484 <td class="centered">+</td>
489 <td><code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code></td>
490 <td class="centered">+</td>
495 <td><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code></td>
496 <td class="centered">+</td>
501 <td><code class="module"><a href="../mod/mod_setenvif.html">mod_setenvif</a></code></td>
502 <td class="centered">+</td>
507 <td><code class="module"><a href="../mod/mod_speling.html">mod_speling</a></code></td>
508 <td class="centered">+</td>
513 <td><code class="module"><a href="../mod/mod_status.html">mod_status</a></code></td>
514 <td class="centered">+</td>
519 <td><code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code></td>
520 <td class="centered">+</td>
525 <td><code class="module"><a href="../mod/mod_userdir.html">mod_userdir</a></code></td>
526 <td class="centered">+</td>
531 <td><code class="module"><a href="../mod/mod_usertrack.html">mod_usertrack</a></code></td>
532 <td class="centered">?</td>
537 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
538 <div class="section">
539 <h2><a name="third-party" id="third-party">Third Party Modules' Status</a></h2>
543 <table class="bordered">
551 <td><code><a href="http://java.apache.org/">mod_jserv</a>
553 <td class="centered">-</td>
554 <td>JAVA still being ported.</td>
558 <td><code><a href="http://www.php.net/">mod_php3</a></code></td>
559 <td class="centered">+</td>
560 <td><code>mod_php3</code> runs fine, with LDAP and GD
561 and FreeType libraries.</td>
565 <td><code><a href="http://hpwww.ec-lyon.fr/~vincent/apache/mod_put.html">mod_put</a></code></td>
566 <td class="centered">?</td>
571 <td><code><a href="ftp://hachiman.vidya.com/pub/apache/">mod_session</a></code></td>
572 <td class="centered">-</td>
578 <div class="bottomlang">
579 <p><span>Available Languages: </span><a href="../en/platform/ebcdic.html" title="English"> en </a> |
580 <a href="../ko/platform/ebcdic.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
581 </div><div id="footer">
582 <p class="apache">Copyright 2007 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
583 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>