install/unix/apache2.xml
a89c6d71c7b65e3de84f26230fbf72c9b8948adf
...
...
@@ -29,11 +29,12 @@
29
29
</para>
30
30

31
31
<para>
32
-
There are currently two versions of Apache 2.x - there's 2.0 and 2.2.
33
-
While there are various reasons for choosing each, 2.2 is the current
32
+
There are currently two versions of Apache 2.x - there's 2.4 and 2.2.
33
+
While there are various reasons for choosing each, 2.4 is the current
34
34
latest version, and the one that is recommended, if that option is
35
35
available to you. However, the instructions here will work for either
36
-
2.0 or 2.2.
36
+
2.4 or 2.2. Note that Apache httpd 2.2 is officially End Of Life,
37
+
and no new development or patches are being issued for it.
37
38
</para>
38
39

39
40
<orderedlist>
...
...
@@ -41,27 +42,25 @@
41
42
<para>Obtain the Apache HTTP server from the location listed above,
42
43
and unpack it:</para>
43
44

44
-
<example>
45
+
<informalexample>
45
46
<screen>
46
47
<![CDATA[
47
-
gzip -d httpd-2_x_NN.tar.gz
48
-
tar -xf httpd-2_x_NN.tar
48
+
tar -xzf httpd-2.x.NN.tar.gz
49
49
]]>
50
50
</screen>
51
-
</example>
51
+
</informalexample>
52
52
</listitem>
53
53

54
54
<listitem>
55
55
<para>Likewise, obtain and unpack the PHP source:</para>
56
56

57
-
<example>
57
+
<informalexample>
58
58
<screen>
59
59
<![CDATA[
60
-
gunzip php-NN.tar.gz
61
-
tar -xf php-NN.tar
60
+
tar -xzf php-NN.tar.gz
62
61
]]>
63
62
</screen>
64
-
</example>
63
+
</informalexample>
65
64
</listitem>
66
65
67
66
<listitem>
...
...
@@ -70,7 +69,7 @@ tar -xf php-NN.tar
70
69
more details on building Apache.
71
70
</para>
72
71

73
-
<example>
72
+
<informalexample>
74
73
<screen>
75
74
<![CDATA[
76
75
cd httpd-2_x_NN
...
...
@@ -79,7 +78,7 @@ make
79
78
make install
80
79
]]>
81
80
</screen>
82
-
</example>
81
+
</informalexample>
83
82
</listitem>
84
83

85
84
<listitem>
...
...
@@ -89,23 +88,23 @@ make install
89
88
To test the installation use your normal procedure for starting
90
89
the Apache server, e.g.:
91
90

92
-
<example>
91
+
<informalexample>
93
92
<screen>
94
93
<![CDATA[
95
94
/usr/local/apache2/bin/apachectl start
96
95
]]>
97
96
</screen>
98
-
</example>
97
+
</informalexample>
99
98

100
99
and stop the server to go on with the configuration for PHP:
101
100

102
-
<example>
101
+
<informalexample>
103
102
<screen>
104
103
<![CDATA[
105
104
/usr/local/apache2/bin/apachectl stop
106
105
]]>
107
106
</screen>
108
-
</example>
107
+
</informalexample>
109
108
</para>
110
109
</listitem>
111
110

...
...
@@ -124,16 +123,16 @@ match your path for apxs, but if you installed Apache some other way, you'll
124
123
need to adjust the path to apxs accordingly. Note that some distros may rename
125
124
apxs to apxs2.
126
125
</para>
127
-
<example>
126
+
<informalexample>
128
127
<screen>
129
128
<![CDATA[
130
129
cd ../php-NN
131
-
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
130
+
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pdo-mysql
132
131
make
133
132
make install
134
133
]]>
135
134
</screen>
136
-
</example>
135
+
</informalexample>
137
136

138
137
<para>
139
138
If you decide to change your configure options after installation,
...
...
@@ -155,13 +154,13 @@ make install
155
154
Setup your php.ini
156
155
</para>
157
156
158
-
<example>
157
+
<informalexample>
159
158
<screen>
160
159
<![CDATA[
161
160
cp php.ini-development /usr/local/lib/php.ini
162
161
]]>
163
162
</screen>
164
-
</example>
163
+
</informalexample>
165
164

166
165
<para>
167
166
You may edit your .ini file to set PHP options. If you prefer having
...
...
@@ -178,24 +177,38 @@ cp php.ini-development /usr/local/lib/php.ini
178
177

179
178
<listitem>
180
179

181
-
<para>
182
-
Edit your httpd.conf to load the PHP module. The path on the right hand
183
-
side of the LoadModule statement must point to the path of the PHP
184
-
module on your system. The make install from above may have already
185
-
added this for you, but be sure to check.
186
-
</para>
180
+
<para>
181
+
Edit your httpd.conf to load the PHP module. The path on the right hand
182
+
side of the LoadModule statement must point to the path of the PHP
183
+
module on your system. The make install from above may have already
184
+
added this for you, but be sure to check.
185
+
</para>
187
186

