Apache

From CBLFS
Jump to navigationJump to search
Download Source: http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2
Download Patch: http://svn.cross-lfs.org/svn/repos/patches/httpd/httpd-2.2.19-config-1.patch

Introduction to Apache

The Apache package contains an open-source HTTP server. It is useful for creating local intranet web sites or running huge web serving operations.

Project Homepage: http://httpd.apache.org/

Dependencies

Optional

Creating the Apache User/Group

groupadd -g 25 apache &&
useradd -c "Apache Server" -d /dev/null -g apache \
        -s /bin/false -u 25 apache

Configuration Information

See ./configure --help for more configuration options.

The following will add SSL support:

--enable-ssl

Non-Multilib

The following patch modifies the layout of destination directories and among them, the build directory at /usr/lib/apache/build. This will allow the modules added to Apache to be configured without errors:

patch -Np1 -i ../httpd-2.2.19-config-1.patch

Compile the package:

./configure --enable-layout=FHS --enable-mods-shared=all &&
make

Install the package

make install &&
chown -v root:root /usr/lib/apache/httpd.exp \
    /usr/sbin/{apxs,apachectl,dbmmanage,envvars{,-std}} \
    /usr/share/man/man1/{dbmmanage,ht{dbm,digest,passwd}}.1 \
    /usr/share/man/man8/{ab,apachectl,apxs,htcacheclean,httpd}.8 \
    /usr/share/man/man8/{logresolve,rotatelogs,suexec}.8 &&
chown -Rv apache:apache /srv/www

Multilib

32Bit

The following patch modifies the layout of destination directories and among them, the build directory at /usr/lib/apache/build. This will allow the modules added to Apache to be configured without errors:

patch -Np1 -i ../httpd-2.2.19-config-1.patch

Compile the package:

CC="gcc ${BUILD32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" USE_ARCH=32 \
./configure --enable-layout=FHS --enable-mods-shared=all &&
make

Install the package

make install &&
mv -v /usr/sbin/apxs{,-32}

If you intend on installing an 64bit version then remove the config files as they hard-code the paths to plugins:

rm -rf /etc/apache

If you built Apache with the internal APR and APR-util then run the following commands:

mv -v /usr/bin/apr-1-config{,-32}
mv -v /usr/bin/apu-1-config{,-32}

N32

Please contribute this section

64Bit

The following patch modifies the layout of destination directories and among them, the build directory at /usr/lib/apache/build. This will allow the modules added to Apache to be configured without errors:

patch -Np1 -i ../httpd-2.2.19-config-1.patch

Compile the package:

sed -i -e "s/lib$/&64/" \
       -e "s:lib/apache$:lib64/apache:g" config.layout &&
sed -i -e "/expat_ldflags/s:/lib:&64:" \
       -e "/expat_libtool/s:/lib/:/lib64/:" srclib/apr-util/configure &&
CC="gcc ${BUILD64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" USE_ARCH=64 \
./configure --enable-layout=FHS --enable-mods-shared=all --libdir=/usr/lib64 \
    --libexecdir=/usr/lib64/apache &&
make

Install the package

make install &&
mv -v /usr/sbin/apxs{,-64} &&
ln -sfv /usr/bin/multiarch_wrapper /usr/sbin/apxs &&
chown -v root:root /usr/lib64/apache/httpd.exp \
    /usr/sbin/{apxs,apachectl,dbmmanage,envvars{,-std}} \
    /usr/share/man/man1/{dbmmanage,ht{dbm,digest,passwd}}.1 \
    /usr/share/man/man8/{ab,apachectl,apxs,htcacheclean,httpd}.8 \
    /usr/share/man/man8/{logresolve,rotatelogs,suexec}.8 &&
chown -Rv apache:apache /srv/www

If you built Apache with the internal APR and APR-util then run the following commands:

mv -v /usr/bin/apr-1-config{,-64} &&
ln -sfv multiarch_wrapper /usr/bin/apr-1-config &&
mv -v /usr/bin/apu-1-config{,-64} &&
ln -sfv multiarch_wrapper /usr/bin/apu-1-config

Configuring

The main configuration file is named /etc/apache/httpd.conf. Modify it so that the HTTP server runs as the dedicated user and group:

sed -i -e "s/User daemon/User apache/" \
       -e "s/Group daemon/Group apache/" \
    /etc/apache/httpd.conf

Bootscript

Install the init script provided by the bootscripts package:

make install-apache