Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Apache 2.5.0?
#!/bin/sh
# error exit code is line number
INSTALLDIR='/usr/local/apache250'
WORK='./apache-work'
COPT="--prefix=$INSTALLDIR --with-apr=srclib/apr --with-apr-util=srclib/apr-util"
REPO='git://github.com/matsumoto-r/httpd.git'
echo "Start: Apache 2.5.0 install to $INSTALLDIR"
mkdir $WORK || exit $LINENO
cd $WORK || exit $LINENO
wget http://ftp.tsukuba.wide.ad.jp/software/apache//httpd/httpd-2.4.2.tar.gz || exit $LINENO
wget http://ftp.tsukuba.wide.ad.jp/software/apache//apr/apr-1.4.6.tar.gz || exit $LINENO
wget http://ftp.tsukuba.wide.ad.jp/software/apache//apr/apr-util-1.4.1.tar.gz || exit $LINENO
tar xvf httpd-2.4.2.tar.gz || exit $LINENO
tar xvf apr-1.4.6.tar.gz || exit $LINENO
tar xvf apr-util-1.4.1.tar.gz || exit $LINENO
git clone $REPO || exit $LINENO
cd httpd/ || exit $LINENO
cp ../httpd-2.4.2/configure . || exit $LINENO
cp ../httpd-2.4.2/build/config.sub build/. || exit $LINENO
cp ../httpd-2.4.2/build/config.guess build/. || exit $LINENO
cp ../httpd-2.4.2/include/ap_config_auto.h.in include/. || exit $LINENO
cp -r ../apr-1.4.6 srclib/apr || exit $LINENO
cp -r ../apr-util-1.4.1 srclib/apr-util || exit $LINENO
cd srclib/apr || exit $LINENO
./configure --prefix=`pwd` || exit $LINENO
make || exit $LINENO
make install || exit $LINENO
cd - || exit $LINENO
cd srclib/apr-util || exit $LINENO
./configure --prefix=`pwd` --with-apr=../apr || exit $LINENO
make || exit $LINENO
make install || exit $LINENO
cd - || exit $LINENO
./configure $COPT || exit $LINENO
make || exit $LINENO
sed -i "s/^install-suexec:.*$/install-suexec: install-suexec-binary/" Makefile || exit $LINENO
make install || exit $LINENO
echo "End: Apache 2.5.0 install to $INSTALLDIR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment