[08254fc] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[08254fc] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[84ee2932] | 7 | <!ENTITY apache-download-http "http://www.apache.org/dist/httpd/httpd-&apache-version;.tar.bz2">
|
---|
| 8 | <!ENTITY apache-download-ftp "ftp://ftp.tux.org/pub/net/apache/dist/httpd/httpd-&apache-version;.tar.bz2">
|
---|
[1259e0e8] | 9 | <!ENTITY apache-md5sum "402b90a2e47205f94b3b1d91e1a8c459">
|
---|
| 10 | <!ENTITY apache-size "4.8 MB">
|
---|
| 11 | <!ENTITY apache-buildsize "91.5 MB">
|
---|
| 12 | <!ENTITY apache-time "2.1 SBU">
|
---|
[08254fc] | 13 | ]>
|
---|
| 14 |
|
---|
[7c7fa7d] | 15 | <sect1 id="apache" xreflabel="Apache-&apache-version;">
|
---|
[ab3a3af7] | 16 | <?dbhtml filename="apache.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
[a6ac43b] | 21 | <keywordset>
|
---|
| 22 | <keyword role="package">httpd-&apache-version;.tar</keyword>
|
---|
[2a5310e8] | 23 | <keyword role="ftpdir">httpd</keyword>
|
---|
[a6ac43b] | 24 | </keywordset>
|
---|
[ab3a3af7] | 25 | </sect1info>
|
---|
| 26 |
|
---|
| 27 | <title>Apache-&apache-version;</title>
|
---|
| 28 |
|
---|
| 29 | <indexterm zone="apache">
|
---|
| 30 | <primary sortas="a-Apache">Apache</primary>
|
---|
| 31 | </indexterm>
|
---|
| 32 |
|
---|
| 33 | <sect2 role="package">
|
---|
| 34 | <title>Introduction to Apache</title>
|
---|
| 35 |
|
---|
| 36 | <para>The <application>Apache</application> package contains an
|
---|
| 37 | open-source HTTP server. It is useful for creating local intranet
|
---|
| 38 | web sites or running huge web serving operations.</para>
|
---|
| 39 |
|
---|
| 40 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 41 | <itemizedlist spacing="compact">
|
---|
| 42 | <listitem>
|
---|
| 43 | <para>Download (HTTP): <ulink url="&apache-download-http;"/></para>
|
---|
| 44 | </listitem>
|
---|
| 45 | <listitem>
|
---|
| 46 | <para>Download (FTP): <ulink url="&apache-download-ftp;"/></para>
|
---|
| 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
| 49 | <para>Download MD5 sum: &apache-md5sum;</para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>Download size: &apache-size;</para>
|
---|
| 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>Estimated disk space required: &apache-buildsize;</para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>Estimated build time: &apache-time;</para>
|
---|
| 59 | </listitem>
|
---|
| 60 | </itemizedlist>
|
---|
| 61 |
|
---|
| 62 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 63 | <itemizedlist spacing='compact'>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>Required patch: <ulink
|
---|
| 66 | url="&patch-root;/httpd-&apache-version;-config-1.patch"/></para>
|
---|
| 67 | </listitem>
|
---|
| 68 | </itemizedlist>
|
---|
| 69 |
|
---|
| 70 | <bridgehead renderas="sect3">Apache Dependencies</bridgehead>
|
---|
| 71 |
|
---|
| 72 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[3f87e4a] | 73 | <para role="optional">
|
---|
| 74 | <!-- <xref linkend="db"/>, -->
|
---|
[1259e0e8] | 75 | <xref linkend="gdbm"/>,
|
---|
[ab3a3af7] | 76 | <xref linkend="openssl"/>,
|
---|
| 77 | <xref linkend="openldap"/>,
|
---|
[1259e0e8] | 78 | <xref linkend="postgresql"/>,
|
---|
| 79 | <ulink url="http://sqlite.org/">SQLite</ulink>,
|
---|
| 80 | <xref linkend="pcre"/>,
|
---|
| 81 | <xref linkend="pkgconfig"/>,
|
---|
[3f87e4a] | 82 | <xref linkend="expat"/>, and
|
---|
[1259e0e8] | 83 | <ulink url="http://www.distcache.org/">distcache</ulink></para>
|
---|
[ab3a3af7] | 84 |
|
---|
[3cb0c57] | 85 | <para condition="html" role="usernotes">User Notes:
|
---|
| 86 | <ulink url="&blfs-wiki;/apache"/></para>
|
---|
| 87 |
|
---|
[ab3a3af7] | 88 | </sect2>
|
---|
| 89 |
|
---|
| 90 | <sect2 role="installation">
|
---|
| 91 | <title>Installation of Apache</title>
|
---|
| 92 |
|
---|
| 93 | <para>For security reasons, running the server as an unprivileged user and
|
---|
| 94 | group is strongly encouraged. Create the following group and user using the
|
---|
[1259e0e8] | 95 | following commands
|
---|
| 96 | (as <systemitem class="username">root</systemitem>):</para>
|
---|
[ab3a3af7] | 97 |
|
---|
[b785ab29] | 98 | <screen role="root"><userinput>groupadd -g 25 apache &&
|
---|
| 99 | useradd -c "Apache Server" -d /dev/null -g apache \
|
---|
| 100 | -s /bin/false -u 25 apache</userinput></screen>
|
---|
[ab3a3af7] | 101 |
|
---|
[1259e0e8] | 102 | <para>The following patch modifies the layout of destination
|
---|
| 103 | directories and among them, the build directory at
|
---|
[ab3a3af7] | 104 | <filename class="directory">/usr/lib/apache/build</filename>. This
|
---|
| 105 | will allow the modules added to <application>Apache</application>
|
---|
| 106 | to be configured without errors. Apply the patch:</para>
|
---|
| 107 |
|
---|
| 108 | <screen><userinput>patch -Np1 -i ../httpd-&apache-version;-config-1.patch</userinput></screen>
|
---|
| 109 |
|
---|
[f165eea] | 110 | <note>
|
---|
| 111 | <para>You may wish to review the output from
|
---|
| 112 | <command>./configure --help</command> and include whatever parameters
|
---|
| 113 | are necessary to the <command>configure</command> command below to build
|
---|
[1259e0e8] | 114 | the modules required for your installation. There are as many as 62
|
---|
| 115 | additional parameters you can add to the <command>configure</command>
|
---|
| 116 | command to build additional modules. Some of the extra parameters which
|
---|
| 117 | aren't described or mentioned in the <parameter>--help</parameter>
|
---|
| 118 | information are listed in the <quote>Command Explanations</quote> section
|
---|
| 119 | below.</para>
|
---|
[f165eea] | 120 | </note>
|
---|
| 121 |
|
---|
[ab3a3af7] | 122 | <para>Build and install <application>Apache</application> by running the
|
---|
| 123 | following commands:</para>
|
---|
| 124 |
|
---|
| 125 | <screen><userinput>./configure --enable-layout=FHS --enable-mods-shared=all &&
|
---|
| 126 | make</userinput></screen>
|
---|
| 127 |
|
---|
| 128 | <para>This package does not come with a test suite.</para>
|
---|
| 129 |
|
---|
| 130 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 131 |
|
---|
| 132 | <screen role="root"><userinput>make install &&
|
---|
[1259e0e8] | 133 | chown -v root:root /usr/lib/apache/httpd.exp \
|
---|
| 134 | /usr/sbin/{apxs,apachectl,dbmmanage,envvars{,-std}} \
|
---|
| 135 | /usr/share/man/man1/{dbmmanage,ht{dbm,digest,passwd}}.1 \
|
---|
| 136 | /usr/share/man/man8/{ab,apachectl,apxs,htcacheclean,httpd}.8 \
|
---|
[47603ac1] | 137 | /usr/share/man/man8/{logresolve,rotatelogs,suexec}.8 &&
|
---|
[f165eea] | 138 | chown -v -R apache:apache /srv/www</userinput></screen>
|
---|
[08254fc] | 139 |
|
---|
[ab3a3af7] | 140 | </sect2>
|
---|
[08254fc] | 141 |
|
---|
[ab3a3af7] | 142 | <sect2 role="commands">
|
---|
| 143 | <title>Command Explanations</title>
|
---|
[08254fc] | 144 |
|
---|
[1259e0e8] | 145 | <para><option>--with-expat=/usr</option>: Uses the system installed
|
---|
[ab3a3af7] | 146 | <application>expat</application>. <emphasis>If you have installed
|
---|
| 147 | <application>expat</application> and do not use this switch, the
|
---|
| 148 | <application>Apache</application> installation may overwrite some files
|
---|
| 149 | from the <application>expat</application> installation.</emphasis></para>
|
---|
[b1623c2] | 150 |
|
---|
[ab3a3af7] | 151 | <para><parameter>--enable-mods-shared=all</parameter>: The modules
|
---|
| 152 | should be compiled and used as Dynamic Shared Objects
|
---|
| 153 | (DSOs) so they can be included and excluded from the
|
---|
| 154 | server using the run-time configuration directives.</para>
|
---|
[08254fc] | 155 |
|
---|
[1259e0e8] | 156 | <para><option>--enable-ssl</option>: Use this parameter
|
---|
[ab3a3af7] | 157 | to create the <filename class="libraryfile">mod_ssl</filename>
|
---|
[1259e0e8] | 158 | module and enable SSL support. This parameter is mentioned as one of many
|
---|
| 159 | parameters which can be passed to the <command>configure</command> command
|
---|
| 160 | to create additional DSO modules.</para>
|
---|
| 161 |
|
---|
| 162 | <para><option>--with-pcre</option>: Add this parameter to use the system
|
---|
| 163 | installed version of the <application>PCRE</application> library.</para>
|
---|
| 164 |
|
---|
| 165 | <para><option>--with-z</option>: Add this parameter to use the system
|
---|
| 166 | installed version of the <application>Zlib</application> library.</para>
|
---|
| 167 |
|
---|
| 168 | <para><option>--with-ldap</option>: This parameter is required if you
|
---|
| 169 | passed the <option>--enable-authnz-ldap</option> or
|
---|
[6473e74] | 170 | <option>--enable-ldap</option> options to <command>configure</command>
|
---|
[1259e0e8] | 171 | and enabled the <application>OpenLDAP</application> modules.</para>
|
---|
[08254fc] | 172 |
|
---|
[ab3a3af7] | 173 | <para><command>chown root:root ...</command>: This command changes the
|
---|
| 174 | ownership of some installed files, the result of building the package as
|
---|
| 175 | a user other than <systemitem class="username">root</systemitem>.</para>
|
---|
[4fb9a95] | 176 |
|
---|
[ab3a3af7] | 177 | <para><command>chown -R apache:apache /srv/www</command>: By default, the
|
---|
| 178 | installation process installs files (documentation, error messages, default
|
---|
| 179 | icons, etc.) with the ownership of the user that extracted the files from
|
---|
| 180 | the tar file. If you want to change the ownership to another user, you
|
---|
| 181 | should do so at this point. The only requirement is that the document
|
---|
| 182 | directories need to be accessible by the <command>httpd</command> process
|
---|
| 183 | with (r-x) permissions and files need to be readable (r--) by the
|
---|
| 184 | <systemitem class="username">apache</systemitem> user.</para>
|
---|
[4fb9a95] | 185 |
|
---|
[ab3a3af7] | 186 | </sect2>
|
---|
[08254fc] | 187 |
|
---|
[ab3a3af7] | 188 | <sect2 role="configuration">
|
---|
| 189 | <title>Configuring Apache</title>
|
---|
[08254fc] | 190 |
|
---|
[ab3a3af7] | 191 | <sect3 id="apache-config">
|
---|
| 192 | <title>Config Files</title>
|
---|
[08254fc] | 193 |
|
---|
[ab3a3af7] | 194 | <para><filename>/etc/apache/*</filename></para>
|
---|
[08254fc] | 195 |
|
---|
[ab3a3af7] | 196 | <indexterm zone="apache apache-config">
|
---|
| 197 | <primary sortas="e-etc-apache">/etc/apache/*</primary>
|
---|
| 198 | </indexterm>
|
---|
[08254fc] | 199 |
|
---|
[ab3a3af7] | 200 | <indexterm zone="apache apache-config">
|
---|
| 201 | <primary sortas="e-etc-apache-httpd.conf">/etc/apache/httpd.conf</primary>
|
---|
| 202 | </indexterm>
|
---|
[08254fc] | 203 |
|
---|
[ab3a3af7] | 204 | </sect3>
|
---|
| 205 |
|
---|
| 206 | <sect3>
|
---|
| 207 | <title>Configuration Information</title>
|
---|
| 208 |
|
---|
[1259e0e8] | 209 | <para>The main configuration file is named
|
---|
| 210 | <filename>/etc/apache/httpd.conf</filename>. Modify it so that the HTTP
|
---|
| 211 | server runs as the dedicated user and group:</para>
|
---|
[ab3a3af7] | 212 |
|
---|
[fb832ac] | 213 | <screen role="root"><userinput>sed -i -e "s/User daemon/User apache/" \
|
---|
[1259e0e8] | 214 | -e "s/Group daemon/Group apache/" \
|
---|
[ab3a3af7] | 215 | /etc/apache/httpd.conf</userinput></screen>
|
---|
| 216 |
|
---|
[1259e0e8] | 217 | <para>See <ulink url="http://httpd.apache.org/docs-2.2/configuring.html"/>
|
---|
[ab3a3af7] | 218 | for detailed instructions on customizing your
|
---|
[1259e0e8] | 219 | <application>Apache</application> HTTP server configuration file.</para>
|
---|
[ab3a3af7] | 220 |
|
---|
| 221 | <para>There's a problem with the ISAPI DSO module caused from compiling
|
---|
[1259e0e8] | 222 | with <application>GCC</application>-&gcc-version;. If you included the
|
---|
| 223 | parameter to build the module, comment out the module's load command
|
---|
| 224 | in the configuration file with the following command:</para>
|
---|
[ab3a3af7] | 225 |
|
---|
[1259e0e8] | 226 | <screen role="root"><userinput>sed -i "s/^LoadModule isapi_module/# &/" \
|
---|
[ab3a3af7] | 227 | /etc/apache/httpd.conf</userinput></screen>
|
---|
| 228 |
|
---|
| 229 | </sect3>
|
---|
| 230 |
|
---|
| 231 | <sect3 id="apache-init">
|
---|
| 232 | <title>Boot Script</title>
|
---|
| 233 |
|
---|
| 234 | <para>If you want the <application>Apache</application> server to
|
---|
| 235 | start automatically when the system is booted, install the
|
---|
| 236 | <filename>/etc/rc.d/init.d/apache</filename> init script included
|
---|
[5254d12] | 237 | in the <xref linkend="bootscripts"/> package.</para>
|
---|
[ab3a3af7] | 238 |
|
---|
| 239 | <indexterm zone="apache apache-init">
|
---|
| 240 | <primary sortas="f-apache">apache</primary>
|
---|
| 241 | </indexterm>
|
---|
| 242 |
|
---|
| 243 | <screen role="root"><userinput>make install-apache</userinput></screen>
|
---|
| 244 |
|
---|
| 245 | </sect3>
|
---|
| 246 |
|
---|
| 247 | </sect2>
|
---|
| 248 |
|
---|
| 249 | <sect2 role="content">
|
---|
| 250 | <title>Contents</title>
|
---|
| 251 |
|
---|
| 252 | <segmentedlist>
|
---|
| 253 | <segtitle>Installed Programs</segtitle>
|
---|
| 254 | <segtitle>Installed Libraries</segtitle>
|
---|
| 255 | <segtitle>Installed Directories</segtitle>
|
---|
| 256 |
|
---|
| 257 | <seglistitem>
|
---|
| 258 | <seg>ab, apachectl, apr-config, apu-config, apxs, checkgid, dbmmanage,
|
---|
| 259 | htdbm, htdigest, htpasswd, httpd, instdso.sh, logresolve, and
|
---|
| 260 | rotatelogs</seg>
|
---|
[3cb0c57] | 261 | <seg>libapr-1.{so,a}, libaprutil-1.{so,a}, and /usr/lib/apache/*.so</seg>
|
---|
[ab3a3af7] | 262 | <seg>/etc/apache, /srv/www, /usr/include/apache, /usr/lib/apache, and
|
---|
| 263 | /var/log/apache</seg>
|
---|
| 264 | </seglistitem>
|
---|
| 265 | </segmentedlist>
|
---|
| 266 |
|
---|
| 267 | <variablelist>
|
---|
| 268 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 269 | <?dbfo list-presentation="list"?>
|
---|
| 270 | <?dbhtml list-presentation="table"?>
|
---|
| 271 |
|
---|
| 272 | <varlistentry id="ab">
|
---|
| 273 | <term><command>ab</command></term>
|
---|
| 274 | <listitem>
|
---|
| 275 | <para>is a tool for benchmarking your
|
---|
| 276 | <application>Apache</application> HTTP server.</para>
|
---|
| 277 | <indexterm zone="apache ab">
|
---|
| 278 | <primary sortas="b-ab">ab</primary>
|
---|
| 279 | </indexterm>
|
---|
| 280 | </listitem>
|
---|
| 281 | </varlistentry>
|
---|
| 282 |
|
---|
| 283 | <varlistentry id="apachectl">
|
---|
| 284 | <term><command>apachectl</command></term>
|
---|
| 285 | <listitem>
|
---|
| 286 | <para>is a front end to the <application>Apache</application>
|
---|
| 287 | HTTP server which is designed to help the administrator
|
---|
| 288 | control the functioning of the <application>Apache</application>
|
---|
| 289 | httpd daemon.</para>
|
---|
| 290 | <indexterm zone="apache apachectl">
|
---|
| 291 | <primary sortas="b-apachectl">apachectl</primary>
|
---|
| 292 | </indexterm>
|
---|
| 293 | </listitem>
|
---|
| 294 | </varlistentry>
|
---|
| 295 |
|
---|
| 296 | <varlistentry id="apxs">
|
---|
| 297 | <term><command>apxs</command></term>
|
---|
| 298 | <listitem>
|
---|
| 299 | <para>is a tool for building and installing extension modules for
|
---|
| 300 | the <application>Apache</application> HTTP server.</para>
|
---|
| 301 | <indexterm zone="apache apxs">
|
---|
| 302 | <primary sortas="b-apxs">apxs</primary>
|
---|
| 303 | </indexterm>
|
---|
| 304 | </listitem>
|
---|
| 305 | </varlistentry>
|
---|
| 306 |
|
---|
| 307 | <varlistentry id="dbmanage">
|
---|
| 308 | <term><command>dbmanage</command></term>
|
---|
| 309 | <listitem>
|
---|
| 310 | <para>is used to create and update the DBM format files used to store
|
---|
| 311 | usernames and passwords for basic authentication of HTTP users.</para>
|
---|
| 312 | <indexterm zone="apache dbmanage">
|
---|
| 313 | <primary sortas="b-dbmanage">dbmanage</primary>
|
---|
| 314 | </indexterm>
|
---|
| 315 | </listitem>
|
---|
| 316 | </varlistentry>
|
---|
| 317 |
|
---|
| 318 | <varlistentry id="htdigest">
|
---|
| 319 | <term><command>htdigest</command></term>
|
---|
| 320 | <listitem>
|
---|
| 321 | <para>is used to create and update the flat-files used to store
|
---|
| 322 | usernames, realms and passwords for digest authentication of
|
---|
| 323 | HTTP users.</para>
|
---|
| 324 | <indexterm zone="apache htdigest">
|
---|
| 325 | <primary sortas="b-htdigest">htdigest</primary>
|
---|
| 326 | </indexterm>
|
---|
| 327 | </listitem>
|
---|
| 328 | </varlistentry>
|
---|
| 329 |
|
---|
| 330 | <varlistentry id="htpasswd">
|
---|
| 331 | <term><command>htpasswd</command></term>
|
---|
| 332 | <listitem>
|
---|
| 333 | <para>is used to create and update the flat-files used to store
|
---|
| 334 | usernames and passwords for basic authentication of HTTP users.</para>
|
---|
| 335 | <indexterm zone="apache htpasswd">
|
---|
| 336 | <primary sortas="b-htpasswd">htpasswd</primary>
|
---|
| 337 | </indexterm>
|
---|
| 338 | </listitem>
|
---|
| 339 | </varlistentry>
|
---|
| 340 |
|
---|
| 341 | <varlistentry id="httpd">
|
---|
| 342 | <term><command>httpd</command></term>
|
---|
| 343 | <listitem>
|
---|
| 344 | <para>is the <application>Apache</application>
|
---|
| 345 | HTTP server program.</para>
|
---|
| 346 | <indexterm zone="apache httpd">
|
---|
| 347 | <primary sortas="b-httpd">httpd</primary>
|
---|
| 348 | </indexterm>
|
---|
| 349 | </listitem>
|
---|
| 350 | </varlistentry>
|
---|
| 351 |
|
---|
| 352 | <varlistentry id="instdso.sh">
|
---|
| 353 | <term><command>instdso.sh</command></term>
|
---|
| 354 | <listitem>
|
---|
| 355 | <para>is a script which installs <application>Apache</application>
|
---|
| 356 | DSO modules.</para>
|
---|
| 357 | <indexterm zone="apache instdso.sh">
|
---|
| 358 | <primary sortas="b-instdso.sh">instdso.sh</primary>
|
---|
| 359 | </indexterm>
|
---|
| 360 | </listitem>
|
---|
| 361 | </varlistentry>
|
---|
| 362 |
|
---|
| 363 | <varlistentry id="logresolve">
|
---|
| 364 | <term><command>logresolve</command></term>
|
---|
| 365 | <listitem>
|
---|
| 366 | <para>is a post-processing program to resolve IP-addresses
|
---|
| 367 | in <application>Apache</application>'s access log files.</para>
|
---|
| 368 | <indexterm zone="apache logresolve">
|
---|
| 369 | <primary sortas="b-logresolve">logresolve</primary>
|
---|
| 370 | </indexterm>
|
---|
| 371 | </listitem>
|
---|
| 372 | </varlistentry>
|
---|
| 373 |
|
---|
| 374 | <varlistentry id="rotatelogs">
|
---|
| 375 | <term><command>rotatelogs</command></term>
|
---|
| 376 | <listitem>
|
---|
| 377 | <para>is a simple program for use in conjunction with
|
---|
| 378 | <application>Apache</application>'s piped log file feature.</para>
|
---|
| 379 | <indexterm zone="apache rotatelogs">
|
---|
| 380 | <primary sortas="b-rotatelogs">rotatelogs</primary>
|
---|
| 381 | </indexterm>
|
---|
| 382 | </listitem>
|
---|
| 383 | </varlistentry>
|
---|
| 384 |
|
---|
| 385 | </variablelist>
|
---|
| 386 |
|
---|
| 387 | </sect2>
|
---|
[f45b1953] | 388 |
|
---|
| 389 | </sect1>
|
---|