glfs/server/major/apache.xml
Igor Živković b5b9045fe9 Added a test suite note to Apache.
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3748 af4574ff-66df-0310-9fd7-8a98e5e911e0
2005-04-17 13:39:06 +00:00

302 lines
11 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY apache-download-http "http://www.apache.org/dist/httpd/httpd-&apache-version;.tar.bz2">
<!ENTITY apache-download-ftp "ftp://ftp.tux.org/pub/net/apache/dist/httpd/httpd-&apache-version;.tar.bz2">
<!ENTITY apache-md5sum "94f3a793fb1665365724943206cce23f">
<!ENTITY apache-size "5.0 MB">
<!ENTITY apache-buildsize "91.6 MB">
<!ENTITY apache-time "1.69 SBU">
]>
<sect1 id="apache" xreflabel="Apache-&apache-version;">
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<?dbhtml filename="apache.html"?>
<title>Apache-&apache-version;</title>
<indexterm zone="apache">
<primary sortas="a-Apache">Apache</primary></indexterm>
<sect2>
<title>Introduction to <application>Apache</application></title>
<para>The <application>Apache</application> package contains an
open-source <acronym>HTTP</acronym> server. It is useful for creating local
intranet web sites or running huge web serving operations.</para>
<sect3><title>Package information</title>
<itemizedlist spacing='compact'>
<listitem><para>Download (HTTP):
<ulink url="&apache-download-http;"/></para></listitem>
<listitem><para>Download (FTP):
<ulink url="&apache-download-ftp;"/></para></listitem>
<listitem><para>Download MD5 sum: &apache-md5sum;</para></listitem>
<listitem><para>Download size: &apache-size;</para></listitem>
<listitem><para>Estimated disk space required:
&apache-buildsize;</para></listitem>
<listitem><para>Estimated build time: &apache-time;</para></listitem>
</itemizedlist>
</sect3>
<sect3><title>Additional downloads</title>
<itemizedlist spacing='compact'>
<listitem><para>Required patch: <ulink
url="&patch-root;/httpd-&apache-version;-config-1.patch"/></para></listitem>
</itemizedlist></sect3>
<sect3><title><application>Apache</application> dependencies</title>
<sect4><title>Optional</title>
<para><xref linkend="db"/> or <xref linkend="gdbm"/>,
<xref linkend="openssl"/>,
<xref linkend="openldap"/>,
<xref linkend="expat"/> and
<xref linkend="doxygen"/></para>
</sect4>
</sect3>
</sect2>
<sect2>
<title>Installation of <application>Apache</application></title>
<para>For security reasons, running the server as an unprivileged user and
group is strongly encouraged. Create the following group and user using the
following commands (as root):</para>
<screen><userinput><command>groupadd apache &amp;&amp;
useradd -c "Apache Server" -d /dev/null -g apache -s /bin/false apache</command></userinput></screen>
<para>The following patch will define the layout of destination directories
and, among them, the build directory at
<filename class="directory">/usr/lib/apache/build</filename>. This
will allow the modules added to <application>Apache</application> to
be configured without errors. Apply the patch:</para>
<screen><userinput><command>patch -Np1 -i ../httpd-&apache-version;-config-1.patch</command></userinput></screen>
<para>Build and install <application>Apache</application> by running the
following commands:</para>
<screen><userinput><command>./configure --enable-layout=FHS --enable-mods-shared=all &amp;&amp;
make</command></userinput></screen>
<para>This package does not come with a test suite.</para>
<para>Now, as the root user:</para>
<screen><userinput role='root'><command>make install &amp;&amp;
chown root:root /usr/sbin/{apxs,apachectl,dbmmanage,envvars-std,envvars} \
/usr/include/apache/* /usr/lib/apache/httpd.exp \
/usr/share/man/man1/{dbmmanage,htdigest,htpasswd}.1 \
/usr/share/man/man8/{ab,apachectl,apxs,httpd}.8 \
/usr/share/man/man8/{logresolve,rotatelogs,suexec}.8 &amp;&amp;
chown -R apache:apache /srv/www</command></userinput></screen>
</sect2>
<sect2>
<title>Command explanations</title>
<para><option>--with-expat=/usr</option>: Uses system installed
<application>expat</application>. <emphasis>If you have installed
<application>expat</application> and do not use this switch, the
<application>Apache</application> installation may overwrite some files from
the <application>expat</application> installation.</emphasis></para>
<para><parameter>--enable-mods-shared=all</parameter>: The modules should be
compiled and used as Dynamic Shared Objects
(<acronym>DSO</acronym>s) so they can be included and excluded from the
server using the run-time configuration directives.</para>
<para><option>--enable-ssl</option>: Use this switch
to create the <filename class="libraryfile">mod_ssl</filename>
module and enable <acronym>SSL</acronym> support.</para>
<para><command>chown root:root ...</command>: This command changes
the ownership of some installed files, the result of building the package as a
user other than root.</para>
<para><command>chown -R apache:apache /srv/www</command>: By default, the
installation process installs files (documentation, error messages, default
icons, etc.) with the ownership of the user that extracted the files from the
tar file. If you want to change the ownership to another user, you should do
so at this point. The only requirement is that the document directories need
to be accessible by the <command>httpd</command> process with (r-x) permissions
and files need to be readable (r--) by the apache user.</para>
</sect2>
<sect2>
<title>Configuring <application>Apache</application></title>
<sect3 id="apache-config">
<title>Config files</title>
<para><filename>/etc/apache/*</filename></para>
<indexterm zone="apache apache-config">
<primary sortas="e-etc-apache">/etc/apache/*</primary></indexterm>
<indexterm zone="apache apache-config">
<primary sortas="e-etc-apache-httpd.conf">/etc/apache/httpd.conf</primary>
</indexterm>
</sect3>
<sect3>
<title>Configuration Information</title>
<para>The main configuration file is named <filename>httpd.conf</filename>.
Modify it to run the server as a dedicated user:</para>
<screen><userinput><command>sed -i -e "s%User nobody%User apache%" \
-e "s%^Group #-1%Group apache%" \
/etc/apache/httpd.conf</command></userinput></screen>
<para>See <ulink url="http://httpd.apache.org/docs-2.0/configuring.html"/> for
detailed instructions on customizing your <application>Apache</application>
<acronym>HTTP</acronym> server.</para>
<para>There's a problem with the ISAPI <acronym>DSO</acronym> module
caused from compiling with
<application><acronym>GCC</acronym></application>-&gcc-version;. Comment out
the module from the configuration file with the following command:</para>
<screen><userinput><command>sed -i -e "s/^LoadModule isapi_module/# &amp;/" \
/etc/apache/httpd.conf</command></userinput></screen>
<para id="apache-init">If you want the <application>Apache</application>
server to start automatically when the system is booted, install the
<filename>/etc/rc.d/init.d/apache</filename> init script included in the
<xref linkend="intro-important-bootscripts"/> package.</para>
<indexterm zone="apache apache-init">
<primary sortas="f-apache">apache</primary></indexterm>
<screen><userinput><command>make install-apache</command></userinput></screen>
</sect3>
</sect2>
<sect2>
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>ab, apachectl, apr-config, apu-config, apxs, checkgid, dbmmanage, htdbm,
htdigest, htpasswd, httpd, instdso.sh, logresolve and rotatelogs</seg>
<seg>libapr-0.[so,a], libaprutil-0.[so,a] and /usr/lib/apache/*.so</seg>
<seg>/etc/apache, /srv/www, /usr/include/apache, /usr/lib/apache and
/var/log/apache</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<varlistentry id="ab">
<term><command>ab</command></term>
<listitem><para>is a tool for benchmarking your
<application>Apache</application> <acronym>HTTP</acronym> server.</para>
<indexterm zone="apache ab">
<primary sortas="b-ab">ab</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="apachectl">
<term><command>apachectl</command></term>
<listitem><para>is a front end to the <application>Apache</application>
<acronym>HTTP</acronym> server which is designed to help the administrator
control the functioning of the <application>Apache</application> httpd
daemon.</para>
<indexterm zone="apache apachectl">
<primary sortas="b-apachectl">apachectl</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="apxs">
<term><command>apxs</command></term>
<listitem><para>is a tool for building and installing extension modules for
the <application>Apache</application> <acronym>HTTP</acronym> server.</para>
<indexterm zone="apache apxs">
<primary sortas="b-apxs">apxs</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="dbmanage">
<term><command>dbmanage</command></term>
<listitem><para>is used to create and update the <filename>DBM</filename>
format files used to store usernames and passwords for basic authentication
of <acronym>HTTP</acronym> users.</para>
<indexterm zone="apache dbmanage">
<primary sortas="b-dbmanage">dbmanage</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="htdigest">
<term><command>htdigest</command></term>
<listitem><para>is used to create and update the flat-files used to store
usernames, realms and passwords for digest authentication of
<acronym>HTTP</acronym> users.</para>
<indexterm zone="apache htdigest">
<primary sortas="b-htdigest">htdigest</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="htpasswd">
<term><command>htpasswd</command></term>
<listitem><para>is used to create and update the flat-files used to store
usernames and passwords for basic authentication of <acronym>HTTP</acronym>
users.</para>
<indexterm zone="apache htpasswd">
<primary sortas="b-htpasswd">htpasswd</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="httpd">
<term><command>httpd</command></term>
<listitem><para>is the <application>Apache</application>
<acronym>HTTP</acronym> server program.</para>
<indexterm zone="apache httpd">
<primary sortas="b-httpd">httpd</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="instdso.sh">
<term><command>instdso.sh</command></term>
<listitem><para>is a script which installs <application>Apache</application>
<acronym>DSO</acronym> modules.</para>
<indexterm zone="apache instdso.sh">
<primary sortas="b-instdso.sh">instdso.sh</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="logresolve">
<term><command>logresolve</command></term>
<listitem><para>is a post-processing program to resolve
<acronym>IP</acronym>-addresses in <application>Apache</application>'s
access log files.</para>
<indexterm zone="apache logresolve">
<primary sortas="b-logresolve">logresolve</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="rotatelogs">
<term><command>rotatelogs</command></term>
<listitem><para>is a simple program for use in conjunction with
<application>Apache</application>'s piped log file feature.</para>
<indexterm zone="apache rotatelogs">
<primary sortas="b-rotatelogs">rotatelogs</primary></indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>