Difference between revisions of "Apache"

From CBLFS
Jump to navigationJump to search
 
 
(17 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
|-
 
|-
 
!Download Source:
 
!Download Source:
| http://www.apache.org/dist/httpd/httpd-2.2.3.tar.bz2
+
| http://www.apache.org/dist/httpd/httpd-{{Apache-Version}}.tar.bz2
 
|-
 
|-
 
!Download Patch:
 
!Download Patch:
| http://svn.cross-lfs.org/svn/repos/patches/httpd/httpd-2.2.3-config-1.patch
+
| http://svn.cross-lfs.org/svn/repos/patches/httpd/httpd-{{Apache-Version}}-config-1.patch
 
|}
 
|}
  
 
----
 
----
 +
 +
{{Package-Introduction|The Apache package contains an open-source HTTP server. It is useful for creating local intranet web sites or running huge web serving operations.|http://httpd.apache.org/}}
  
 
== Dependencies ==
 
== Dependencies ==
Line 33: Line 35:
  
 
See '''./configure --help''' for more configuration options.
 
See '''./configure --help''' for more configuration options.
 +
 +
The following will add SSL support:
 +
 +
--enable-ssl
  
 
== Non-Multilib ==
 
== Non-Multilib ==
Line 38: Line 44:
 
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:
 
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.3-config-1.patch
+
  patch -Np1 -i ../httpd-{{Apache-Version}}-config-1.patch
  
 
Compile the package:
 
Compile the package:
Line 61: Line 67:
 
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:
 
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.3-config-1.patch
+
  patch -Np1 -i ../httpd-{{Apache-Version}}-config-1.patch
  
 
Compile the package:
 
Compile the package:
 
+
 
  CC="gcc ${BUILD32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" USE_ARCH=32 \
 
  CC="gcc ${BUILD32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" USE_ARCH=32 \
 
  ./configure --enable-layout=FHS --enable-mods-shared=all &&
 
  ./configure --enable-layout=FHS --enable-mods-shared=all &&
Line 71: Line 77:
 
Install the package
 
Install the package
  
  make install
+
  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:
 
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/apr-1-config{,-32}
ln -sfv multiarch_wrapper /usr/bin/apr-1-config &&
+
  mv -v /usr/bin/apu-1-config{,-32}
  mv -v /usr/bin/apu-1-config{,-32} &&
 
ln -sfv multiarch_wrapper /usr/bin/apu-1-config
 
  
 
=== N32 ===
 
=== N32 ===
Line 88: Line 97:
 
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:
 
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.3-config-1.patch
+
  patch -Np1 -i ../httpd-{{Apache-Version}}-config-1.patch
  
 
Compile the package:
 
Compile the package:
Line 97: Line 106:
 
         -e "/expat_libtool/s:/lib/:/lib64/:" srclib/apr-util/configure &&
 
         -e "/expat_libtool/s:/lib/:/lib64/:" srclib/apr-util/configure &&
 
  CC="gcc ${BUILD64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" USE_ARCH=64 \
 
  CC="gcc ${BUILD64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" USE_ARCH=64 \
  ./configure --enable-layout=FHS --enable-mods-shared=all --libdir=/usr/lib64 &&
+
  ./configure --enable-layout=FHS --enable-mods-shared=all --libdir=/usr/lib64 \
 +
    --libexecdir=/usr/lib64/apache &&
 
  make
 
  make
  
 
Install the package
 
Install the package
  
  make install
+
  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:
 
If you built Apache with the internal [[APR]] and [[APR-util]] then run the following commands:
Line 110: Line 128:
 
  mv -v /usr/bin/apu-1-config{,-64} &&
 
  mv -v /usr/bin/apu-1-config{,-64} &&
 
  ln -sfv multiarch_wrapper /usr/bin/apu-1-config
 
  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
 +
 +
[[Category:Servers]]

Latest revision as of 08:00, 15 May 2010

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
Retrieved from "?title=Apache&oldid=20210"