188
-
<example>
189
-
<programlisting role="apache-conf">
187
+
<informalexample>
188
+
<para>
189
+
For PHP 8:
190
+
</para>
191
+
<programlisting role="apache-conf">
190
192
<![CDATA[
191
-
LoadModule php5_module modules/libphp5.so
193
+
LoadModule php_module modules/libphp.so
194
+
]]>
195
+
</programlisting>
196
+
</informalexample>
197
+

198
+
<informalexample>
199
+
<para>
200
+
For PHP 7:
201
+
</para>
202
+
<programlisting role="apache-conf">
203
+
<![CDATA[
204
+
LoadModule php7_module modules/libphp7.so
192
205
]]>
193
206
</programlisting>
194
-
</example>
207
+
</informalexample>
195
208

196
-
</listitem>
209
+
</listitem>
197
210

198
-
<listitem>
211
+
<listitem>
199
212

200
213
<para>
201
214
Tell Apache to parse certain extensions as PHP. For example, let's have
...
...
@@ -207,7 +220,7 @@ LoadModule php5_module modules/libphp5.so
207
220
</para>
208
221

209
222

210
-
<example>
223
+
<informalexample>
211
224
<programlisting role="apache-conf">
212
225
<![CDATA[
213
226
<FilesMatch \.php$>
...
...
@@ -215,14 +228,14 @@ LoadModule php5_module modules/libphp5.so
215
228
</FilesMatch>
216
229
]]>
217
230
</programlisting>
218
-
</example>
231
+
</informalexample>
219
232

220
233
<para>
221
234
Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and
222
235
.phtml files to be executed as PHP, but nothing else, we'd use this:
223
236
</para>
224
237

225
-
<example>
238
+
<informalexample>
226
239
<programlisting role="apache-conf">
227
240
<![CDATA[
228
241
<FilesMatch "\.ph(p[2-6]?|tml)$">
...
...
@@ -230,14 +243,14 @@ Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and
230
243
</FilesMatch>
231
244
]]>
232
245
</programlisting>
233
-
</example>
246
+
</informalexample>
234
247

235
248
<para>
236
249
And to allow .phps files to be handled by the php source filter, and
237
250
displayed as syntax-highlighted source code, use this:
238
251
</para>
239
252

240
-
<example>
253
+
<informalexample>
241
254
<programlisting role="apache-conf">
242
255
<![CDATA[
243
256
<FilesMatch "\.phps$">
...
...
@@ -245,7 +258,7 @@ Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and
245
258
</FilesMatch>
246
259
]]>
247
260
</programlisting>
248
-
</example>
261
+
</informalexample>
249
262

250
263
<para>
251
264
mod_rewrite may be used To allow any arbitrary .php file to be displayed
...
...
@@ -253,14 +266,14 @@ Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and
253
266
to a .phps file:
254
267
</para>
255
268

256
-
<example>
269
+
<informalexample>
257
270
<programlisting role="apache-conf">
258
271
<![CDATA[
259
272
RewriteEngine On
260
273
RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source]
261
274
]]>
262
275
</programlisting>
263
-
</example>
276
+
</informalexample>
264
277

265
278
<para>
266
279
The php source filter should not be enabled on production systems, where
...
...
@@ -275,23 +288,23 @@ RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source]
275
288
Use your normal procedure for starting the Apache server, e.g.:
276
289
</para>
277
290
278
-
<example>
291
+
<informalexample>
279
292
<screen>
280
293
<![CDATA[
281
294
/usr/local/apache2/bin/apachectl start
282
295
]]>
283
296
</screen>
284
-
</example>
297
+
</informalexample>
285
298

286
299
<para>OR</para>
287
300

288
-
<example>
301
+
<informalexample>
289
302
<screen>
290
303
<![CDATA[
291
304
service httpd restart
292
305
]]>
293
306
</screen>
294
-
</example>
307
+
</informalexample>
295
308

296
309
</listitem>
297
310
</orderedlist>
...
...
@@ -310,13 +323,13 @@ service httpd restart
310
323
adding the following option to the argument passed to ./configure, in
311
324
step 3 above:
312
325
</para>
313
-
<example>
326
+
<informalexample>
314
327
<screen>
315
328
<![CDATA[
316
329
--with-mpm=worker
317
330
]]>
318
331
</screen>
319
-
</example>
332
+
</informalexample>
320
333
<para>
321
334
This should not be undertaken without being aware of the consequences of
322
335
this decision, and having at least a fair understanding of
...
...
@@ -333,7 +346,7 @@ service httpd restart
333
346
<note>
334
347
<para>
335
348
To build a multithreaded version of Apache, the target system must support threads.
336
-
In this case, PHP should also be built with experimental
349
+
In this case, PHP should also be built with
337
350
Zend Thread Safety (ZTS). Under this configuration, not all extensions will be available.
338
351
The recommended setup is to build Apache with the default
339
352
<filename>prefork</filename> MPM-Module.
340
353