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