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
- Minimum Server requirements
- Required PHP configuration options
- Required PHP extensions
- Set permissions
- Create and configure database
- Set cron jobs
- Load Statistics Configuration
- Security IP pool
- Known issues with errors
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
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.
You may need to install dependencies as well, such as
Required PHP configuration options
- safe_mode must be set to Off
- register_globals must be Off
Required PHP extensions
- Sockets (--enable-sockets) with SSL support (--with-openssl)
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.
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 permissionsThe 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):
- Create new MySQL database and database user for Scalr.
- Import database from sql/scalr.sql file.
- Edit database connection details in /scalr_home_dir/etc/config.ini file on the webserver.
Set cron jobsFor 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
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.
rrdtool >= 1.3.5 (necessary for pango support)
Additional cron task must be scheduled to collect the statisical data:
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.
Congratulations! You may now proceed to configuration. Log in as admin / admin, go to Settings->Core settings and edit settings.
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