Installation

Installation Process

  1. Download a file install.php
  2. Upload it to the directory where you are going to install Keitaro
  3. Open install.php in your browser http://domain.com/install.php

Do not install Keitaro to the directory where the website is located. Keitaro might replace files of the website after installation is complete.

If you're going to take VPS or dedicated server for Keitaro, please use Single-click Installation.

Step 1: Server configuration check

The first step checks server configuration. If all the necessary conditions are fulfilled, the button to Step 2 will appear.

Note: check if the server IP showing the installer is the same as the one in your license

Potential problems and solutions:

  • ionCube is not installed. Install it (follow the ionCube instruction or contact your hosting support).

Step 2: License check

Use your license key.

Potential problems:

  • curl_exec error — check firewall settings, do a ping test from your server to keitarotds.ru;
  • The key is not suitable for this server. Check if the server IP and the license IP are the same (ref. Step 1).

Step 3: Files upload

At this step the installer downloads and unpacks the archive with TDS files. Time required depending on the server load and the channel width.

Step 4: External databases upload

The installer downloads a geo-database, lists of mobile carriers and bots.

Step 5: access to database setup

Insert the database access attributes:

  • Host - database host name (usually localhost);
  • DB name - database name;
  • Login - login for database server authorization;
  • Password - password for database user;
  • Table prefix — this prefix is added to the name of each table created.

If the installer cannot connect to the base, check if you have the user rights for the database and host name.

Step 6: Structure and data import to the database

The installer creates all the necessary tables and data for TDS daily work.

Step 7: Settings

At this step system settings should be set up:

  • Administrator login — login to admin panel
  • Password
  • Password confirmation
  • Extra URL — the page, which visitors from domain will be redirected to

Step 8: Cron setup

The command options for task planner(cron) are offered here. They are necessary for cron.php script periodic launch. It recalculates the statistics, does the monitoring, cleans cache and old data.

More about cron planner setup at the Cron page.

Install From Server Console

sudo -u nginx php install.php install \ 
    --domain=domain.com
    --key=NNNN-NNNN-NNNN-NNNN \
    --db-user=tds \
    --db-name=tds \
    --db-password=password \
    --admin-login=admin \
    --admin-password=password \
    --language=en \
    --cache-storage=redis \
    --draft-storage=redis \
    --kversion=8 \
    --timezone="Europe/Madrid" 
  • Specify in for sudu the user, that run webserver
  • Specify for cache-storage and draft-storage correct storage (redis or files)
  • Option kversion specifies Keitaro version to install
  • Option timezone specifies timezone for the administrator

What can I do if ionCube is not installed?

If you have root access to the server, you can install it following the instruction at ionCube page. For hostings: try to contact the hosting support and ask them to install “ionCube Loader”.

How can MySQL extension be installed?

sudo apt-get install php5-mysql

How can CURL extension be installed?

sudo apt-get install php5-curl

Can I install Keitaro TDS to an already existing website?

Yes, create a folder and install the software there. Otherwise, the website will stop working.

Can it be installed to domain subdirectory (a folder)?

Yes, you can install it into a folder.

How can I create MySQL database and the database user?

If you have a control panel:

If you have a control panel installed on your server, find the “Databases” or “MySQL” section. Create a new database and the user with full rights to use it.

If you don`t have a control panel:

Go to the MySQL console

mysql

Run SQL-commands, replacing the username, password and database name to yours:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE database_name;
GRANT ALL PRIVILEGES ON database_name. * TO 'username'@'localhost';

How to create a database in cPanel?

  1. Open the page “MySQL Databases”;
  2. Create a database at the section “Create New Database”;
  3. Create a user at the section “Add New User”;
  4. Give the database rights to the user at the section “Add User To Database”. Set “ALL PRIVILEGES”;

Which rights does the database user need?

SELECT, UPDATE, INSERT, DELETE, TRUNCATE, ALTER, DROP, CREATE.

Why is Cron planner setup necessary?

Cron.php launch performs several necessary tasks:

  • Statistics calculation for reports;
  • Postback processing;
  • Streams monitoring;
  • Old data clean-up.

How to prevent license errors if I use CloudFlare?

Edit install.php, enter IP for resolveMethod

private $_resolveMethod = '11.11.11.11';

In case TDS in installed, edit application/config/config.ini.php, enter IP to resolve_method:

resolve_method = 11.11.11.11

Error "Parse error: syntax error, unexpected '{' in ..." after launch install.php

This error happens when you run an old version of PHP. You need version PHP 5.3 or later to launch the installer.

How to use multiple servers with Keitaro TDS and one central base?

It means that you can use multiple servers with one balancer.

Required settings of Keitaro TDS:

  1. Use the same configuration file application/config/config.ini.php. It is necessary for using the same TDS and the same “salt” (parameter salt).
  2. Use centralized cache or disable it. You can change it at the page “Maintenance > Settings > Performance”. It's not recommended to disable cache in TDS. It is better to use single Redis server.
  3. Use a single repository for the handler. We recommend to use a single server “Redis”. If you can not, then start recording in the “MySQL”.
  4. Connect statistics counting only to one server. Use cron.php script for this which runs by cron.

What else you can do:

  1. Centralize the Keitaro updating and its databases via Puppet or its equivalent. Read the instruction about using the Keitaro console at the page Console Commands (CLI).

Features of cPanel

To switch PHP versions CPanel adds a string to “.htaccess”. When installing and updating Keitaro, this file is overwritten. Therefore, you need to do the following:

  1. Switch the PHP version.
  2. Open the file «.htaccess» in «public_html». If you do not see the file, enable the display of the system files in the file manager settings.
  3. Copy the string from the file. It starts as AddHandler....
  4. Create a file .htaccess in the root of your home directory and paste this string there.