Changeset efe28817


Ignore:
Timestamp:
01/25/2013 08:03:43 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
95e8211
Parents:
58f0b91
Message:

Rework Apache HTTPD instructions.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@10978 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/major/apache.xml

    r58f0b91 refe28817  
    66
    77  <!ENTITY apache-download-http
    8   "http://archive.apache.org/dist/httpd/httpd-&apache-version;.tar.bz2">
     8           "http://archive.apache.org/dist/httpd/httpd-&apache-version;.tar.bz2">
    99  <!ENTITY apache-download-ftp
    10   "ftp://apache.mirrors.pair.com/httpd/httpd-&apache-version;.tar.bz2">
     10           "ftp://apache.mirrors.pair.com/httpd/httpd-&apache-version;.tar.bz2">
    1111  <!ENTITY apache-md5sum        "87aaf7bc7e8715f0455997bb8c6791aa">
    1212  <!ENTITY apache-size          "4.4 MB">
    13   <!ENTITY apache-buildsize     "66 MB">
    14   <!ENTITY apache-time          "0.7 SBU">
     13  <!ENTITY apache-buildsize     "100 MB">
     14  <!ENTITY apache-time          "0.5 SBU">
    1515]>
    1616
     
    3030
    3131  <sect2 role="package">
    32     <title>Introduction to Apache</title>
    33 
    34     <para>
    35       The <application>Apache</application> package contains an open-source HTTP
     32    <title>Introduction to Apache HTTPD</title>
     33
     34    <para>
     35      The <application>Apache HTTPD</application> package contains an open-source HTTP
    3636      server. It is useful for creating local intranet web sites or running huge
    3737      web serving operations.
     
    7474    </itemizedlist>
    7575
    76     <bridgehead renderas="sect3">Apache Dependencies</bridgehead>
     76    <bridgehead renderas="sect3">Additional Downloads</bridgehead>
     77    <itemizedlist spacing="compact">
     78      <listitem>
     79        <para>
     80          Required patch:
     81          <ulink url="&patch-root;/httpd-&apache-version;-blfs_layout-1.patch"/>
     82        </para>
     83      </listitem>
     84    </itemizedlist>
     85
     86    <bridgehead renderas="sect3">Apache HTTPD Dependencies</bridgehead>
    7787
    7888    <bridgehead renderas="sect4">Required</bridgehead>
     
    8191    </para>
    8292
     93    <bridgehead renderas="sect4">Recommended</bridgehead>
     94    <para role="recommended">
     95      <xref linkend="openssl"/>
     96    </para>
     97
    8398    <bridgehead renderas="sect4">Optional</bridgehead>
    8499    <para role="optional">
     100      <xref linkend="db"/>, 
     101      <xref linkend="doxygen"/>,
     102      <xref linkend="lynx"/>,
    85103      <xref linkend="openldap"/>,
    86       <xref linkend="db"/>,
    87       <xref linkend="expat"/>,
    88       <xref linkend="openssl"/>,
    89104      <xref linkend="pcre"/>,
    90105      <xref linkend="rsync"/>,
    91       <xref linkend="doxygen"/>,
    92       <xref linkend="lynx"/> and
    93       <ulink url="http://www.distcache.org/">distcache</ulink>
     106      <ulink url="http://www.distcache.org/">Distcache</ulink> and
     107      <ulink url="http://www.lua.org/">Lua (5.1)</ulink>
    94108    </para>
    95109
     
    100114
    101115  <sect2 role="installation">
    102     <title>Installation of Apache</title>
     116    <title>Installation of Apache HTTPD</title>
    103117
    104118    <para>
     
    109123
    110124<screen role="root"><userinput>groupadd -g 25 apache &amp;&amp;
    111 useradd -c "Apache Server" -d /dev/null -g apache \
     125useradd -c "Apache Server" -d /srv/www -g apache \
    112126        -s /bin/false -u 25 apache</userinput></screen>
    113127
    114     <note>
    115       <para>
    116         The above command directs the <application>Apache</application> user's
    117         home directory to <filename>/dev/null</filename>.  This may not work
    118         for some add-ons such as
    119         <ulink url='http://www.viewvc.org/'><application>ViewVC</application></ulink>,
    120         a browser interface for CVS and Subversion version control repositories.
    121         See the User Notes for details for specific applications.
    122       </para>
    123     </note>
    124 
    125     <para>
    126       Build and install <application>Apache</application> by running the
     128    <para>
     129      Build and install <application>Apache HTTPD</application> by running the
    127130      following commands:
    128131    </para>
    129132
    130 <screen><userinput>cat &gt;&gt; config.layout &lt;&lt; "HERE_DOC" &amp;&amp;
    131 # BLFS FHS layout
    132 &lt;Layout FHS&gt;
    133     prefix:          /usr
    134     exec_prefix:     ${prefix}
    135     bindir:          ${exec_prefix}/bin
    136     sbindir:         ${exec_prefix}/sbin
    137     libdir:          ${exec_prefix}/lib
    138     libexecdir:      ${exec_prefix}/libexec/apache
    139     mandir:          ${prefix}/share/man
    140     sysconfdir:      /etc/apache
    141     datadir:         /srv/www
    142     installbuilddir: ${libexecdir}/build
    143     errordir:        ${datadir}/error
    144     iconsdir:        ${datadir}/icons
    145     htdocsdir:       ${datadir}/htdocs
    146     manualdir:       ${datadir}/manual
    147     cgidir:          ${datadir}/cgi-bin
    148     includedir:      ${prefix}/include/apache
    149     localstatedir:   ${datadir}
    150     runtimedir:      /var/run
    151     logfiledir:      /var/log/apache
    152     proxycachedir:   /var/cache/apache/proxy
    153 &lt;/Layout&gt;
    154 HERE_DOC
    155 ./configure --enable-layout=FHS --enable-mods-shared=all &amp;&amp;
     133<screen><userinput>patch -Np1 -i ../httpd-&apache-version;-blfs_layout-1.patch &amp;&amp;
     134./configure --enable-layout=BLFS \
     135            --enable-mods-shared="all cgi" \
     136            --enable-mpms-shared=all \
     137            --with-apr=/usr/bin/apr-1-config \
     138            --with-apr-util=/usr/bin/apu-1-config \
     139            --enable-suexec=shared \
     140            --with-suexec-bin=/usr/lib/httpd/suexec \
     141            --with-suexec-docroot=/srv/www \
     142            --with-suexec-caller=apache \
     143            --with-suexec-userdir=public_html \
     144            --with-suexec-logfile=/var/log/httpd/suexec.log \
     145            --with-suexec-uidmin=100 &amp;&amp;
    156146make</userinput></screen>
    157147
     
    166156<screen role="root"><userinput>make install &amp;&amp;
    167157
    168 chown -v root:root /usr/bin/{apxs,dbmmanage} \
    169   /usr/sbin/{apachectl,envvars{,-std}} \
    170   /usr/libexec/apache/httpd.exp \
    171   /usr/share/man/man1/{ab,apxs,dbmmanage,ht{dbm,digest,passwd,txt2dbm},logresolve}.1 \
    172   /usr/share/man/man8/{apachectl,htcacheclean,httpd,rotatelogs,suexec}.8 &amp;&amp;
     158mv -v /usr/sbin/suexec /usr/lib/httpd/suexec &amp;&amp;
     159chgrp apache /usr/lib/httpd/suexec &amp;&amp;
     160chmod 4754 /usr/lib/httpd/suexec &amp;&amp;
    173161
    174162chown -v -R apache:apache /srv/www</userinput></screen>
    175163
    176     <para>
    177       Also as the <systemitem class="username">root</systemitem> user,
    178       optionally install the html docs:
    179     </para>
    180 
    181 <screen role="root"><userinput>mkdir -p /usr/share/doc/httpd-&apache-version;/style &amp;&amp;
    182 for thing in docs/manual/*.html.en
    183 do
    184   tmp=${thing%.en}
    185   cp ${thing} /usr/share/doc/httpd-&apache-version;/${tmp##*/}
    186 done
    187 
    188 cp -rf docs/manual/images /usr/share/doc/httpd-&apache-version; &amp;&amp;
    189 cp -rf docs/manual/style/css /usr/share/doc/httpd-&apache-version;/style &amp;&amp;
    190 
    191 for directory in developer faq howto misc mod platform programs rewrite ssl vhosts
    192 do
    193   mkdir -p /usr/share/doc/httpd-&apache-version;/${directory}
    194   for thing in docs/manual/${directory}/*.html.en
    195   do
    196     tmp=${thing%.en}
    197     cp ${thing} /usr/share/doc/httpd-&apache-version;/${directory}/${tmp##*/}
    198   done
    199 done
    200 
    201 sed -i \
    202   '/developer\|faq\|misc\|mod\|programs\|rewrite\|ssl\|vhosts/s#/"#/index.html"#' \
    203   /usr/share/doc/httpd-&apache-version;/index.html</userinput></screen>
    204164  </sect2>
    205165
     
    208168
    209169    <para>
    210       <parameter>--enable-mods-shared=all</parameter>: The modules should be
     170      <parameter>--enable-mods-shared="all cgi"</parameter>: The modules should be
    211171      compiled and used as Dynamic Shared Objects (DSOs) so they can be included
    212172      and excluded from the server using the run-time configuration directives.
     
    214174
    215175    <para>
    216       <command>chown root:root ...</command>: This command changes the ownership
    217       of some installed files, the result of building the package as a user
    218       other than <systemitem class="username">root</systemitem>.
     176      <parameter>--enable-mpm-shared=all</parameter>: This switch ensures that all
     177      MPM (Multi Processing Modules) are built as Dynamic Shared Objects (DSOs),
     178      so the user can choose which one to use at runtime.
     179    </para>
     180
     181    <para>
     182      <parameter>--enable-suexec</parameter>: This switch enables building of the
     183      <application>Apache</application> suEXEC module which can be used to allow
     184      users to run CGI and SSI scripts under user IDs different from the user ID
     185      of the calling web server.
     186    </para>
     187
     188    <para>
     189      <parameter>--with-suexec-*</parameter>: These switches control suEXEC module
     190      behavior, such as default document root, minimal UID that can be used to
     191      run the script under the suEXEC. Please note that with minimal UID 100, you
     192      can't run CGI or SSI scripts under suEXEC as the
     193      <systemitem class="username">apache</systemitem> user.
     194    </para>
     195
     196    <para>
     197      <command>... /usr/lib/httpd/suexec</command>: These commands put
     198      <command>suexec</command> wrapper into proper location, since it
     199      is not meant to be run directly. They also adjust proper
     200      permissions of the binary, making it segid
     201      <systemitem class="username">apache</systemitem>.
    219202    </para>
    220203
     
    229212      <systemitem class="username">apache</systemitem> user.
    230213    </para>
     214
    231215  </sect2>
    232216
     
    238222
    239223      <para>
    240         <filename>/etc/apache/*</filename>
     224        <filename>/etc/httpd/httpd.conf</filename> and
     225        <filename>/etc/httpd/extra/*</filename>
    241226      </para>
    242227
    243228      <indexterm zone="apache apache-config">
    244         <primary sortas="e-etc-apache">/etc/apache/*</primary>
     229        <primary sortas="e-etc-httpd-httpd.conf">/etc/httpd/httpd.conf</primary>
    245230      </indexterm>
    246231
    247232      <indexterm zone="apache apache-config">
    248         <primary sortas="e-etc-apache-httpd.conf">/etc/apache/httpd.conf</primary>
     233        <primary sortas="e-etc-httpd-extra-star">/etc/httpd/extra/*</primary>
    249234      </indexterm>
     235
    250236    </sect3>
    251237
     
    254240
    255241      <para>
    256         The main configuration file is named
    257         <filename>/etc/apache/httpd.conf</filename>. Modify it so that the HTTP
    258         server runs as the dedicated user and group:
    259       </para>
    260 
    261 <screen role="root"><userinput>sed -i "s/daemon$/apache/" /etc/apache/httpd.conf</userinput></screen>
    262 
    263       <para>
    264         See <ulink url="/usr/share/doc/httpd-&apache-version;/configuring.html"/>
     242        See <ulink url="/usr/share/httpd/manual/configuring.html"/>
    265243        for detailed instructions on customising your
    266244        <application>Apache</application> HTTP server configuration file.
    267245      </para>
     246
    268247    </sect3>
    269248
     
    273252      <para>
    274253        If you want the <application>Apache</application> server to
    275       start automatically when the system is booted, install the
    276       <filename>/etc/rc.d/init.d/httpd</filename> init script included
    277       in the <xref linkend="bootscripts"/> package.
    278         </para>
     254        start automatically when the system is booted, install the
     255        <filename>/etc/rc.d/init.d/httpd</filename> init script included
     256        in the <xref linkend="bootscripts"/> package.
     257      </para>
    279258
    280259      <indexterm zone="apache httpd-init">
     
    296275      <seglistitem>
    297276        <seg>
    298           ab, apachectl, apxs, checkgid, dbmmanage, htcacheclean, htdbm,
    299           htdigest, htpasswd, httpd, httxt2dbm, logresolve and rotatelogs
     277          ab, apachectl, apxs, checkgid, dbmmanage, fcgistarter, htcacheclean,
     278          htdbm, htdigest, htpasswd, httpd, httxt2dbm, logresolve and rotatelogs
    300279        </seg>
    301280        <seg>
     
    303282        </seg>
    304283        <seg>
    305           /etc/apache, /srv/www, /usr/include/apache, /usr/libexec/apache, 
    306           and /var/log/apache.
     284          /etc/httpd,
     285          /srv/www,
     286          /usr/include/httpd,
     287          /usr/lib/httpd,
     288          /usr/share/httpd
     289          /var/log/httpd and
     290          /var/run/httpd
    307291        </seg>
    308292      </seglistitem>
     
    481465        </listitem>
    482466      </varlistentry>
     467
    483468    </variablelist>
     469
    484470  </sect2>
     471
    485472</sect1>
Note: See TracChangeset for help on using the changeset viewer.