summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd/htdocs/manual/mpeix.html
blob: bcca2e0654ea913c9de13fad1914341a74f9c32c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
<!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" />
    <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1" />
    <meta name="GENERATOR"
    content="Mozilla/4.75 [en] (Win98; U) [Netscape]" />
    <meta name="Author" content="Mark Bixby - mark@bixby.org" />

    <title>Using Apache with HP MPE/iX</title>
    <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
  </head>

  <body text="#000000" bgcolor="#FFFFFF" link="#0000FF"
  vlink="#000080" alink="#FF0000">
        <div align="CENTER">
      <img src="images/sub.gif" alt="[APACHE DOCUMENTATION]" /> 

      <h3>Apache HTTP Server</h3>
    </div>



    <center>
      <h1>Using Apache With HP MPE/iX</h1>
    </center>
    This document explains how to compile, install, configure and
    run Apache 1.3 under HP MPE/iX. 

    <p>The bug reporting page and new-httpd mailing list are NOT
    provided to answer questions about configuration or running
    Apache. Before you submit a bug report or request, first
    consult this document, the <a href="misc/FAQ.html">Frequently
    Asked Questions</a> page and the other relevant documentation
    topics. If you still have a question or problem, post it to the
    <a href="news:comp.sys.hp.mpe">comp.sys.hp.mpe</a> newsgroup or
    the associated <a
    href="http://jazz.external.hp.com/papers/hp3000-info.html">HP3000-L
    mailing list</a>, where many Apache users and several
    contributors are more than willing to answer new and obscure
    questions about using Apache on MPE/iX.</p>

    <p><a
    href="http://groups.google.com/groups?hl=en&amp;lr=&amp;safe=off&amp;group=comp.sys.hp.mpe">
    groups.google.com's newsgroup archive</a> offers easy browsing
    of previous questions. Searching the newsgroup archives, you
    will usually find your question was already asked and answered
    by other users!</p>
    <hr />

    <ul>
      <li><a href="#req">Requirements</a></li>

      <li><a href="#implement">Implementation
      Considerations</a></li>

      <li><a href="#binaries">Binary Distributions</a></li>

      <li><a href="#accounting">Create the Accounting
      Structure</a></li>

      <li><a href="#down">Downloading Apache</a></li>

      <li><a href="#compile">Compiling Apache</a></li>

      <li><a href="#inst">Installing Apache</a></li>

      <li><a href="#config">Configuring Apache</a></li>

      <li><a href="#run">Running Apache</a></li>

      <li><a href="#control">Controlling Apache</a></li>
    </ul>
    <hr />

    <h2><a id="req" name="req"></a>Requirements</h2>
    Apache 1.3 requires MPE/iX 6.0 or greater.&nbsp; It will NOT
    run on earlier releases of MPE/iX.&nbsp; The following MPE/iX
    patches (or their superseding descendants) are relevant to
    Apache: 

    <ul>
      <li>MPE/iX 6.0:</li>

      <li style="list-style: none">
        <ul>
          <li>MPEKXT3B - fixes an MPE bug that results in transient
          "permission denied" errors being returned by the server
          to the browser.</li>

          <li>MPELX36A - enhances the kill() function so that MPE
          users with SM capability can send signals to Apache for
          shutdown, restart, etc.</li>

          <li>MPELX44C - fixes an MPE bug that prevents DSO modules
          from being dynamically loaded.</li>

          <li>MPELX51C - enhances the kill() function so that
          Apache can use it when the Apache parent UID is different
          from the Apache children UID (strongly recommended).</li>

          <li>NSTxxxxx - the latest network transport patch should
          always be installed when using TCP/IP applications such
          as Apache.</li>
        </ul>
      </li>

      <li>MPE/iX 6.5:</li>

      <li style="list-style: none">
        <ul>
          <li>MPELX44D - fixes an MPE bug that prevents DSO modules
          from being dynamically loaded.</li>

          <li>MPELX51D - enhances the kill() function so that
          Apache can use it when the Apache parent UID is different
          from the Apache children UID (strongly recommended).</li>

          <li>NSTxxxxx - the latest network transport patch should
          always be installed when using TCP/IP applications such
          as Apache.</li>
        </ul>
      </li>
    </ul>
    <hr width="100%" />

    <h2><a id="implement" name="implement"></a>Implementation
    Considerations</h2>
    While MPE has a very good POSIX implementation that enables
    fairly simple porting of Unix applications such as Apache,
    there are some Unix concepts which just don't exist or aren't
    fully implemented in MPE, and so this may force some
    functionality changes in the package being ported. 

    <h3>Significant MPE vs. Unix OS differences</h3>

    <ul>
      <li>MPE lacks the concept of a Unix UID=0 root user with
      special privileges.&nbsp; Where Unix functions require a user
      to be executing as root, MPE requires the user to be
      executing in priv mode, so the program file must be linked
      with PM (Priv Mode) capability, and the Unix function calls
      must be bracketed by GETPRIVMODE() and GETUSERMODE()
      calls.&nbsp; The following Unix functions used by Apache are
      affected:</li>

      <li style="list-style: none">
        <ul>
          <li>bind() for ports less than 1024</li>

          <li>setgid()</li>

          <li>setuid()</li>
        </ul>
      </li>

      <li>MPE's support for UIDs and GIDs is more limited than
      Unix.&nbsp; Every MPE account maps to a unique GID.&nbsp;
      Each MPE account can contain multiple MPE users, and every
      MPE user maps to a unique UID (UID 0 is not supported).&nbsp;
      The current UID for a process must correspond to an MPE user
      within the MPE account that corresponds to the current GID of
      the process.</li>

      <li>MPE child processes cannot survive the death of their
      parent.&nbsp; When the parent terminates, any remaining
      children will be killed.</li>

      <li>MPE doesn't initialize the envp parameter when invoking
      the main() of a new process.&nbsp; Use the global variable
      environ instead of envp.</li>

      <li>MPE link() exists, but always returns EIMPL.&nbsp; Use
      rename() or symlinks instead of hard links.</li>

      <li>MPE doesn't allow the @ character in filenames.</li>

      <li>MPE lacks support for TCP_NODELAY, but that's the default
      anyway.</li>

      <li>MPE lacks support for SO_KEEPALIVE.</li>

      <li>MPE lacks support for process groups.</li>

      <li>MPE inetd only passes stdin (and NOT stdout) to the
      invoked service.&nbsp; But you can write to stdin just
      fine.</li>
    </ul>

    <h3>Major Apache functionality issues</h3>

    <ul>
      <li>Beginning with HP-supported Apache 1.3.9 and HP WebWise
      MPE/iX Secure Web Server A.01.00 (based on Apache 1.3.9), the
      User and Group directives in httpd.conf are now
      unconditionally executed as corresponding setuid()/setgid()
      calls.&nbsp; Previously this was only done if HTTPD was being
      run as MANAGER.SYS.&nbsp; This functionality change was
      submitted back to the 1.3.13-dev source tree at
      www.apache.org.&nbsp; The Apache for Unix behavior is to only
      honor User and Group if running as root.</li>

      <li>Beginning with HP-supported Apache 1.3.9 and HP WebWise
      MPE/iX Secure Web Server A.01.00 (based on Apache 1.3.9), the
      SVIPC shared memory macros SHM_R and SHM_W have been modified
      from their traditional owner-only-read and owner-only-write
      values to be owner-and-group-read and owner-and-group-write
      on MPE/iX in order to allow increased parent/child
      flexibility in spite of MPE's limited POSIX UID/GID
      support.&nbsp; This functionality change was submitted back
      to the 1.3.13-dev source tree at www.apache.org.&nbsp; The
      Apache for Unix behavior uses the traditional owner-only
      values of SHM_R and SHM_W.</li>
    </ul>

    <h3>Minor Apache functionality issues</h3>

    <ul>
      <li>Apache for Unix must be run as root to bind to TCP ports
      1-1023. Apache for MPE must call GETPRIVMODE() to bind to TCP
      ports 1-1023; PM is not used for ports greater than 1023. The
      standard web server HTTP port is 80.</li>

      <li>Apache for Unix in standalone mode will detach itself and
      run in the background as a system-type process. Apache for
      MPE in standalone mode cannot detach itself and run in the
      background because MPE POSIX doesn't allow this (the detached
      child would be killed when the parent terminated).&nbsp;
      Therefore you must use an MPE batch job to run Apache in
      standalone mode.</li>

      <li>Apache for Unix uses process groups to manage child
      processes. Apache for MPE cannot use process groups because
      MPE POSIX doesn't support this. The implications of this are
      unknown.</li>

      <li>Apache for Unix uses the setsockopt() option TCP_NODELAY.
      Apache for MPE does not, because MPE doesn't support it. But
      TCP_NODELAY is the default MPE behavior anyway.</li>

      <li>Apache for Unix uses the setsockopt() option
      SO_KEEPALIVE.&nbsp; Apache for MPE does not, because MPE
      doesn't support it.</li>

      <li>Apache for Unix under inetd reads from the socket via
      stdin and writes via stdout. Apache for MPE under inetd reads
      *AND* writes the socket via stdin. I consider MPE 5.5 inetd
      to be broken and poorly documented, so I submitted SR
      5003355016 to address this. If HP ever alters the MPE inetd
      to pass the socket the way HPUX inetd does (not likely in the
      grand scheme of things), the existing Apache for MPE code
      will break.</li>

      <li>Apache for Unix will use the @ character in proxy cache
      filenames, but since @ is illegal in MPE filenames, Apache
      for MPE uses the % character instead.</li>
    </ul>
    <hr width="100%" />

    <h2><a id="binaries" name="binaries"></a>Binary
    Distributions</h2>
    HP ships a fully supported Apache binary distribution with the
    Fundamental Operating System (FOS) in MPE/iX 6.5 and
    later.&nbsp; This distribution can be found in the APACHE
    account. 

    <p>HP supplies fully supported Apache binary distributions for
    MPE/iX 6.0 or later available for downloading from <a
    href="http://jazz.external.hp.com/src/apache/">http://jazz.external.hp.com/src/apache/</a>.</p>

    <p>Mark Bixby supplies Apache binary distributions for MPE/iX
    available for downloading from <a
    href="http://www.bixby.org/mark/apacheix.html">http://www.bixby.org/mark/apacheix.html</a>.&nbsp;
    Binaries from bixby.org are NOT supported by HP.&nbsp; HP only
    supports binaries distributed by HP.</p>

    <p>All of the binary distributions mentioned above may possibly
    include functionality that hasn't yet been submitted back to
    the Apache Software Foundation (though submitting back is the
    intended goal).&nbsp; Please read the documentation that comes
    with these binaries in order to determine functionality
    differences (if any) compared to the latest sources available
    from the ASF.</p>

    <p>If you will be using one of these binary distributions,
    please stop reading this document and start reading the
    specific distribution documentation for installation
    details.</p>
    <hr width="100%" />

    <h2><a id="accounting" name="accounting"></a>Create the
    Accounting Structure</h2>
    Apache can be installed under the account of your choice.&nbsp;
    For the purposes of this document, the APACHE account will be
    used: 

    <ol>
      <li><tt><font size="+1">:HELLO MANAGER.SYS</font></tt></li>

      <li><tt><font size="+1">:NEWACCT APACHE,MGR</font></tt></li>

      <li><tt><font size="+1">:ALTACCT
      APACHE;PASS=xxxxxxxx;CAP=AM,AL,ND,SF,BA,IA,PM,PH</font></tt></li>

      <li><tt><font size="+1">:ALTGROUP
      PUB.APACHE;CAP=BA,IA,PM,PH;ACCESS=(R,L,X:AC;W,A,S:AL)</font></tt></li>

      <li><tt><font size="+1">:ALTUSER
      MGR.APACHE;CAP=AM,AL,ND,SF,BA,IA,PM,PH;HOME=PUB</font></tt></li>

      <li><tt><font size="+1">:NEWUSER
      SERVER.APACHE</font></tt></li>

      <li><tt><font size="+1">:ALTUSER
      SERVER.APACHE;CAP=ND,SF,BA,IA,PH;HOME=PUB</font></tt></li>
    </ol>

    <h2><a id="down" name="down"></a>Downloading Apache</h2>
    Use your web browser to download the Apache source tarball from
    <a
    href="http://www.apache.org/dist/httpd/">http://www.apache.org/dist/httpd/</a>.&nbsp;
    Then ftp upload the tarball to your e3000 as show below: 
