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,38 +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>
187
+
<informalexample>
189
188
<para>
190
-
For PHP 7:
189
+
For PHP 8:
191
190
</para>
192
191
<programlisting role="apache-conf">
193
192
<![CDATA[
194
-
LoadModule php7_module modules/libphp7.so
193
+
LoadModule php_module modules/libphp.so
195
194
]]>
196
-
</programlisting>
197
-
</example>
195
+
</programlisting>
196
+
</informalexample>
198
197

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

210
-
</listitem>
209
+
</listitem>
211
210

212
-
<listitem>
211
+
<listitem>
213
212

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

223
222

224
-
<example>
223
+
<informalexample>
225
224
<programlisting role="apache-conf">
226
225
<![CDATA[
227
226
<FilesMatch \.php$>
...
...
@@ -229,14 +228,14 @@ LoadModule php5_module modules/libphp5.so
229
228
</FilesMatch>
230
229
]]>
231
230
</programlisting>
232
-
</example>
231
+
</informalexample>
233
232

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

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

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

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

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

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

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

300
299
<para>OR</para>
301
300

302
-
<example>
301
+
<informalexample>
303
302
<screen>
304
303
<![CDATA[
305
304
service httpd restart
306
305
]]>
307
306
</screen>
308
-
</example>
307
+
</informalexample>
309
308

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