[08254fc] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 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">
|
---|
| 9 | <!ENTITY apache-md5sum "0e1b47c53921a1fc8fb006effdb3bf1c">
|
---|
| 10 | <!ENTITY apache-size "5.2 MB">
|
---|
[5367ecb] | 11 | <!ENTITY apache-buildsize "78 MB">
|
---|
[4fb9a95] | 12 | <!ENTITY apache-time "1.12 SBU">
|
---|
[08254fc] | 13 | ]>
|
---|
| 14 |
|
---|
[7c7fa7d] | 15 | <sect1 id="apache" xreflabel="Apache-&apache-version;">
|
---|
[a0f03b0] | 16 | <sect1info>
|
---|
[5cd0959d] | 17 | <othername>$LastChangedBy$</othername>
|
---|
| 18 | <date>$Date$</date>
|
---|
[a0f03b0] | 19 | </sect1info>
|
---|
[00bb024c] | 20 | <?dbhtml filename="apache.html"?>
|
---|
[7c7fa7d] | 21 | <title>Apache-&apache-version;</title>
|
---|
[f45b1953] | 22 |
|
---|
[08254fc] | 23 | <sect2>
|
---|
| 24 | <title>Introduction to <application>Apache</application></title>
|
---|
| 25 |
|
---|
| 26 | <para>The <application>Apache</application> package contains an
|
---|
| 27 | open-source <acronym>HTTP</acronym> server. It is
|
---|
| 28 | useful for creating local intranet web sites or running huge web serving
|
---|
| 29 | operations.</para>
|
---|
| 30 |
|
---|
| 31 | <sect3><title>Package information</title>
|
---|
| 32 | <itemizedlist spacing='compact'>
|
---|
[4fb9a95] | 33 | <listitem><para>Download (HTTP):
|
---|
| 34 | <ulink url="&apache-download-http;"/></para></listitem>
|
---|
| 35 | <listitem><para>Download (FTP):
|
---|
| 36 | <ulink url="&apache-download-ftp;"/></para></listitem>
|
---|
[dc2f5ad] | 37 | <listitem><para>Download MD5 sum: &apache-md5sum;</para></listitem>
|
---|
[08254fc] | 38 | <listitem><para>Download size: &apache-size;</para></listitem>
|
---|
[4fb9a95] | 39 | <listitem><para>Estimated Disk space required:
|
---|
| 40 | &apache-buildsize;</para></listitem>
|
---|
| 41 | <listitem><para>Estimated build time: &apache-time;</para></listitem>
|
---|
| 42 | </itemizedlist>
|
---|
[08254fc] | 43 | </sect3>
|
---|
| 44 |
|
---|
| 45 | <sect3><title>Additional downloads</title>
|
---|
| 46 | <itemizedlist spacing='compact'>
|
---|
[4fb9a95] | 47 | <listitem><para>Required Patch: <ulink
|
---|
| 48 | url="&patch-root;/httpd-&apache-version;-config-1.patch"/></para></listitem>
|
---|
[08254fc] | 49 | </itemizedlist></sect3>
|
---|
| 50 |
|
---|
| 51 | <sect3><title><application>Apache</application> dependencies</title>
|
---|
| 52 | <sect4><title>Optional</title>
|
---|
[4fb9a95] | 53 | <para><xref linkend="db"/> or <xref linkend="gdbm"/>,
|
---|
| 54 | <xref linkend="openssl"/>,
|
---|
| 55 | <xref linkend="openldap"/>,
|
---|
| 56 | <xref linkend="expat"/> and
|
---|
[faa80ab] | 57 | <xref linkend="doxygen"/></para>
|
---|
[4fb9a95] | 58 | </sect4>
|
---|
[08254fc] | 59 | </sect3>
|
---|
| 60 |
|
---|
| 61 | </sect2>
|
---|
| 62 |
|
---|
| 63 | <sect2>
|
---|
| 64 | <title>Installation of <application>Apache</application></title>
|
---|
| 65 |
|
---|
[b1623c2] | 66 | <para>For security reasons, running the server as an unprivileged user and
|
---|
| 67 | group is strongly encouraged.</para>
|
---|
[08254fc] | 68 |
|
---|
| 69 | <screen><userinput><command>groupadd apache &&
|
---|
| 70 | useradd -c apache -d /dev/null -g apache -s /bin/false apache</command></userinput></screen>
|
---|
| 71 |
|
---|
| 72 | <para>The following patch will define the layout of destination directories
|
---|
| 73 | and, among them, the build directory at
|
---|
| 74 | <filename class="directory">/usr/lib/apache/build</filename>. This
|
---|
| 75 | will allow the modules added to <application>Apache</application> to
|
---|
| 76 | be configured without errors. Apply the patch:</para>
|
---|
| 77 |
|
---|
[4fb9a95] | 78 | <screen><userinput><command>patch -Np1 -i ../httpd-&apache-version;-config-1.patch</command></userinput></screen>
|
---|
[08254fc] | 79 |
|
---|
[b1623c2] | 80 | <para>Build and install <application>Apache</application> by running the
|
---|
| 81 | following commands:</para>
|
---|
[08254fc] | 82 |
|
---|
[5367ecb] | 83 | <screen><userinput><command>./configure --enable-layout=FHS \
|
---|
[b1623c2] | 84 | --enable-mods-shared=all &&
|
---|
[08254fc] | 85 | make &&
|
---|
[4fb9a95] | 86 | make install &&
|
---|
[9b893e9] | 87 | chown root:root /usr/sbin/{apxs,apachectl,dbmmanage,envvars-std,envvars} \
|
---|
| 88 | /usr/include/apache/* /usr/lib/apache/httpd.exp \
|
---|
| 89 | /usr/share/man/man1/{dbmmanage,htdigest,htpasswd}.1 \
|
---|
| 90 | /usr/share/man/man8/{ab,apachectl,apxs,httpd,logresolve,rotatelogs,suexec}.8 &&
|
---|
[4fb9a95] | 91 | chown -R apache:apache /srv/www</command></userinput></screen>
|
---|
[08254fc] | 92 |
|
---|
| 93 | </sect2>
|
---|
| 94 |
|
---|
| 95 | <sect2>
|
---|
| 96 | <title>Command explanations</title>
|
---|
| 97 |
|
---|
[4fb9a95] | 98 | <para><option>--with-expat=/usr</option>: Uses system installed
|
---|
| 99 | <application>expat</application>. <emphasis>If you have installed
|
---|
| 100 | <application>expat</application> and do not use this switch, the
|
---|
| 101 | <application>Apache</application> installation may overwrite some files from
|
---|
| 102 | the <application>expat</application> installation.</emphasis></para>
|
---|
[b1623c2] | 103 |
|
---|
[4fb9a95] | 104 | <para><parameter>--enable-mods-shared=all</parameter>: The modules should be
|
---|
| 105 | compiled and used as Dynamic Shared Objects
|
---|
[08254fc] | 106 | (<acronym>DSO</acronym>s) so they can be included and excluded from the
|
---|
[b1623c2] | 107 | server using the run-time configuration directives.</para>
|
---|
[08254fc] | 108 |
|
---|
[5367ecb] | 109 | <para><option>--enable-ssl</option>: Use this switch
|
---|
[08254fc] | 110 | to create the <filename class="libraryfile">mod_ssl</filename>
|
---|
| 111 | module and enable <acronym>SSL</acronym> support.</para>
|
---|
| 112 |
|
---|
[9b893e9] | 113 | <para><command>chown root:root ...</command>: This command changes
|
---|
[4fb9a95] | 114 | the ownership of some installed files, the result of building the package as a
|
---|
| 115 | user other than root.</para>
|
---|
| 116 |
|
---|
| 117 | <para><command>chown -R apache:apache /srv/www</command>: By default, the
|
---|
| 118 | installation process installs files (documentation, error messages, default
|
---|
| 119 | icons, etc.) with the ownership of the user that extracted the files from the
|
---|
| 120 | tar file. If you want to change the ownership to another user, you should do
|
---|
| 121 | so at this point. The only requirement is that the document directories need
|
---|
| 122 | to be accessable by the <command>httpd</command> process with (r-x) permissions
|
---|
| 123 | and files need to be readable (r--) by the apache user.</para>
|
---|
| 124 |
|
---|
[08254fc] | 125 | </sect2>
|
---|
| 126 |
|
---|
| 127 | <sect2>
|
---|
| 128 | <title>Configuring <application>Apache</application></title>
|
---|
| 129 |
|
---|
| 130 | <sect3>
|
---|
| 131 | <title>Config files</title>
|
---|
| 132 |
|
---|
| 133 | <para><filename>/etc/apache/*</filename></para>
|
---|
| 134 |
|
---|
| 135 | </sect3>
|
---|
| 136 |
|
---|
[4fb9a95] | 137 | <sect3>
|
---|
| 138 | <title>Configuration Information</title>
|
---|
[08254fc] | 139 |
|
---|
[4fb9a95] | 140 | <para>The main configuration file is named <filename>httpd.conf</filename>.
|
---|
| 141 | Modify it to run the server as a dedicated user:</para>
|
---|
[08254fc] | 142 |
|
---|
[4fb9a95] | 143 | <screen><userinput><command>sed -i -e "s%User nobody%User apache%" \
|
---|
| 144 | -e "s%^Group #-1%Group apache%" \
|
---|
| 145 | /etc/apache/httpd.conf</command></userinput></screen>
|
---|
[b1623c2] | 146 |
|
---|
[4fb9a95] | 147 | <para>See <ulink url="http://httpd.apache.org/docs-2.0/configuring.html"/> for
|
---|
| 148 | detailed instructions on customizing your <application>Apache</application>
|
---|
| 149 | <acronym>HTTP</acronym> server.</para>
|
---|
[08254fc] | 150 |
|
---|
[84ee2932] | 151 | <para>There's a problem with the ISAPI <acronym>DSO</acronym> module
|
---|
| 152 | caused from compiling with
|
---|
| 153 | <application><acronym>GCC</acronym></application>-3.4.1. Comment out the
|
---|
| 154 | module from the configuration file with the following command:</para>
|
---|
| 155 |
|
---|
| 156 | <screen><userinput><command>sed -i -e "s/^LoadModule isapi_module/# &/" \
|
---|
| 157 | /etc/apache/httpd.conf</command></userinput></screen>
|
---|
| 158 |
|
---|
[08254fc] | 159 | <para>Install the <filename>/etc/rc.d/init.d/apache</filename>
|
---|
[b1623c2] | 160 | init script included in the <xref linkend="intro-important-bootscripts"/>
|
---|
| 161 | package.</para>
|
---|
| 162 |
|
---|
[08254fc] | 163 | <screen><userinput><command>make install-apache</command></userinput></screen>
|
---|
| 164 | </sect3>
|
---|
| 165 |
|
---|
| 166 | </sect2>
|
---|
| 167 |
|
---|
| 168 | <sect2>
|
---|
| 169 | <title>Contents</title>
|
---|
| 170 |
|
---|
| 171 | <para>The <application>Apache</application> package provides
|
---|
| 172 | <command>ab</command>,
|
---|
| 173 | <command>apachectl</command>,
|
---|
| 174 | <command>apr-config</command>,
|
---|
| 175 | <command>apu-config</command>,
|
---|
| 176 | <command>apxs</command>,
|
---|
| 177 | <command>checkgid</command>,
|
---|
| 178 | <command>dbmmanage</command>,
|
---|
| 179 | <command>htdbm</command>,
|
---|
| 180 | <command>htdigest</command>,
|
---|
| 181 | <command>htpasswd</command>,
|
---|
| 182 | <command>httpd</command>,
|
---|
| 183 | <command>instdso.sh</command>,
|
---|
| 184 | <command>logresolve</command>,
|
---|
| 185 | <command>rotatelogs</command>,
|
---|
| 186 | <filename class="libraryfile">libapr</filename>,
|
---|
| 187 | <filename class="libraryfile">libaprutil</filename> and
|
---|
| 188 | various modules.</para>
|
---|
| 189 | </sect2>
|
---|
| 190 |
|
---|
| 191 | <sect2><title>Description</title>
|
---|
| 192 |
|
---|
| 193 | <sect3><title>ab</title>
|
---|
| 194 | <para><command>ab</command> is a tool for benchmarking your
|
---|
| 195 | <application>Apache</application> <acronym>HTTP</acronym> server.
|
---|
| 196 | </para></sect3>
|
---|
| 197 |
|
---|
| 198 | <sect3><title>apachectl</title>
|
---|
| 199 | <para><command>apachectl</command> is a front end to the
|
---|
| 200 | <application>Apache</application> <acronym>HTTP</acronym>
|
---|
| 201 | server which is designed to help the administrator control the
|
---|
[4fb9a95] | 202 | functioning of the <application>Apache</application> httpd daemon.</para>
|
---|
| 203 | </sect3>
|
---|
[08254fc] | 204 |
|
---|
| 205 | <sect3><title>apxs</title>
|
---|
| 206 | <para><command>apxs</command>
|
---|
| 207 | is a tool for building and installing extension modules for the
|
---|
| 208 | <application>Apache</application> <acronym>HTTP</acronym> server.</para></sect3>
|
---|
| 209 |
|
---|
| 210 | <sect3><title>dbmmanage</title>
|
---|
| 211 | <para><command>dbmmanage</command> is used to create and update the
|
---|
| 212 | <filename>DBM</filename> format files used to store usernames and passwords
|
---|
| 213 | for basic authentication of <acronym>HTTP</acronym>
|
---|
| 214 | users.</para></sect3>
|
---|
| 215 |
|
---|
| 216 | <sect3><title>htdigest</title>
|
---|
| 217 | <para><command>htdigest</command> is used to create and update the
|
---|
| 218 | flat-files used to store usernames, realms and passwords for digest
|
---|
| 219 | authentication of <acronym>HTTP</acronym> users.</para></sect3>
|
---|
| 220 |
|
---|
| 221 | <sect3><title>htpasswd</title>
|
---|
| 222 | <para><command>htpasswd</command> is used to create and update the
|
---|
| 223 | flat-files used to store usernames and passwords for basic authentication of
|
---|
| 224 | <acronym>HTTP</acronym> users.</para></sect3>
|
---|
| 225 |
|
---|
| 226 | <sect3><title>httpd</title>
|
---|
[b1623c2] | 227 | <para><command>httpd</command> is the <application>Apache</application>
|
---|
| 228 | <acronym>HTTP</acronym> server program.</para></sect3>
|
---|
[08254fc] | 229 |
|
---|
| 230 | <sect3><title>instdso.sh</title>
|
---|
| 231 | <para><command>instdso.sh</command> is a script which installs
|
---|
| 232 | <application>Apache</application> <acronym>DSO</acronym> modules.</para></sect3>
|
---|
| 233 |
|
---|
| 234 | <sect3><title>logresolve</title>
|
---|
| 235 | <para><command>logresolve</command> is a post-processing program to
|
---|
[b1623c2] | 236 | resolve <acronym>IP</acronym>-addresses in <application>Apache</application>'s
|
---|
| 237 | access log files.</para></sect3>
|
---|
[08254fc] | 238 |
|
---|
| 239 | <sect3><title>rotatelogs</title>
|
---|
[b1623c2] | 240 | <para><command>rotatelogs</command> is a simple program for use in conjunction
|
---|
| 241 | with <application>Apache</application>'s piped log file feature.</para></sect3>
|
---|
[08254fc] | 242 |
|
---|
| 243 | </sect2>
|
---|
[f45b1953] | 244 |
|
---|
| 245 | </sect1>
|
---|