<pre>
C:\Temp&gt;ftp 3000.host.name
Connected to 3000.host.name.
220 HP ARPA FTP Server [A0009H09] (C) Hewlett-Packard Co. 1990
User (3000.host.name:(none)): MGR.APACHE
331 Password required for MGR.APACHE.  Syntax: acctpass
Password:xxxxxxxx
230 User logged on
ftp&gt; quote type L 8
200 Type set to L (byte size 8).
ftp&gt; put apache_v.u.ff.tar.Z /tmp/apache.tar.Z
200 PORT command ok.
150 File: /tmp/apache.tar.Z opened; data connection will be opened
226 Transfer complete.
ftp: 2685572 bytes sent in 2.75Seconds 976.57Kbytes/sec.
ftp&gt; quit
221 Server is closing command connection
</pre>
    Unpack the tarball: 

    <ol>
      <li><tt>:HELLO MGR.APACHE</tt></li>

      <li><tt>:XEQ SH.HPBIN.SYS -L</tt></li>

      <li><tt>$ mkdir src</tt></li>

      <li><tt>$ chmod 700 src</tt></li>

      <li><tt>$ cd src</tt></li>

      <li><tt>$ tar xvfopz /tmp/apache.tar.Z</tt></li>
    </ol>

    <h2><a id="compile" name="compile"></a>Compiling Apache</h2>
    It is STRONGLY recommended to use gcc instead of the HP C/iX
    compiler.&nbsp; You can obtain gcc from <a
    href="http://jazz.external.hp.com/src/gnu/gnuframe.html">http://jazz.external.hp.com/src/gnu/gnuframe.html</a>.
    

    <ol>
      <li><tt>$ cd apache_v.uu.ff</tt></li>

      <li><tt>$ ./configure --prefix=/APACHE/PUB
      --enable-module=xxx --enable-module=yyy ...etc...</tt></li>

      <li><tt>$ make</tt></li>
    </ol>

    <h2><a id="inst" name="inst"></a>Installing Apache</h2>

    <ol>
      <li><tt>$ make install</tt></li>

      <li><tt>$ cd /APACHE/PUB</tt></li>

      <li><tt>$ mv bin/httpd HTTPD</tt></li>

      <li><tt>$ ln -s HTTPD bin/httpd</tt></li>

      <li><tt>$ callci "xeq linkedit.pub.sys 'altprog
      HTTPD;cap=ia,ba,ph,pm'"</tt></li>
    </ol>

    <h2><a id="config" name="config"></a>Configuring Apache</h2>
    Edit /APACHE/PUB/conf/httpd.conf and customize as needed for
    your environment.&nbsp; Be sure to make the following mandatory
    changes: 

    <ul>
      <li>User SERVER.APACHE</li>

      <li>Group APACHE</li>
    </ul>

    <h2><a id="run" name="run"></a>Running Apache</h2>
    Simply create and :STREAM the following standalone server job
    in order to start Apache: 
<pre>
!JOB JHTTPD,MGR.APACHE;OUTCLASS=,2
!XEQ SH.HPBIN.SYS "-c 'umask 007; ./HTTPD -f /APACHE/PUB/conf/httpd.conf'"
!eoj
</pre>

    <h2><a id="control" name="control"></a>Controlling Apache</h2>
    Log on as MGR.APACHE (or MANAGER.SYS or any other SM user if
    you've installed MPELX36A on 6.0) in order to shutdown or
    restart Apache via the use of signals. 

    <p>To shut down Apache from the POSIX shell:</p>
<pre>
$ kill `cat /APACHE/PUB/logs/httpd.pid`
</pre>
    To shut down Apache from the CI: 
<pre>
:XEQ SH.HPBIN.SYS '-c "kill `cat /APACHE/PUB/logs/httpd.pid`"'
</pre>
        <hr />

    <h3 align="CENTER">Apache HTTP Server</h3>
    <a href="./"><img src="images/index.gif" alt="Index" /></a>

  </body>
</html>