mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-01 13:02:35 +08:00
d1a0319172
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@10242 af4574ff-66df-0310-9fd7-8a98e5e911e0
477 lines
16 KiB
XML
477 lines
16 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!ENTITY apache-download-http
|
|
"http://archive.apache.org/dist/httpd/httpd-&apache-version;.tar.bz2">
|
|
<!ENTITY apache-download-ftp
|
|
"ftp://apache.mirrors.pair.com/httpd/httpd-&apache-version;.tar.bz2">
|
|
<!ENTITY apache-md5sum "6bb12f726e22656f0ad2baf91f1f8329">
|
|
<!ENTITY apache-size "3.9 MB">
|
|
<!ENTITY apache-buildsize "99 MB">
|
|
<!ENTITY apache-time "0.8 SBU">
|
|
]>
|
|
|
|
<sect1 id="apache" xreflabel="Apache-&apache-version;">
|
|
<?dbhtml filename="apache.html"?>
|
|
|
|
<sect1info>
|
|
<othername>$LastChangedBy$</othername>
|
|
<date>$Date$</date>
|
|
</sect1info>
|
|
|
|
<title>Apache-&apache-version;</title>
|
|
|
|
<indexterm zone="apache">
|
|
<primary sortas="a-Apache">Apache</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to Apache</title>
|
|
|
|
<para>
|
|
The <application>Apache</application> package contains an open-source HTTP
|
|
server. It is useful for creating local intranet web sites or running huge
|
|
web serving operations.
|
|
</para>
|
|
|
|
&lfs71_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<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>
|
|
|
|
<bridgehead renderas="sect3">Apache Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
|
<para role="required">
|
|
<xref linkend="apr-util"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="openldap"/>,
|
|
<xref linkend="db"/>,
|
|
<xref linkend="expat"/>,
|
|
<xref linkend="openssl"/>,
|
|
<xref linkend="pcre"/>,
|
|
<xref linkend="rsync"/>,
|
|
<xref linkend="doxygen"/>,
|
|
<xref linkend="lynx"/> and
|
|
<ulink url="http://www.distcache.org/">distcache</ulink>
|
|
</para>
|
|
|
|
<para condition="html" role="usernotes">
|
|
User Notes: <ulink url="&blfs-wiki;/apache"/>
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of Apache</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 <systemitem class="username">root</systemitem>:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>groupadd -g 25 apache &&
|
|
useradd -c "Apache Server" -d /dev/null -g apache \
|
|
-s /bin/false -u 25 apache</userinput></screen>
|
|
|
|
<note>
|
|
<para>
|
|
The above command directs the <application>Apache</application> user's
|
|
home directory to <filename>/dev/null</filename>. This may not work
|
|
for some add-ons such as
|
|
<ulink url='http://www.viewvc.org/'><application>ViewVC</application></ulink>,
|
|
a browser interface for CVS and Subversion version control repositories.
|
|
See the User Notes for details for specific applications.
|
|
</para>
|
|
</note>
|
|
|
|
<para>
|
|
Build and install <application>Apache</application> by running the
|
|
following commands:
|
|
</para>
|
|
|
|
<screen><userinput>cat >> config.layout << "HERE_DOC" &&
|
|
# BLFS FHS layout
|
|
<Layout FHS>
|
|
prefix: /usr
|
|
exec_prefix: ${prefix}
|
|
bindir: ${exec_prefix}/bin
|
|
sbindir: ${exec_prefix}/sbin
|
|
libdir: ${exec_prefix}/lib
|
|
libexecdir: ${exec_prefix}/libexec/apache
|
|
mandir: ${prefix}/share/man
|
|
sysconfdir: /etc/apache
|
|
datadir: /srv/www
|
|
installbuilddir: ${libexecdir}/build
|
|
errordir: ${datadir}/error
|
|
iconsdir: ${datadir}/icons
|
|
htdocsdir: ${datadir}/htdocs
|
|
manualdir: ${datadir}/manual
|
|
cgidir: ${datadir}/cgi-bin
|
|
includedir: ${prefix}/include/apache
|
|
localstatedir: ${datadir}
|
|
runtimedir: /var/run
|
|
logfiledir: /var/log/apache
|
|
proxycachedir: /var/cache/apache/proxy
|
|
</Layout>
|
|
HERE_DOC
|
|
./configure --enable-layout=FHS --enable-mods-shared=all &&
|
|
make</userinput></screen>
|
|
|
|
<para>
|
|
This package does not come with a test suite.
|
|
</para>
|
|
|
|
<para>
|
|
Now, as the <systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>make install &&
|
|
chown -v root:root /usr/bin/{apxs,dbmmanage} \
|
|
/usr/sbin/{apachectl,envvars{,-std}} \
|
|
/usr/libexec/apache/httpd.exp \
|
|
/usr/share/man/man1/{ab,apxs,dbmmanage,ht{dbm,digest,passwd,txt2dbm},logresolve}.1 \
|
|
/usr/share/man/man8/{apachectl,htcacheclean,httpd,rotatelogs,suexec}.8 &&
|
|
chown -v -R apache:apache /srv/www</userinput></screen>
|
|
|
|
<para>
|
|
Also as the <systemitem class="username">root</systemitem> user,
|
|
optionally install the html docs:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>mkdir -p /usr/share/doc/httpd-&apache-version;/style &&
|
|
for thing in docs/manual/*.html.en
|
|
do
|
|
tmp=${thing%.en}
|
|
cp ${thing} /usr/share/doc/httpd-&apache-version;/${tmp##*/}
|
|
done
|
|
cp -rf docs/manual/images /usr/share/doc/httpd-&apache-version; &&
|
|
cp -rf docs/manual/style/css /usr/share/doc/httpd-&apache-version;/style &&
|
|
for directory in developer faq howto misc mod platform programs rewrite ssl vhosts
|
|
do
|
|
mkdir -p /usr/share/doc/httpd-&apache-version;/${directory}
|
|
for thing in docs/manual/${directory}/*.html.en
|
|
do
|
|
tmp=${thing%.en}
|
|
cp ${thing} /usr/share/doc/httpd-&apache-version;/${directory}/${tmp##*/}
|
|
done
|
|
done
|
|
sed -i \
|
|
'/developer\|faq\|misc\|mod\|programs\|rewrite\|ssl\|vhosts/s#/"#/index.html"#' \
|
|
/usr/share/doc/httpd-&apache-version;/index.html</userinput></screen>
|
|
</sect2>
|
|
|
|
<sect2 role="commands">
|
|
<title>Command Explanations</title>
|
|
|
|
<para>
|
|
<parameter>--enable-mods-shared=all</parameter>: The modules should be
|
|
compiled and used as Dynamic Shared Objects (DSOs) so they can be included
|
|
and excluded from the server using the run-time configuration directives.
|
|
</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 <systemitem class="username">root</systemitem>.
|
|
</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
|
|
<systemitem class="username">apache</systemitem> user.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 role="configuration">
|
|
<title>Configuring Apache</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>/etc/apache/httpd.conf</filename>. Modify it so that the HTTP
|
|
server runs as the dedicated user and group:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>sed -i "s/daemon$/apache/" /etc/apache/httpd.conf</userinput></screen>
|
|
|
|
<para>
|
|
See <ulink url="/usr/share/doc/httpd-&apache-version;/configuring.html"/>
|
|
for detailed instructions on customising your
|
|
<application>Apache</application> HTTP server configuration file.
|
|
</para>
|
|
</sect3>
|
|
|
|
<sect3 id="httpd-init">
|
|
<title>Boot Script</title>
|
|
|
|
<para>
|
|
If you want the <application>Apache</application> server to
|
|
start automatically when the system is booted, install the
|
|
<filename>/etc/rc.d/init.d/httpd</filename> init script included
|
|
in the <xref linkend="bootscripts"/> package.
|
|
</para>
|
|
|
|
<indexterm zone="apache httpd-init">
|
|
<primary sortas="f-apache">apache</primary>
|
|
</indexterm>
|
|
|
|
<screen role="root"><userinput>make install-httpd</userinput></screen>
|
|
</sect3>
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>
|
|
ab, apachectl, apxs, checkgid, dbmmanage, htcacheclean, htdbm,
|
|
htdigest, htpasswd, httpd, httxt2dbm, logresolve and rotatelogs
|
|
</seg>
|
|
<seg>
|
|
/etc/apache, /srv/www, /usr/include/apache, /usr/libexec/apache,
|
|
and /var/log/apache.
|
|
</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="ab">
|
|
<term><command>ab</command></term>
|
|
<listitem>
|
|
<para>
|
|
is a tool for benchmarking your <application>Apache</application>
|
|
HTTP 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> HTTP 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> HTTP server.
|
|
</para>
|
|
<indexterm zone="apache apxs">
|
|
<primary sortas="b-apxs">apxs</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="checkgid">
|
|
<term><command>checkgid</command></term>
|
|
<listitem>
|
|
<para>
|
|
is a program that checks whether it can setgid to the group
|
|
specified. This is to see if it is a valid group for Apache2 to use
|
|
at runtime. If the user (should be run as superuser) is in that
|
|
group, or can setgid to it, it will return 0.
|
|
</para>
|
|
<indexterm zone="apache checkgid">
|
|
<primary sortas="b-checkgid">checkgid</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="dbmmanage">
|
|
<term><command>dbmmanage</command></term>
|
|
<listitem>
|
|
<para>
|
|
is used to create and update the DBM format files used to store
|
|
usernames and passwords for basic authentication of HTTP users.
|
|
</para>
|
|
<indexterm zone="apache dbmmanage">
|
|
<primary sortas="b-dbmmanage">dbmmanage</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="htcacheclean">
|
|
<term><command>htcacheclean</command></term>
|
|
<listitem>
|
|
<para>
|
|
is used to clean up the disk cache.
|
|
</para>
|
|
<indexterm zone="apache htcacheclean">
|
|
<primary sortas="b-htcacheclean">htcacheclean</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="htdbm">
|
|
<term><command>htdbm</command></term>
|
|
<listitem>
|
|
<para>
|
|
is used to manipulate the DBM password databases.
|
|
</para>
|
|
<indexterm zone="apache htdbm">
|
|
<primary sortas="b-htdbm">htdbm</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 HTTP 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 HTTP 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> HTTP server program.
|
|
</para>
|
|
<indexterm zone="apache httpd">
|
|
<primary sortas="b-httpd">httpd</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="httxt2dbm">
|
|
<term><command>httxt2dbm</command></term>
|
|
<listitem>
|
|
<para>
|
|
is used to generate DBM files from text, for use in RewriteMap.
|
|
</para>
|
|
<indexterm zone="apache httxt2dbm">
|
|
<primary sortas="b-httxt2dbm">httxt2dbm</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="logresolve">
|
|
<term><command>logresolve</command></term>
|
|
<listitem>
|
|
<para>
|
|
is a post-processing program to resolve IP-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>
|