1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY apache-download-http
|
---|
8 | "http://archive.apache.org/dist/httpd/httpd-&apache-version;.tar.bz2">
|
---|
9 | <!ENTITY apache-download-ftp
|
---|
10 | "ftp://apache.mirrors.pair.com/httpd/httpd-&apache-version;.tar.bz2">
|
---|
11 | <!ENTITY apache-md5sum "7d3001c7a26b985d17caa367a868f11c">
|
---|
12 | <!ENTITY apache-size "3.9 MB">
|
---|
13 | <!ENTITY apache-buildsize "94 MB">
|
---|
14 | <!ENTITY apache-time "0.8 SBU">
|
---|
15 | ]>
|
---|
16 |
|
---|
17 | <sect1 id="apache" xreflabel="Apache-&apache-version;">
|
---|
18 | <?dbhtml filename="apache.html"?>
|
---|
19 |
|
---|
20 | <sect1info>
|
---|
21 | <othername>$LastChangedBy$</othername>
|
---|
22 | <date>$Date$</date>
|
---|
23 | </sect1info>
|
---|
24 |
|
---|
25 | <title>Apache-&apache-version;</title>
|
---|
26 |
|
---|
27 | <indexterm zone="apache">
|
---|
28 | <primary sortas="a-Apache">Apache</primary>
|
---|
29 | </indexterm>
|
---|
30 |
|
---|
31 | <sect2 role="package">
|
---|
32 | <title>Introduction to Apache</title>
|
---|
33 |
|
---|
34 | <para>
|
---|
35 | The <application>Apache</application> package contains an open-source HTTP
|
---|
36 | server. It is useful for creating local intranet web sites or running huge
|
---|
37 | web serving operations.
|
---|
38 | </para>
|
---|
39 |
|
---|
40 | &lfs71_checked;
|
---|
41 |
|
---|
42 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
43 | <itemizedlist spacing="compact">
|
---|
44 | <listitem>
|
---|
45 | <para>
|
---|
46 | Download (HTTP): <ulink url="&apache-download-http;"/>
|
---|
47 | </para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>
|
---|
51 | Download (FTP): <ulink url="&apache-download-ftp;"/>
|
---|
52 | </para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download MD5 sum: &apache-md5sum;
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Download size: &apache-size;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Estimated disk space required: &apache-buildsize;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | <listitem>
|
---|
70 | <para>
|
---|
71 | Estimated build time: &apache-time;
|
---|
72 | </para>
|
---|
73 | </listitem>
|
---|
74 | </itemizedlist>
|
---|
75 |
|
---|
76 | <bridgehead renderas="sect3">Apache Dependencies</bridgehead>
|
---|
77 |
|
---|
78 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
79 | <para role="required">
|
---|
80 | <xref linkend="apr-util"/>
|
---|
81 | </para>
|
---|
82 |
|
---|
83 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
84 | <para role="optional">
|
---|
85 | <xref linkend="openldap"/>,
|
---|
86 | <xref linkend="db"/>,
|
---|
87 | <xref linkend="expat"/>,
|
---|
88 | <xref linkend="openssl"/>,
|
---|
89 | <xref linkend="pcre"/>,
|
---|
90 | <xref linkend="rsync"/>,
|
---|
91 | <xref linkend="doxygen"/>,
|
---|
92 | <xref linkend="lynx"/> and
|
---|
93 | <ulink url="http://www.distcache.org/">distcache</ulink>
|
---|
94 | </para>
|
---|
95 |
|
---|
96 | <para condition="html" role="usernotes">
|
---|
97 | User Notes: <ulink url="&blfs-wiki;/apache"/>
|
---|
98 | </para>
|
---|
99 | </sect2>
|
---|
100 |
|
---|
101 | <sect2 role="installation">
|
---|
102 | <title>Installation of Apache</title>
|
---|
103 |
|
---|
104 | <para>
|
---|
105 | For security reasons, running the server as an unprivileged user and group
|
---|
106 | is strongly encouraged. Create the following group and user using the
|
---|
107 | following commands as <systemitem class="username">root</systemitem>:
|
---|
108 | </para>
|
---|
109 |
|
---|
110 | <screen role="root"><userinput>groupadd -g 25 apache &&
|
---|
111 | useradd -c "Apache Server" -d /dev/null -g apache \
|
---|
112 | -s /bin/false -u 25 apache</userinput></screen>
|
---|
113 |
|
---|
114 | <note>
|
---|
115 | <para>
|
---|
116 | The above command directs the <application>Apache</application> user's
|
---|
117 | home directory to <filename>/dev/null</filename>. This may not work
|
---|
118 | for some add-ons such as
|
---|
119 | <ulink url='http://www.viewvc.org/'><application>ViewVC</application></ulink>,
|
---|
120 | a browser interface for CVS and Subversion version control repositories.
|
---|
121 | See the User Notes for details for specific applications.
|
---|
122 | </para>
|
---|
123 | </note>
|
---|
124 |
|
---|
125 | <para>
|
---|
126 | Build and install <application>Apache</application> by running the
|
---|
127 | following commands:
|
---|
128 | </para>
|
---|
129 |
|
---|
130 | <screen><userinput>cat >> config.layout << "HERE_DOC" &&
|
---|
131 | # BLFS FHS layout
|
---|
132 | <Layout FHS>
|
---|
133 | prefix: /usr
|
---|
134 | exec_prefix: ${prefix}
|
---|
135 | bindir: ${exec_prefix}/bin
|
---|
136 | sbindir: ${exec_prefix}/sbin
|
---|
137 | libdir: ${exec_prefix}/lib
|
---|
138 | libexecdir: ${exec_prefix}/libexec/apache
|
---|
139 | mandir: ${prefix}/share/man
|
---|
140 | sysconfdir: /etc/apache
|
---|
141 | datadir: /srv/www
|
---|
142 | installbuilddir: ${libexecdir}/build
|
---|
143 | errordir: ${datadir}/error
|
---|
144 | iconsdir: ${datadir}/icons
|
---|
145 | htdocsdir: ${datadir}/htdocs
|
---|
146 | manualdir: ${datadir}/manual
|
---|
147 | cgidir: ${datadir}/cgi-bin
|
---|
148 | includedir: ${prefix}/include/apache
|
---|
149 | localstatedir: ${datadir}
|
---|
150 | runtimedir: /var/run
|
---|
151 | logfiledir: /var/log/apache
|
---|
152 | proxycachedir: /var/cache/apache/proxy
|
---|
153 | </Layout>
|
---|
154 | HERE_DOC
|
---|
155 | ./configure --enable-layout=FHS --enable-mods-shared=all &&
|
---|
156 | make</userinput></screen>
|
---|
157 |
|
---|
158 | <para>
|
---|
159 | This package does not come with a test suite.
|
---|
160 | </para>
|
---|
161 |
|
---|
162 | <para>
|
---|
163 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
164 | </para>
|
---|
165 |
|
---|
166 | <screen role="root"><userinput>make install &&
|
---|
167 | chown -v root:root /usr/bin/{apxs,dbmmanage} \
|
---|
168 | /usr/sbin/{apachectl,envvars{,-std}} \
|
---|
169 | /usr/libexec/apache/httpd.exp \
|
---|
170 | /usr/share/man/man1/{ab,apxs,dbmmanage,ht{dbm,digest,passwd,txt2dbm},logresolve}.1 \
|
---|
171 | /usr/share/man/man8/{apachectl,htcacheclean,httpd,rotatelogs,suexec}.8 &&
|
---|
172 | chown -v -R apache:apache /srv/www</userinput></screen>
|
---|
173 |
|
---|
174 | <para>
|
---|
175 | Also as the <systemitem class="username">root</systemitem> user,
|
---|
176 | optionally install the html docs:
|
---|
177 | </para>
|
---|
178 |
|
---|
179 | <screen role="root"><userinput>mkdir -p /usr/share/doc/httpd-&apache-version;/style &&
|
---|
180 | for thing in docs/manual/*.html.en
|
---|
181 | do
|
---|
182 | tmp=${thing%.en}
|
---|
183 | cp ${thing} /usr/share/doc/httpd-&apache-version;/${tmp##*/}
|
---|
184 | done
|
---|
185 | cp -rf docs/manual/images /usr/share/doc/httpd-&apache-version; &&
|
---|
186 | cp -rf docs/manual/style/css /usr/share/doc/httpd-&apache-version;/style &&
|
---|
187 | for directory in developer faq howto misc mod platform programs rewrite ssl vhosts
|
---|
188 | do
|
---|
189 | mkdir -p /usr/share/doc/httpd-&apache-version;/${directory}
|
---|
190 | for thing in docs/manual/${directory}/*.html.en
|
---|
191 | do
|
---|
192 | tmp=${thing%.en}
|
---|
193 | cp ${thing} /usr/share/doc/httpd-&apache-version;/${directory}/${tmp##*/}
|
---|
194 | done
|
---|
195 | done
|
---|
196 | sed -i \
|
---|
197 | '/developer\|faq\|misc\|mod\|programs\|rewrite\|ssl\|vhosts/s#/"#/index.html"#' \
|
---|
198 | /usr/share/doc/httpd-&apache-version;/index.html</userinput></screen>
|
---|
199 | </sect2>
|
---|
200 |
|
---|
201 | <sect2 role="commands">
|
---|
202 | <title>Command Explanations</title>
|
---|
203 |
|
---|
204 | <para>
|
---|
205 | <parameter>--enable-mods-shared=all</parameter>: The modules should be
|
---|
206 | compiled and used as Dynamic Shared Objects (DSOs) so they can be included
|
---|
207 | and excluded from the server using the run-time configuration directives.
|
---|
208 | </para>
|
---|
209 |
|
---|
210 | <para>
|
---|
211 | <command>chown root:root ...</command>: This command changes the ownership
|
---|
212 | of some installed files, the result of building the package as a user
|
---|
213 | other than <systemitem class="username">root</systemitem>.
|
---|
214 | </para>
|
---|
215 |
|
---|
216 | <para>
|
---|
217 | <command>chown -R apache:apache /srv/www</command>: By default, the
|
---|
218 | installation process installs files (documentation, error messages,
|
---|
219 | default icons, etc.) with the ownership of the user that extracted the
|
---|
220 | files from the tar file. If you want to change the ownership to another
|
---|
221 | user, you should do so at this point. The only requirement is that the
|
---|
222 | document directories need to be accessible by the <command>httpd</command>
|
---|
223 | process with (r-x) permissions and files need to be readable (r--) by the
|
---|
224 | <systemitem class="username">apache</systemitem> user.
|
---|
225 | </para>
|
---|
226 | </sect2>
|
---|
227 |
|
---|
228 | <sect2 role="configuration">
|
---|
229 | <title>Configuring Apache</title>
|
---|
230 |
|
---|
231 | <sect3 id="apache-config">
|
---|
232 | <title>Config Files</title>
|
---|
233 |
|
---|
234 | <para>
|
---|
235 | <filename>/etc/apache/*</filename>
|
---|
236 | </para>
|
---|
237 |
|
---|
238 | <indexterm zone="apache apache-config">
|
---|
239 | <primary sortas="e-etc-apache">/etc/apache/*</primary>
|
---|
240 | </indexterm>
|
---|
241 |
|
---|
242 | <indexterm zone="apache apache-config">
|
---|
243 | <primary sortas="e-etc-apache-httpd.conf">/etc/apache/httpd.conf</primary>
|
---|
244 | </indexterm>
|
---|
245 | </sect3>
|
---|
246 |
|
---|
247 | <sect3>
|
---|
248 | <title>Configuration Information</title>
|
---|
249 |
|
---|
250 | <para>
|
---|
251 | The main configuration file is named
|
---|
252 | <filename>/etc/apache/httpd.conf</filename>. Modify it so that the HTTP
|
---|
253 | server runs as the dedicated user and group:
|
---|
254 | </para>
|
---|
255 |
|
---|
256 | <screen role="root"><userinput>sed -i "s/daemon$/apache/" /etc/apache/httpd.conf</userinput></screen>
|
---|
257 |
|
---|
258 | <para>
|
---|
259 | See <ulink url="/usr/share/doc/httpd-&apache-version;/configuring.html"/>
|
---|
260 | for detailed instructions on customising your
|
---|
261 | <application>Apache</application> HTTP server configuration file.
|
---|
262 | </para>
|
---|
263 | </sect3>
|
---|
264 |
|
---|
265 | <sect3 id="httpd-init">
|
---|
266 | <title>Boot Script</title>
|
---|
267 |
|
---|
268 | <para>
|
---|
269 | If you want the <application>Apache</application> server to
|
---|
270 | start automatically when the system is booted, install the
|
---|
271 | <filename>/etc/rc.d/init.d/httpd</filename> init script included
|
---|
272 | in the <xref linkend="bootscripts"/> package.
|
---|
273 | </para>
|
---|
274 |
|
---|
275 | <indexterm zone="apache httpd-init">
|
---|
276 | <primary sortas="f-apache">apache</primary>
|
---|
277 | </indexterm>
|
---|
278 |
|
---|
279 | <screen role="root"><userinput>make install-httpd</userinput></screen>
|
---|
280 | </sect3>
|
---|
281 | </sect2>
|
---|
282 |
|
---|
283 | <sect2 role="content">
|
---|
284 | <title>Contents</title>
|
---|
285 |
|
---|
286 | <segmentedlist>
|
---|
287 | <segtitle>Installed Programs</segtitle>
|
---|
288 | <segtitle>Installed Directories</segtitle>
|
---|
289 |
|
---|
290 | <seglistitem>
|
---|
291 | <seg>
|
---|
292 | ab, apachectl, apxs, checkgid, dbmmanage, htcacheclean, htdbm,
|
---|
293 | htdigest, htpasswd, httpd, httxt2dbm, logresolve and rotatelogs
|
---|
294 | </seg>
|
---|
295 | <seg>
|
---|
296 | /etc/apache, /srv/www, /usr/include/apache and /var/log/apache.
|
---|
297 | </seg>
|
---|
298 | </seglistitem>
|
---|
299 | </segmentedlist>
|
---|
300 |
|
---|
301 | <variablelist>
|
---|
302 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
303 | <?dbfo list-presentation="list"?>
|
---|
304 | <?dbhtml list-presentation="table"?>
|
---|
305 |
|
---|
306 | <varlistentry id="ab">
|
---|
307 | <term><command>ab</command></term>
|
---|
308 | <listitem>
|
---|
309 | <para>
|
---|
310 | is a tool for benchmarking your <application>Apache</application>
|
---|
311 | HTTP server.
|
---|
312 | </para>
|
---|
313 | <indexterm zone="apache ab">
|
---|
314 | <primary sortas="b-ab">ab</primary>
|
---|
315 | </indexterm>
|
---|
316 | </listitem>
|
---|
317 | </varlistentry>
|
---|
318 |
|
---|
319 | <varlistentry id="apachectl">
|
---|
320 | <term><command>apachectl</command></term>
|
---|
321 | <listitem>
|
---|
322 | <para>
|
---|
323 | is a front end to the <application>Apache</application> HTTP server
|
---|
324 | which is designed to help the administrator control the functioning
|
---|
325 | of the <application>Apache</application> httpd daemon.
|
---|
326 | </para>
|
---|
327 | <indexterm zone="apache apachectl">
|
---|
328 | <primary sortas="b-apachectl">apachectl</primary>
|
---|
329 | </indexterm>
|
---|
330 | </listitem>
|
---|
331 | </varlistentry>
|
---|
332 |
|
---|
333 | <varlistentry id="apxs">
|
---|
334 | <term><command>apxs</command></term>
|
---|
335 | <listitem>
|
---|
336 | <para>
|
---|
337 | is a tool for building and installing extension modules for the
|
---|
338 | <application>Apache</application> HTTP server.
|
---|
339 | </para>
|
---|
340 | <indexterm zone="apache apxs">
|
---|
341 | <primary sortas="b-apxs">apxs</primary>
|
---|
342 | </indexterm>
|
---|
343 | </listitem>
|
---|
344 | </varlistentry>
|
---|
345 |
|
---|
346 | <varlistentry id="checkgid">
|
---|
347 | <term><command>checkgid</command></term>
|
---|
348 | <listitem>
|
---|
349 | <para>
|
---|
350 | is a program that checks whether it can setgid to the group
|
---|
351 | specified. This is to see if it is a valid group for Apache2 to use
|
---|
352 | at runtime. If the user (should be run as superuser) is in that
|
---|
353 | group, or can setgid to it, it will return 0.
|
---|
354 | </para>
|
---|
355 | <indexterm zone="apache checkgid">
|
---|
356 | <primary sortas="b-checkgid">checkgid</primary>
|
---|
357 | </indexterm>
|
---|
358 | </listitem>
|
---|
359 | </varlistentry>
|
---|
360 |
|
---|
361 | <varlistentry id="dbmmanage">
|
---|
362 | <term><command>dbmmanage</command></term>
|
---|
363 | <listitem>
|
---|
364 | <para>
|
---|
365 | is used to create and update the DBM format files used to store
|
---|
366 | usernames and passwords for basic authentication of HTTP users.
|
---|
367 | </para>
|
---|
368 | <indexterm zone="apache dbmmanage">
|
---|
369 | <primary sortas="b-dbmmanage">dbmmanage</primary>
|
---|
370 | </indexterm>
|
---|
371 | </listitem>
|
---|
372 | </varlistentry>
|
---|
373 |
|
---|
374 | <varlistentry id="htcacheclean">
|
---|
375 | <term><command>htcacheclean</command></term>
|
---|
376 | <listitem>
|
---|
377 | <para>
|
---|
378 | is used to clean up the disk cache.
|
---|
379 | </para>
|
---|
380 | <indexterm zone="apache htcacheclean">
|
---|
381 | <primary sortas="b-htcacheclean">htcacheclean</primary>
|
---|
382 | </indexterm>
|
---|
383 | </listitem>
|
---|
384 | </varlistentry>
|
---|
385 |
|
---|
386 | <varlistentry id="htdbm">
|
---|
387 | <term><command>htdbm</command></term>
|
---|
388 | <listitem>
|
---|
389 | <para>
|
---|
390 | is used to manipulate the DBM password databases.
|
---|
391 | </para>
|
---|
392 | <indexterm zone="apache htdbm">
|
---|
393 | <primary sortas="b-htdbm">htdbm</primary>
|
---|
394 | </indexterm>
|
---|
395 | </listitem>
|
---|
396 | </varlistentry>
|
---|
397 |
|
---|
398 | <varlistentry id="htdigest">
|
---|
399 | <term><command>htdigest</command></term>
|
---|
400 | <listitem>
|
---|
401 | <para>
|
---|
402 | is used to create and update the flat-files used to store usernames,
|
---|
403 | realms and passwords for digest authentication of HTTP users.
|
---|
404 | </para>
|
---|
405 | <indexterm zone="apache htdigest">
|
---|
406 | <primary sortas="b-htdigest">htdigest</primary>
|
---|
407 | </indexterm>
|
---|
408 | </listitem>
|
---|
409 | </varlistentry>
|
---|
410 |
|
---|
411 | <varlistentry id="htpasswd">
|
---|
412 | <term><command>htpasswd</command></term>
|
---|
413 | <listitem>
|
---|
414 | <para>
|
---|
415 | is used to create and update the flat-files used to store usernames
|
---|
416 | and passwords for basic authentication of HTTP users.
|
---|
417 | </para>
|
---|
418 | <indexterm zone="apache htpasswd">
|
---|
419 | <primary sortas="b-htpasswd">htpasswd</primary>
|
---|
420 | </indexterm>
|
---|
421 | </listitem>
|
---|
422 | </varlistentry>
|
---|
423 |
|
---|
424 | <varlistentry id="httpd">
|
---|
425 | <term><command>httpd</command></term>
|
---|
426 | <listitem>
|
---|
427 | <para>
|
---|
428 | is the <application>Apache</application> HTTP server program.
|
---|
429 | </para>
|
---|
430 | <indexterm zone="apache httpd">
|
---|
431 | <primary sortas="b-httpd">httpd</primary>
|
---|
432 | </indexterm>
|
---|
433 | </listitem>
|
---|
434 | </varlistentry>
|
---|
435 |
|
---|
436 | <varlistentry id="httxt2dbm">
|
---|
437 | <term><command>httxt2dbm</command></term>
|
---|
438 | <listitem>
|
---|
439 | <para>
|
---|
440 | is used to generate DBM files from text, for use in RewriteMap.
|
---|
441 | </para>
|
---|
442 | <indexterm zone="apache httxt2dbm">
|
---|
443 | <primary sortas="b-httxt2dbm">httxt2dbm</primary>
|
---|
444 | </indexterm>
|
---|
445 | </listitem>
|
---|
446 | </varlistentry>
|
---|
447 |
|
---|
448 | <varlistentry id="logresolve">
|
---|
449 | <term><command>logresolve</command></term>
|
---|
450 | <listitem>
|
---|
451 | <para>
|
---|
452 | is a post-processing program to resolve IP-addresses in
|
---|
453 | <application>Apache</application>'s access log files.
|
---|
454 | </para>
|
---|
455 | <indexterm zone="apache logresolve">
|
---|
456 | <primary sortas="b-logresolve">logresolve</primary>
|
---|
457 | </indexterm>
|
---|
458 | </listitem>
|
---|
459 | </varlistentry>
|
---|
460 |
|
---|
461 | <varlistentry id="rotatelogs">
|
---|
462 | <term><command>rotatelogs</command></term>
|
---|
463 | <listitem>
|
---|
464 | <para>
|
---|
465 | is a simple program for use in conjunction with
|
---|
466 | <application>Apache</application>'s piped log file feature.
|
---|
467 | </para>
|
---|
468 | <indexterm zone="apache rotatelogs">
|
---|
469 | <primary sortas="b-rotatelogs">rotatelogs</primary>
|
---|
470 | </indexterm>
|
---|
471 | </listitem>
|
---|
472 | </varlistentry>
|
---|
473 | </variablelist>
|
---|
474 | </sect2>
|
---|
475 | </sect1>
|
---|