(Last Updated On: October 13, 2018)

Here you’ll learn how to install and configure RackTables datacenter management solution on Ubuntu 18.04 / Ubuntu 16.04 LTS server. Racktables is a robust and nifty tool designed to help you manage your datacenter and server room assets.

With RackTables, it becomes easy to document hardware assets, network addresses, space in racks, networks configuration and much much more. Earlier on in the series we covered:

How to Install NetBox on CentOS 7 with Apache and Supervisord

Install and Configure phpIPAM on Ubuntu 18.04

Install Netbox Ubuntu 18.04/Ubuntu 16.04

RackTables Requirements

RackTables requires:

  1. A web-server – Apache or Nginx
  2. PHP 5.5.0 or newer) for front-end
  3. MySQL/MariaDB database server for the back-end data.

We will install these required packages before setting up RackTables on our Ubuntu server. For Database, we’ll use MariaDB, for Web server we’ll use Nginx.

Step 1: Install PHP

Ubuntu 18.04 has PHP 7.2 in its repositories, and  PHP 7.0 Ubuntu 16.04 LTS. Install Ubuntu and required extensions on any of the systems using the commands:

sudo apt-get install php php-cli php-snmp php-gd php-mysql php-mbstring php-bcmath php-json

Step 2: Install MariaDB Database server

To install MariaDB on Ubuntu 18.04 and Ubuntu 16.04 servers, follow our guides below:

Install MariaDB 10.x on Ubuntu 18.04 and CentOS 7

How to install MariaDB 10.3 on Ubuntu 16.04 (Xenial Xerus) LTS

Once you have MariaDB database server installed, create a database and user for RackTables

CREATE DATABASE racktables CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES on racktables.* TO 'racktables'@'localhost' IDENTIFIED BY "StrongPassword";
FLUSH PRIVILEGES;

Step 3: Install Nginx and php-fpm

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features. In this section, we’ll install nginx web server and php-fpm.

sudo apt install -y nginx php-fpm

Create Nginx configuration file for RackTables

 server {
        listen 80;
        server_name racktables.example.com;

        root /srv/racktables/wwwroot;

        location / {
            index index.php;
        }

        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass unix:/run/php/php7.2-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
    }

You’ll need to replace /srv/racktables with your Racktables root folder. For Ubuntu 16.04, your fastcgi_pass will point to /run/php/php7.0-fpm.sock

Check to confirm that the configuration file is okay

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

If all seem ok, restart nginx

sudo systemctl restart nginx
sudo systemctl enable nginx

Step 4: Download and install Racktables

We’ll download RackTables to the /srvdirectory

cd /srv

Clone racktables source code from Github

$ git clone https://github.com/RackTables/racktables.git
Cloning into 'racktables'...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 32365 (delta 17), reused 24 (delta 13), pack-reused 32327
Receiving objects: 100% (32365/32365), 25.60 MiB | 625.00 KiB/s, done.
Resolving deltas: 100% (20639/20639), done.

Set directory ownership

sudo chown -R www-data:www-data /srv/racktables

Start the installation by opening the link http://racktables.example.com/?module=installerand follow the instructions.

On step one, check proceed. It will do system checks, if all are Green, proceed to step 3

Create secret.php and set permissions when prompted.

sudo touch '/srv/racktables/wwwroot/inc/secret.php'
sudo chmod a=rw '/srv/racktables/wwwroot/inc/secret.php'

Next, configure database

UNIX socket: /var/run/mysqld/mysqld.sock
database: racktables
username: racktables
username: StrongPassword

Reset permission of /srv/racktables/wwwroot/inc/secret.php

sudo chown www-data:nogroup /srv/racktables/wwwroot/inc/secret.php
chmod 440 /srv/racktables/wwwroot/inc/secret.php

Enable execution of stored functions.

SET GLOBAL log_bin_trust_function_creators=1;

On step 6, create admin user password.

Congratulations! RackTables installation is complete. After pressing Proceed you will enter the system. Authenticate with admin username.

You have successfully installed RackTables data center management tool.