#!/bin/bash # Basic setup mkdir -p /web /web/src /web/support /web/support/lib /web/support/etc export LD_LIBRARY_PATH=/web/support/lib # Downloads pushd /web/src # Freetype (prereq for GD) wget -c "http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.bz2" # LibJPEG (prereq for GD) wget -c "http://freshmeat.net/redir/libjpeg/5665/url_tgz/jpegsrc.v6b.tar.gz" # LibPNG (prereq for GD) wget -c "http://superb-west.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.25.tar.bz2" # GD (prereq for PHP) wget -c "http://www.libgd.org/releases/gd-2.0.35.tar.bz2" # Mcrypt (prereq for PHP) wget -c "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.bz2?modtime=1171868442&big_mirror=0" wget -c "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.7.tar.gz?modtime=1194463373&big_mirror=0" # Mhash (prereq for PHP) wget -c "http://downloads.sourceforge.net/mhash/mhash-0.9.9.tar.bz2?modtime=1175740797&big_mirror=0" # OpenSSL wget -c "http://www.openssl.org/source/openssl-0.9.8g.tar.gz" # PostgreSQL wget -c "http://ftp7.us.postgresql.org/pub/postgresql//source/v8.3.0/postgresql-8.3.0.tar.bz2" # IODBC (Database connector for postgres) wget -c "http://www.iodbc.org/downloads/iODBC/libiodbc-3.52.6.tar.gz" wget -c "http://ftp7.us.postgresql.org/pub/postgresql//odbc/versions/src/psqlodbc-08.03.0100.tar.gz" # OpenLDAP wget -c "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.8.tgz" # PHP wget -c "http://us3.php.net/get/php-5.2.5.tar.bz2/from/us.php.net/mirror" # eAccelerator wget -c "http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2" # Lighttpd (Web Server) wget -c "http://www.lighttpd.net/download/lighttpd-1.4.19.tar.bz2" # DoveCot (IMAP Server) wget -c "http://dovecot.org/releases/1.0/dovecot-1.0.12.tar.gz" popd # FreeType pushd /web/src tar xvjf freetype-2.3.5.tar.bz2 cd freetype-2.3.5 ./configure --prefix=/web/support --enable-shared --enable-static make && make install popd # LibPNG pushd /web/src tar xvjf libpng-1.2.25.tar.bz2 cd libpng-1.2.25 ./configure --prefix=/web/support --enable-shared --enable-static make && make install popd # LibJPEG mkdir -p /web/support/man/man1 pushd /web/src tar xvzf jpegsrc.v6b.tar.gz cd jpeg-6b ./configure --prefix=/web/support make && make install && make install-lib popd # GD pushd /web/src tar xvjf gd-2.0.35.tar.bz2 cd gd-2.0.35 CFLAGS=-I/web/support/include LDFLAGS=-L/web/support/lib PATH=/web/support/bin:${PATH} ./configure --prefix=/web/support --without-x --without-xpm --without-fontconfig \ --enable-shared --enable-static --with-jpeg=/web/support autoconf automake make && make install popd # MHash pushd /web/src tar xvjf mhash-0.9.9.tar.bz2 cd mhash-0.9.9 ./configure --prefix=/web/support --enable-shared --enable-static make && make install popd # libMCrypt pushd /web/src tar xvjf libmcrypt-2.5.8.tar.bz2 cd libmcrypt-2.5.8 ./configure --prefix=/web/support --enable-shared --enable-static make && make install popd # MCrypt pushd /web/src tar xvzf mcrypt-2.6.7.tar.gz cd mcrypt-2.6.7 CFLAGS=-I/web/support/include LDFLAGS=-L/web/support/lib PATH=/web/support/bin:${PATH} ./configure --prefix=/web/support --enable-shared --enable-static make && make install popd # OpenSSL pushd /web/src tar xvzf openssl-0.9.8g.tar.gz ./config --prefix=/web/support zlib shared make && make install popd # Install PostgreSQL pushd /web/src tar xvjf postgresql-8.3.0.tar.bz2 cd postgresql-8.3.0 CFLAGS=-I/web/support/include LDFLAGS=-L/web/support/lib PATH=/web/support/bin:${PATH} ./configure --prefix=/web/support --enable-shared \ --with-includes=/web/support/include --with-libraries=/web/support/lib --without-tcl --without-perl --without-python gmake && gmake install popd # PHP pushd /web/src tar xvjf php-5.2.5.tar.bz2 cd php-5.2.5 CFLAGS=-I/web/support/include LDFLAGS=-L/web/support/lib PATH=/web/support/bin:${PATH} ./configure --prefix=/web/php --enable-shared --enable-static \ --enable-fastcgi --enable-force-cgi-redirect --enable-discard-path --with-layout=GNU --with-freetype-dir=/web/support --with-gd=/web/support \ --with-jpeg-dir=/web/support --with-png-dir=/web/support --with-mcrypt=/web/support --with-mhash=/web/support --with-openssl-dir=/web/support \ --with-pgsql=/web/support --includedir=/web/support/include # Make sure that support is the first path cat Makefile | sed 's/-I\/usr\/include -I\/web\/support\/include/-I\/web\/support\/include -I\/usr\/include/g' > Makefile.new rm -f Makefile mv Makefile.new Makefile make && make install # PHP.ini rm -f /web/php/etc/php.ini cat php.ini-recommended | grep -v extension_dir > /web/php/etc/php.ini echo "include_path = \".:/web/php/share/pear\"" >> /web/php/etc/php.ini popd # eAccelerator pushd /web/src tar xvjf eaccelerator-0.9.5.2.tar.bz2 cd eaccelerator-0.9.5.2 CFLAGS=-I/web/support/include LDFLAGS=-L/web/support/lib PATH=/web/support/bin:${PATH} /web/php/bin/phpize CFLAGS=-I/web/support/include LDFLAGS=-L/web/support/lib PATH=/web/support/bin:${PATH} ./configure --prefix=/web/support --enable-shared --enable-static \ --enable-eaccelerator=shared --with-php-config=/web/php/bin/php-config make && make install popd # eAccelerator PHP.ini cat >> /web/php/etc/php.ini <