Comandos en modo chuleta:
# nano /etc/apt/sources.list
deb http://ftp.debian.org/debian/ lenny main contrib non-free
# nano /etc/apt/preferences
Package: php5*
Pin: release a=oldstable
Pin-Priority: 700
Package: *
Pin: release a=stable
Pin-Priority: 600
# aptitude update
# aptitude remove `dpkg -l | grep php| awk '{print $2}' `
# aptitude install libkrb53
# apt-get install -t lenny ` dpkg -l | grep php| grep -v libssh | awk '{print $2}' `
# aptitude install -t lenny php5-mhash
# aptitude install php-pear php5-dev -t lenny
Añadir a sources.list:
# nano /etc/apt/sources.list
deb http://backports.debian.org/debian-backports lenny-backports main contrib non-free
# aptitude install -t lenny-backports libssh2-php
# nano /etc/apache2/sites-enabled/000-default:
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# a2enmod rewrite
# aptitude install librrd2-dev
# aptitude install -t lenny-backports rrdtool
# cd /root
# mkdir php_rrdtool
# cd php_rrdtool/
# wget http://oss.oetiker.ch/rrdtool/pub/contrib/php_rrdtool.tar.gz
# tar xvzf php_rrdtool.tar.gz
# mv rrdtool /usr/include/php5/ext
# cd /usr/include/php5/ext/rrdtool
# phpize
# ./configure --with-php-config=/usr/bin/php-config --with-rrdtool=/usr
# make ; make install
# cd /etc/php5/conf.d/
# nano rrdtool.ini
;enable rrdtool extension module
extension=rrdtool.so
# /etc/init.d/apache2 restart
Aparece el siguiente error:
PHP Warning: PHP Startup: rrdtool: Unable to initialize module\nModule compiled with module API=20090626, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=0\nThese options need to match\n in Unknown on line 0
# cd /usr/lib/php5/
# ll
total 20
drwxr-xr-x 2 root root 4096 ago 11 19:28 20060613+lfs
drwxr-xr-x 2 root root 4096 ago 11 19:01 20090626+lfs
drwxr-xr-x 2 root root 4096 ago 11 19:05 build
drwxr-xr-x 2 root root 4096 ago 4 2010 libexec
-rwxr-xr-x 1 root root 278 ago 4 2010 maxlifetime
# ll /usr/lib/php5/20090626+lfs/
total 48
-rwxr-xr-x 1 root root 48641 ago 11 02:43 rrdtool.so
# rm -rf 20090626+lfs/
# /etc/init.d/apache2 restart
# aptitude safe-upgrade
Resolviendo las dependencias...
Se ELIMINARÁN los siguientes paquetes:
libltdl3-dev{u}
Se actualizarán los siguientes paquetes:
autoconf automake automake1.4 autotools-dev libdb4.6 libmcrypt4 libmhash2 libtool m4 rrdtool shtool
Entramos a la configuración desde el navegador.
http://miip/settings_core.php
Cambiamos "Path to rrdtool binary:"
/usr/bin/rrdtool
# cd /usr/share/fonts/truetype/ttf-dejavu
# wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool-trac/browser/branches/1.2/program/src/DejaVuSansMono-Roman.ttf?format=raw
# mv DejaVuSansMono-Roman.ttf\?format\=raw DejaVuSansMono-Roman.ttf
Cambiamos "Path to font (for rrdtool):"
/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf
Cambiamos "Statistics URL: ":
ponemos nuestra ip/dominio en sustitución de domain.com
Pulsamos sobre save.
# mkdir /home/rrddata
# mkdir /home/graphics
Añadir a /etc/crontab:
* * * * * /usr/bin/php -q /var/scalr/app/cron-ng/cron.php --SNMPStatsPoller
# /etc/init.d/cron restart
Descargamos nuestro certificados X.509 desde nuestra cuenta de amazon y la copiamos en:
$ scp -i aws.pem pk* root@maquina.eu-west-1.compute.amazonaws.com:/var/scalr/app/etc/
$ scp -i aws.pem cert* root@maquina.eu-west-1.compute.amazonaws.com:/var/scalr/app/etc/
Continuamos con el Warning de php para rrdtool:
# cd /usr/include/php5/ext/rrdtool
# rm -rf rrdtool/
# cd
# cd php_rrdtool/
# tar xvzf php_rrdtool.tar.gz
# mv rrdtool /usr/include/php5/ext
# cd /usr/include/php5/ext/rrdtool/
# phpize
# aptitude search libtool
# apt-cache policy libtool
# locate libtool.m4
# aptitude remove libtool
# aptitude install libtool php5-dev -t lenny
# phpize
root@DB:/usr/include/php5/ext/rrdtool# phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions
Obtenemos estos warnings para ya podemos continuar con el make:
# ./configure --with-php-config=/usr/bin/php-config --with-rrdtool=/usr
# make ; make install
# cd /etc/php5/conf.d/
# nano rrdtool.ini
;enable rrdtool extension module
extension=rrdtool.so
# /etc/init.d/apache2 restart
También nos faltaba este paso de la instalación anterior.
mysql> grant all privileges on scalr.* to 'scalr'@'localhost' identified by 'contraseña';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Bueno funciona pero los tenemos los mismos errores en el dashboard que obteníamos con php 5.3
Referencias:
http://atom-hosting.com/blog/?p=52
Continuará ...