#!/bin/bash ################## # _._ # /_ _`. (c) 2003, David A. Desrosiers # (.(.)| hacker at gnu dash designs dot com # |\_/'| # )____`\ Apache All-in-One Builder # //_V _\ \ # (( | `(_) If you find this useful, please drop me # / \> ' / \ an email, or send me bug reports if you find # \ \.__./ / problems with it. I accept PayPal too! =-) # `-' `-' # ################## # # License # ################## # # This script is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This script is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., 59 # Temple Place # - Suite 330, Boston, MA 02111-1307, USA. # ################### # # TODO: # # Last update: Sat Oct 18 19:13:53 EDT 2003 # ################## # # You will need the following perl modules installed first: # # MIME::Base64 # URI # HTML::Parser # Digest::MD5 # Bundle::libnet # LWP # ########################################################## # # Sources: # # Apache2...: ftp://apache.mirrors.pair.com/httpd/httpd-2.0.xx.tar.gz # PHP.......: http://fi.php.net/distributions/php-4.3.x.tar.gz # MM........: ftp://ftp.ossp.org/pkg/lib/mm/mm-1.3.0.tar.gz # mod-perl..: http://perl.apache.org/dist/mod_perl-1.99_10.tar.gz # ############################################################################# APACHE=httpd-2.2.4 APURL=ftp://apache.mirrors.pair.com/httpd/$APACHE.tar.gz # Prefix where Apache is going to be installed AP_PREFIX=/usr/local/apache2 MM=mm-1.3.0 MMURL=ftp://ftp.ossp.org/pkg/lib/mm/$MM.tar.gz PHP=php-5.2.3 PHPURL=http://fi.php.net/distributions/$PHP.tar.gz MODPERL=mod_perl-2.0.2 MODPERLURL=http://www.ibiblio.org/pub/mirrors/apache/perl/$MODPERL.tar.gz ########################################################## # # Startup stuff # ########################################################## # Directory of tarballs THISDIR=`pwd` WORKROOT=/var/build/apache WORKDIR=$WORKROOT/work MD5FILE=$THISDIR/source.md5 source functions wherebe GREP grep wherebe GUNZIP gunzip wherebe LEX lex wherebe MAKE make wherebe MD5SUM md5sum wherebe MKDIR mkdir wherebe OPENSSL openssl wherebe PERL perl wherebe RM rm wherebe SUDO sudo wherebe TAR tar wherebe WGET wget echo "" if [ ! -d $WORKROOT ]; then echo "FATAL ERROR: WORKROOT ($WORKROOT) did not exist, exiting now.." echo "" echo "Please make sure to set the WORKROOT value properly in the script The other" echo "necessary directories will be created automagically if they do not already" echo "exist. All of the building will be done inside the directory you set here." echo "" exit fi if [ ! -d $WORKDIR ]; then echo " ERROR: WORKDIR ($WORKDIR) did not exist.. creating now." echo "" $MKDIR $WORKDIR fi ########################################################## # # Fetch, unpack, and test everything # ########################################################## URLS=($MMURL $APURL $PHPURL $MODPERLURL) BINS=($MM $APACHE $PHP $MODPERL) for b in ${BINS[@]}; do if [ ! -f $WORKROOT/$b.tar.gz ]; then for u in ${URLS[@]}; do echo " Source not found. fetching from $u.."; $WGET -c -q --progress=dot $u; done; else md5check $b.tar.gz fi done echo "" ########################################################## # # Shared Memory Allocation # ########################################################## cd $WORKDIR/$MM ./configure --disable-shared || exit make -j2 || exit make test # && make install ########################################################## # # Apache # ########################################################## cd $WORKDIR/$APACHE SSL_BASE=/usr \ LIBS=-lpthread \ EAPI_MM=../$MM \ ./configure \ --prefix=$AP_PREFIX \ --with-mpm=worker \ --enable-auth-anon \ --enable-auth-dbm \ --enable-auth-digest \ --enable-bucketeer \ --enable-cache \ --enable-case-filter \ --enable-case-filter-in \ --enable-cern-meta \ --enable-cgi \ --enable-cgid \ --enable-charset-lite \ --enable-dav \ --enable-dav-fs \ --enable-deflate \ --enable-deflate \ --enable-disk-cache \ --enable-dumpio \ --enable-echo \ --enable-example \ --enable-expires \ --enable-ext-filter \ --enable-file-cache \ --enable-headers \ --enable-http \ --enable-info \ --enable-log-forensic \ --enable-logio \ --enable-mem-cache \ --enable-mime-magic \ --enable-optional-fn-export \ --enable-optional-fn-import \ --enable-optional-hook-export \ --enable-optional-hook-import \ --enable-proxy \ --enable-proxy-ajp \ --enable-proxy-balancer \ --enable-proxy-connect \ --enable-proxy-ftp \ --enable-proxy-http \ --enable-rewrite \ --enable-speling \ --enable-ssl \ --enable-suexec \ --enable-unique-id \ --enable-usertrack \ --enable-vhost-alias \ --enable-mods-shared=all \ --enable-so \ --enable-rule=SHARED_CORE \ --enable-rule=SHARED_CHAIN || exit make -j2 || exit make install ########################################################## # # compile php as DSO # ########################################################## cd $WORKDIR/$PHP ./configure \ --with-apxs2=$AP_PREFIX/bin/apxs \ --disable-debug \ --enable-apc \ --enable-bcmath \ --enable-exif \ --enable-ftp \ --enable-gd-native-ttf \ --enable-inline-optimization \ --enable-libgcc \ --enable-magic-quotes \ --enable-memory-limit \ --enable-mysql \ --with-mysql=/usr \ --enable-sysvshm \ --enable-track-vars \ --enable-trans-sid \ --enable-wddx \ --with-calendar=shared \ --with-freetype-dir=/usr \ --with-gd=/usr \ --with-gettext=/usr \ --with-imap=/usr \ --with-imap-ssl \ --with-jpeg-dir=/usr \ --with-kerberos \ --with-mysql=/usr \ --with-openssl=/usr \ --with-png-dir=/usr \ --with-t1lib=/usr \ --with-ttf \ --with-zlib \ --with-zlib-dir=/usr || exit make -j2 || exit # make install # sudo cp php.ini-dist /usr/local/lib/php.ini ########################################################## # # compile mod_perl DSO # ########################################################## cd $WORKDIR/$MODPERL perl Makefile.PL \ USE_APXS=1 \ USE_THREADS=1 \ MP_AP_PREFIX=$AP_PREFIX \ WITH_APXS=$AP_PREFIX/bin/apxs \ EVERYTHING=1 || exit make -j2 || exit # make install # DONE! # .dd