#!/bin/sh
SOFT_DIR=/home/ovh/src
mkdir -p $SOFT_DIR/soft
# get files
cd $SOFT_DIR/soft
wget
ftp://ftp.ovh.net/made-in-ovh/maj-ovh/apache_1.3.37.tar.gz -O apache_1.3.37.tar.gz
wget
ftp://ftp.ovh.net/made-in-ovh/maj-ovh/mod...8-1.3.37.tar.gz -O mod_ssl-2.8.28-1.3.37.tar.gz
wget
ftp://ftp.ovh.net/made-in-ovh/maj-ovh/php-4.4.4.tar.gz -O php-4.4.4.tar.gz
wget
ftp://ftp.ovh.net/made-in-ovh/maj-ovh/mod_gzip.c.gz -O mod_gzip.c.gz
cd $SOFT_DIR
# on efface en cas où
rm -rf apache_1.3.34
rm -rf php-4.4.2
rm -rf mod_ssl-2.8.25-1.3.34
cd $SOFT_DIR
# pre-configure apache
gunzip -f soft/mod_gzip.c.gz
tar xvzf soft/apache_1.3.37.tar.gz
cd apache_1.3.37
cp ../soft/mod_gzip.c src/modules/extra/
./configure --prefix=/usr/local/apache
cd $SOFT_DIR
# install de ssl pour apache
tar xvfz soft/mod_ssl-2.8.28-1.3.37.tar.gz
cd mod_ssl-2.8.28-1.3.37
./configure \
--with-apache=../apache_1.3.37 \
--with-ssl \
--prefix=/usr/local/apache
cd $SOFT_DIR
# install PHP for apache
tar xvzf soft/php-4.4.4.tar.gz
cd php-4.4.4
./configure \
--with-apache=../apache_1.3.37 \
--with-dbase \
--with-filepro \
--enable-exif \
--with-xml \
--enable-ftp \
--with-db \
--enable-bcmath \
--enable-calendar \
--with-jpeg-dir \
--with-png-dir \
--with-gd \
--enable-gd-native-ttf \
--with-freetype-dir \
--with-gettext \
--with-mysql=/usr \
--with-zlib-dir \
--enable-trans-sid \
--with-imap \
--with-kerberos \
--with-imap-ssl \
--with-openssl \
--enable-sysvsem \
--enable-sysvshm \
--with-gettext \
--with-dom \
--with-mcrypt \
--with-iconv \
--enable-mbstring=all \
--enable-mbregex \
--with-gd \
--with-png-dir=/usr \
--with-jpeg-dir=/usr \
--with-mime-magic=/usr/share/magic.mime
# --with-pgsql=/usr \
make
make install
# install PHP for cgi use
perl -pi -e "s/cgi = 1;/cgi = 0;/" sapi/cgi/cgi_main.c
./configure \
--with-dbase \
--with-filepro \
--with-xml \
--enable-exif \
--enable-ftp \
--with-db \
--enable-bcmath \
--enable-calendar \
--with-jpeg-dir \
--with-png-dir \
--with-gd \
--enable-gd-native-ttf \
--with-freetype-dir \
--with-gettext \
--with-mysql=/usr \
--with-zlib-dir \
--enable-trans-sid \
--with-imap \
--with-kerberos \
--with-imap-ssl \
--with-openssl \
--enable-sysvsem \
--enable-sysvshm \
--with-gettext \
--with-dom \
--with-mcrypt \
--with-iconv \
--enable-mbstring=all \
--enable-mbregex \
--with-gd \
--with-png-dir=/usr \
--with-jpeg-dir=/usr \
--with-mime-magic=/usr/share/magic.mime
# --with-pgsql=/usr \
make
make install
# avant de partir on remet par defaut la
# compilation de la version module
perl -pi -e "s/cgi = 0;/cgi = 1;/" sapi/cgi/cgi_main.c
cd $SOFT_DIR
# apache
cd apache_1.3.37
./configure \
--prefix=/usr/local/apache \
--activate-module=src/modules/php4/libphp4.a \
--enable-suexec \
--suexec-caller=nobody \
--suexec-userdir=www \
--suexec-docroot=/home \
--suexec-logfile=/usr/local/apache/logs/cgi.log \
--suexec-uidmin=99 \
--suexec-gidmin=99 \
--suexec-safepath=/usr/local/bin:/usr/bin:/bin \
--enable-module=so \
--enable-module=rewrite \
--enable-module=vhost_alias\
--add-module=src/modules/extra/mod_gzip.c \
--enable-module=ssl
make && make install && /etc/rc.d/init.d/httpd restart
echo "apache est en version " `/usr/local/apache/bin/httpd -v`
echo "php est en version " `/usr/local/bin/php -v`
Pour les erreurs, en plus des commande not found, il ne fait les make et les make install