OVH Community, votre nouvel espace communautaire.

[Release1] Maj Apache - PHP - Pear - Mod_SSl - CURL


edouardj
18/09/2008, 17h13
Comme j'ai cherché pendant un moment je donne ça ici:
Mise à jour d'une release1 dédié OVH:

Apache 1.3.41
Php 4.4.9
Mod_SSL 2.8.31-1.3.41
Curl 7.19.0
Mod_gzip 1.3.26.1a
Pear dernière version

Code:
#!/bin/sh

ovh=`cat /etc/ovhrelease`

SOFT_DIR=/home/ovh/src
mkdir -p $SOFT_DIR/soft

# get files
cd $SOFT_DIR/soft
wget http://curl.haxx.se/download/curl-7.19.0.tar.gz -O curl-7.19.0.tar.gz
wget ftp://ftp.ovh.net/made-in-ovh/maj-ovh/apache_1.3.41.tar.gz -O apache_1.3.41.tar.gz
wget ftp://ftp.ovh.net/made-in-ovh/maj-ovh/mod_ssl-2.8.31-1.3.41.tar.gz -O mod_ssl-2.8.31-1.3.41.tar.gz
wget ftp://ftp.ovh.net/made-in-ovh/maj-ovh/php-4.4.9.tar.gz -O php-4.4.9.tar.gz
wget ftp://ftp.ovh.net/made-in-ovh/maj-ovh/mod_gzip-1.3.26.1a.tgz -O mod_gzip.1.3.26.1a.tgz

#Maj de Pear
mkdir pear
cd pear
wget http://pear.php.net/go-pear
php -q go-pear
ln -s /home/ovh/src/soft/pear/bin/pear /usr/local/bin/pear

cd $SOFT_DIR

# on efface
rm -rf curl-7.19.0
rm -rf apache_1.3.41
rm -rf php-4.4.9
rm -rf mod_ssl-2.8.31-1.3.41

#Config Curl
cd $SOFT_DIR
tar xvzf soft/curl-7.19.0.tar.gz
cd curl-7.19.0
./configure
make
make test
make install

# pre-configure apache
cd $SOFT_DIR
tar xvzf soft/mod_gzip.1.3.26.1a.tgz
tar xvzf soft/apache_1.3.41.tar.gz

#Astuce vu sur le site origine
cd mod_gzip.1.3.26.1a
perl -pi -e "s/APXS?=.*/\/usr\/local\/apache\/sbin\/apxs/" Makefile
make
make install
#Plus la peine de compiler Apache avec --add-module=src/modules/extra/mod_gzip.c

cd $SOFT_DIR
# install de ssl pour apache
tar xvfz soft/mod_ssl-2.8.31-1.3.41.tar.gz
cd mod_ssl-2.8.31-1.3.41
./configure \
    --with-apache=../apache_1.3.41 \
    --with-ssl \
    --prefix=/usr/local/apache

cd $SOFT_DIR
# install PHP for apache
tar xvzf soft/php-4.4.9.tar.gz
cd php-4.4.9
./configure \
    --with-apache=../apache_1.3.41 \
    --with-dbase \
    --with-filepro \
    --enable-exif \
    --with-xml \
    --enable-ftp \
    --with-dba \
    --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-curl=/usr/local/bin/curl
 
make
make install

#Au cas ou
cd $SOFT_DIR
cp php-4.4.9/libs/libphp4.a apache_1.3.41/src/modules/php4/libphp4.a

# install PHP for cgi use
cd php-4.4.9
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-dba \
    --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-curl=/usr/local/bin/curl

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

/etc/rc.d/init.d/httpd stop

cd apache_1.3.41
./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=ssl #\
        #--add-module=src/modules/extra/mod_gzip.c

make
make install

#Activer mod_gzip
perl -pi -e "s/#LoadModule gzip_module/LoadModule gzip_module/" /usr/local/apache/conf/httpd.conf

/etc/rc.d/init.d/httpd start


echo "apache est en version " `/usr/local/apache/bin/httpd -v`
echo "php est en version " `/usr/local/bin/php -v`