Skip to end of metadata
Go to start of metadata

This page is dedicated to users who want to install Open-Source Scalr on their own instances. To evaluate Scalr, we fully recommend trying Hosted Scalr which doesn't require any up-front installation. 


System Requirements

Disclaimer

It is extremely difficult (read: costly) to move from self-hosted to hosted Scalr, because of the continuously changing codebase. If you are considering self-hosting Scalr, be aware that you will in all likelihood not be able to move to hosted Scalr should you later prefer not having to manage updates and upgrades.

Minimum Server requirements

To self host Scalr, you will need servers of the following minimum specs:

  • 1x m1.large for mysql

  • 1x m1.large for app

  • 1x c1.medium for cron jobs

In later versions planned for Q2 2012, you will need an extra:

  • 1x m1.large for redis
  • 1x m1.small for rabbitmq

Packages

Package names and installation methods vary.

Open-Source Scalr requires a web server capable of

  • URL rewriting (like mod_rewrite)

  • Running on a POSIX-compatible (Linux, BSD) OS

  • PHP 5.3.5 or higher 5.3.X branch.

  • MySQL 5.1.X

You may need to install dependencies as well, such as

  • libssh2
  • OpenSSL
  • net-snmp-utils
  • bind9

Required PHP configuration options

  • safe_mode must be set to Off
  • register_globals must be Off 

Required PHP extensions

Note, that you need specific version of rrdtool extension (not the default one from PECL). To build it, download 'php_rrdtool.tar.gz' from rrdtool website: http://oss.oetiker.ch/rrdtool/pub/contrib/. Extract, phpize, configure, make.
Also, rrdtool package as well as librrd should be of version 1.3.x. You can download specific version here: http://oss.oetiker.ch/rrdtool/pub/?M=D

Also, apache mod_rewrite is required. Make sure that "AllowOverride All" is set for the scalr virtualhost. 

InstallationEdit section

Download the most recent code release from http://scalr.net/pricing/open-source/.Unzip this archive.

Copy the contents of the app/ folder to your webserver. Only the app/www folder must be readable by the webserver; all other folders must be underneath the web root. Scalr WILL NOT work from a subfolder of the document root (i.e. domain.com/something). Please create a subdomain and point its document root to the Scalr app/www folder. In the notes that follow, /scalr_home_dir/ refers to the app/ folder location on the webserver.

Set AllowOverride (Apache) or other directives as appropriate for the Scalr domain to implement the rewrite rules found in /scalr_home_dir/etc/.htaccess. If you are using webserver software other than Apache (say lighttpd) you will need to convert the .htaccess rules into a form suitable for your server. 

Set permissions

The following folders (and subfolders) and files must be writable by the webserver. Change ownership to the webserver user and set permissions to 700, or else (less secure) set permissions to 777 (world-writable):
  • cache

Create and configure databaseEdit section

  1. Create new MySQL database and database user for Scalr.
  2. Import database from sql/scalr.sql file.
  3. Edit database connection details in /scalr_home_dir/etc/config.ini file on the webserver.

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 scheduled:

 

 

Load Statistics Configuration

Settings Configuration

First of all you need to edit Settings -> Core settings under admin account. You need to set path to rrdtool binary, path to rrd databases and other settings.

System Requirements (in additional to Scalr requirements)Edit section

Note: Centos users, latest rrdtool, perl-rrdtool can be installed from the RPMForge repo.  You can also try installing the php-rrdtool from the same repo.  This did notwork for me, but after the rrdtool-devel was installed from the same repo, I could compile the php-rrdtool successfully.

Cron

Additional cron task must be scheduled to collect the statisical data:

 

Configuration

To check whether your server meets (most) Scalr system requirements, run the testenvironment.php script in the app/www folder. Assuming you have completed the steps above, this can be accessed as http://your.scalr.domain/testenvironment.php from your web browser. This will find most major issues, although some (missing rewrite rules, missing cron tasks) go undetected.

BIND

You'll need to configure BIND on your servers as well:

All file paths are absolute.

named.conf file should be readable and writable by BIND user.

Add include "/var/named/etc/namedb/client_zones/zones.include"; to the named.conf

Create '/var/named/etc/namedb/client_zones' directory for zone files. BIND user should have read/write/exec permissions on this directory as well as for all files within it.

Create a blank file '/var/named/etc/namedb/client_zones/zones.include' for zone definitions.

Security IP poolEdit section

 


Congratulations! You may now proceed to configuration. Log in as admin / admin, go to Settings->Core settings and edit settings.

Please check the event handler URL, by default you should see 'example.com', so you must change it to the real Scalr server's URL. Instances use this URL to establish connection with Scalr server. Without it, instance doesn't know where to send HostInit message (and all sequential messages too).

Known issues with errors

  • Problem: You see OperationalError: database is locked in server log and some usual things like script execution, database bundles don't work
  • Solution: SSH to this server, and execute:


  • Problem: You see Received RebundleFailed event from server. Reason: EBS volume vol-XXXXXXXX wasn't attached in a reasonable time and you're useing _t1.micro_ server type
  • Solution: Reboot this server and try again



Labels
  • None