Scalr is a fully redundant, self-curing and self-scaling hosting environment utilizing Amazon’s EC2.
It allows you to create server farms through a web-based interface using prebuilt AMI’s for load balancers (pound or nginx), app servers (apache, others), databases (mysql master-slave, others), and a generic AMI to build on top of. (see http://code.google.com/p/scalr/)
Install the necessary packages
You will need utterramblings repo’s to install PHP 5.2.6, see - http://www.how-to-linux.com/2008/12/how-to-upgrade-to-php-526-on-centos-52/
yum install httpd mysql-server gcc mysql-server php-devel php-cli php-mysql php-mcrypt php-mhash php-snmp php-pear php-soap php-xml
You will need to install ssh2 php support, currently it is still in beta use;
libssh2 from yum does not work so build the one scalr needs from source
wget http://downloads.sourceforge.net/libssh2/libssh2-1.0.tar.gz?modtime=1230332100&big_mirror=0
./configure
make
make install
Then
pecl install ssh2-beta
Now you need to update your php.ini file by adding
extension=ssh2.so
Restart your webserver
service httpd restart
See install instructions – http://th.php.net/manual/en/ssh2.installation.php
Use the scalr’s checkenvironment.php script to check everything is ok.
wget http://scalr.googlecode.com/files/checkenvironment.php
chmod 777 checkenvironment.php
Run it on the command line
php checkenvironment.php
Download the scalr tar package
wget http://scalr.googlecode.com/files/scalr-1.0RC3.tar.gz
untar
tar xvfz scalr-1.0RC3.tar.gz
mv the contents of the app folder to /var/www/html/
mv scalr/app/* /var/www/html/
Set permissions on the following folders (and subfolders) and files to 777 (world-writable):
cache
cron/cron.pid
etc/.passwd
Create a mysql database and import data
mysql -u root
create database scalr;
quit
mysql -u root -h localhost scalr < sql/database.sql
Edit the database config settings in etc/config.ini file.
Set Cron jobs
For system to work properly, it needs to run a few tasks periodicaly. Scalr has a single cron/cron.php file that must be executed with various command-line switches. The following tasks must be sheduled:
* * * * * /path/to/php -q /scalr_home_dir/cron/cron.php –Poller
1 1 * * * /path/to/php -q /scalr_home_dir/cron/cron.php –RotateLogs
*/15 * * * * /path/to/php -q /scalr_home_dir/cron/cron.php –MySQLMaintenance
*/6 * * * * /path/to/php -q /scalr_home_dir/cron/cron.php –DNSMaintenance
*/3 * * * * /path/to/php -q /scalr_home_dir/cron/cron.php –DNSZoneListUpdate
*/2 * * * * /path/to/php -q /scalr_home_dir/cron/cron.php –DBQueueEvent
*/11 * * * * /path/to/php -q /scalr_home_dir/cron/cron.php –Cleaner
*/2 * * * * /path/to/php -q /scalr_home_dir/cron/cron.php –EBSQueue
Scalr needs your keys..
Sclar needs to have AWS access.
- Put your EC2 access certificate into /scalr_home_dir/etc/cert-XXXXXXXXXXXX.pem
- Put your EC2 private key into /scalr_home_dir/etc/pk-XXXXXXXXXXXX.pem
Now goto http://localhost/
username and password is admin/admin
I had a 403 error when trying to access scalr, this was because I had SElinux enabled, disable this if its a test machine.
After the install I found this, anothe useful resource if you have problems - http://groups.google.com/group/scalr-discuss/web/scalr-on-centos-5-install-notes