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 html 4.0 transitional//en">
<html>
<head>
<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><a href="http://www.deja.com/group/comp.sys.hp.mpe">deja.com's newsgroup
archives</a> offer 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 NAME="req"></a>Requirements</h2>
Apache 1.3 requires MPE/iX 6.0 or greater. It will NOT run on earlier
releases of MPE/iX. The following MPE/iX patches (or their superseding
descendants) are relevant to Apache:
<ul>
<li>
MPE/iX 6.0:</li>
<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>
MPE/iX 6.5:</li>
<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>
</ul>
<h2>
<hr WIDTH="100%"></h2>
<h2>
<a 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.
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. The following Unix functions
used by Apache are affected:</li>
<ul>
<li>
bind() for ports less than 1024</li>
<li>
setgid()</li>
<li>
setuid()</li>
</ul>
<li>
MPE's support for UIDs and GIDs is more limited than Unix. Every
MPE account maps to a unique GID. Each MPE account can contain multiple
MPE users, and every MPE user maps to a unique UID (UID 0 is not supported).
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. 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. Use the global variable environ instead of envp.</li>
<li>
MPE link() exists, but always returns EIMPL. 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.
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. Previously this was only done if HTTPD was being run as MANAGER.SYS.
This functionality change was submitted back to the 1.3.13-dev source tree
at www.apache.org. 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. This functionality change
was submitted back to the 1.3.13-dev source tree at www.apache.org.
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). 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. 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>
<h2>
<hr WIDTH="100%"></h2>
<h2>
<a 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. 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>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>.
Binaries from bixby.org are NOT supported by HP. HP only supports
binaries distributed by HP.
<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). 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>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.
<h2>
<hr WIDTH="100%"></h2>
<h2>
<a NAME="accounting"></a>Create the Accounting Structure</h2>
Apache can be installed under the account of your choice. 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 NAME="down"></a>Downloading Apache</h2>
Use your web browser to download the Apache source tarball from <a href="http://www.apache.org/dist/">http://www.apache.org/dist/</a>.
Then ftp upload the tarball to your e3000 as show below:
<pre>C:\Temp>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> quote type L 8
200 Type set to L (byte size 8).
ftp> 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> 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 NAME="compile"></a>Compiling Apache</h2>
It is STRONGLY recommended to use gcc instead of the HP C/iX compiler.
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 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 NAME="config"></a>Configuring Apache</h2>
Edit /APACHE/PUB/conf/httpd.conf and customize as needed for your environment.
Be sure to make the following mandatory changes:
<ul>
<li>
User SERVER.APACHE</li>
<li>
Group APACHE</li>
</ul>
<h2>
<a 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 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:
<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>
|