Installation

This section discusses how to download, compile and install BinaryTiers for your platform.

Requirements

BinaryTiers has few dependencies, and we'll try to keep this number as low as possible.

Installing Requirements on Linux/Unix

To use BinaryTiers in Unix-like systems you will need the following packages:

  • g++
  • redis
  • mysql-devel
  • expat-devel
  • pcre-devel

You can install everything at the command prompt:

Red Hat Based / Fedora

 yum -y install gcc gcc-c++
 yum install mysql-devel
 yum install pcre-devel
 yum install expat-devel
 yum install fcgi-devel
 yum install gd-devel

Debian Based / Ubuntu

 sudo apt-get update
 sudo apt-get install g++
 sudo apt-get install libmysqlclient15-dev
 sudo apt-get install libgd2-noxpm-dev
 sudo apt-get install libpcre3-dev libexpat1-dev libfcgi-dev libssl-dev

Installing Requirements on Windows

To use BinaryTiers in Windows you will need the following:

  • visual c++
  • mysql windows client (libmysql.lib)
  • expat for windows (xmlparse.lib)
  • pcre for windows (pcrecppd.lib, pcred.lib, librxspencer.lib)

If your copy of BinaryTiers don't have these libraries, you can obtain the libraries from here:

Note:
Additionaly you may need other packages such as: openssl, gd, fcgi, etc. that you can install at any time.

Getting the Source Code

 wget http://www.binarytiers.org/files/binarytiers-2.4.2.tar.gz
 tar -xvzf binarytiers-2.4.2.tar.gz

Building the Core

The first build of the core has to be done at the command prompt; successive builds might be done using the CMS:

 cd binarytiers/lib
 make
Note:
On Windows you'll have to build the project btcore.vcproj

Create the Database

You must create an empty database for BinaryTiers, make sure the database user has the rights to use the BinaryTiers database.

 mysql -u MY_DATA_BASE_USER -p
 create database MY_DATA_BASE_NAME

On the above code change MY_DATA_BASE_USER to your MySQL username and MY_DATA_BASE_NAME to the name of the database.

Configure Settings and First Build

 cd ../src
 vi settings.h

Edit the settings.h file, and set your Database configuration:

 char * DB_HOST         = "localhost";
 char * DB_USER         = "MY_DATA_BASE_USER";
 char * DB_PASSW        = "MY_DATA_BASE_PASSWORD";
 char * DB_NAME         = "MY_DATA_BASE_NAME";
 int    DB_TYPE         = 1; // 1:Redis, 2:Mysql
 int    DB_INDEX        = 0; // Redis Database
 char * SENDMAIL_HOST   = "localhost";
 char * SENDMAIL_FROM   = "admin@localhost";
 char * TEMP_PATH       = "\tmp\";
 char * BASE_URL        = "http://example.com";
 int max_content_length = 200000000;
 int cookie_lifetime    = 2000000;
 int clean_url          = 1;

Build BinaryTiers for the first time. The first build has to be done at the command prompt; successive builds might be done using the CMS:

 make
Note:
On Windows you'll have to build the project bt.vcproj

Configure the Web Server

If you are using Apache, make sure to specify the path of BinaryTiers in the file : /etc/httpd/conf/httpd.conf

 <VirtualHost *:80>
    ServerName   example.com
    ServerAlias  example.com
    DocumentRoot "/MY_BINARYTIERS_PATH/"
    DirectoryIndex bt.bin
    <Directory />
        Options Indexes MultiViews FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ScriptAlias /cgi-bin/ "/MY_BINARYTIERS_PATH/"
 </VirtualHost>

Configure the CMS

  • Point your browser to the base URL of your web site
  • Setup your admin username and password