SaltyCrane Blog — Notes on JavaScript and web development

Notes on installing Scalr on Ubuntu Jaunty

Here are my notes on installing Scalr. I am using an Alestic Ubuntu 9.04-jaunty-base-20091011 image. Here are my references:

Install prerequisites

apt-get update
apt-get upgrade
apt-get install php5
apt-get install php5-mysql
apt-get install php5-mcrypt
apt-get install php5-mhash
apt-get install php5-snmp
# apt-get install bind9

Install php ssh2 extension

http://www.how2pc.co.il/blog/2009/08/how-to-install-a-php-ssh2-extension-on-ubuntu-server-9-04/

apt-get install php5-dev php5-cli php-pear build-essential
apt-get install libssh2-1-dev
pecl install -f ssh2
echo ‘extension=ssh2.so’ > /etc/php5/conf.d/ssh2.ini

Install snmp

apt-get install snmp
# apt-get install snmpd

Test environment (optional)

/etc/init.d/apache2 restart
cd /var/www
wget http://scalr.googlecode.com/files/testenvironment.php

Visit http://ec2-XX-XXX-XXX-XX.compute-1.amazonaws.com/testenvironment.php in your browser. You should get the follwing error:

Warning: require_once(/var/www/../src/prepend.inc.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/testenvironment.php on line 93

Fatal error: require_once() [function.require]: Failed opening required '/var/www/../src/prepend.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/testenvironment.php on line 93

This error means extensions were set up correctly.

Install Scalr code

cd /var
wget http://scalr.googlecode.com/files/scalr-1.1.0.tar.gz
tar zxvf scalr-1.1.0.tar.gz
chown -R www-data:www-data /var/scalr/app/cache /var/scalr/app/cron/cron.pid /var/scalr/app/etc/.passwd
chmod 700 -R /var/scalr/app/cache /var/scalr/app/cron/cron.pid /var/scalr/app/etc/.passwd
mv www www_old
ln -s /var/scalr/app/www /var/www
# chmod a+rX -R /var/www

Setup MySQL database

apt-get install mysql-server
mysqladmin -p create scalr
mysql -p scalr < /var/scalr/sql/database.sql

Edit /var/scalr/app/etc/config.ini with your database settings.

Configure account

Set up cron jobs

To do. See other references.

Comments