How to Install RackTables on CentOS 7

RackTables is a data center asset management system

Racktables is a nifty and robust solution for datacenter and server room asset management. It helps document hardware assets, network addresses, space in racks, networks configuration and much much more!

 

Check the Demo

The demo database is reset to the initial state by a cron script, don’t be afraid to break anything there and don’t input any valuable data, it will be lost. Log in with full privileges using username: admin and password: admin. Have fun!

The latest stable release

 

1. Prepare the web server

RackTables uses a web-server with PHP (5.2.10 or newer) for front-end and MySQL/MariaDB server version 5 for back-end. Therefore, we will configure LAMP stack and then we will proceed with the installation of Racktables. Install Apache with the following commands.

# yum install httpd
# systemctl start httpd.service && systemctl enable httpd.service

2. Install MariaDB

Install MariaDB using YUM and enable the service. Optionally you can secure the database with mysql_secure_installation

# yum install mariadb-server mariadb
# systemctl start mariadb.service
# systemctl enable mariadb.service
# mysql_secure_installation

Create database/user.

# mysql -u root -p
mariadb> create database racktables;
mariadb> grant all privileges on racktables.* TO 'rackuser'@'localhost' identified by 'Passw0rd!';
mariadb> flush privileges;
mariadb> exit

Check the above MySQL user/password actually works using:

# mysql -u rackuser -pPassw0rd!

Change the character set of MySQL server to utf8 to enable Unicode in the MySQL server.

# vi /etc/my.cnf.d/server.cnf
...............
...............
[server]
character-set-server = utf8
collation-server = utf8_general_ci
skip-character-set-client-handshake
...............
...............

# systemctl restart mariadb.service

3. Install PHP/extensions

Install PHP and all the required php extensions needed by racktables.

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum update
# yum install php php-mysqlnd php-pdo php-gd php-snmp php-mbstring php-bcmath php-ldap
# service httpd restart
# echo '<?php echo phpinfo(); ?>' > /var/www/html/info.php

Check your LAMP stack by pointing your web browser to http://Server-IP/info.php

4. Create racktable user

Create an unprivileged racktable user who will own all php files inside apache DocumentRoot to make it secure.

# useradd -s /sbin/nologin -c "RackTables User" -m -d /home/racktables racktables
# id racktables

5. Download/extract Racktables

Unpack the tar.gz/zip archive to a directory of your choice and configure Apache httpd to use wwwrootsubdirectory as a new DocumentRoot. Alternatively, You can symlinks to wwwroot or even to index.php from an existing DocumentRoot.

# cd /tmp
# wget https://nchc.dl.sourceforge.net/project/racktables/RackTables-0.20.14.tar.gz
# tar -xvzf RackTables-0.20.14
# cp -rf RackTables-0.20.14/ /var/www/html/

Change ownership of RackTables-0.20.14 to racktables user that we have created in steps 4.

# chown -R racktables:racktables RackTables-0.20.14

Create racktables.conf file under the apache configuration directory with the following contents:

# cd /etc/httpd/conf.d
# vi racktables.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

<Directory /var/www/html/RackTables-0.20.14/wwwroot/>
   DirectoryIndex index.php
   Require all granted
</Directory>

Alias /racktables /var/www/html/RackTables-0.20.14/wwwroot/

6. Install Racktables

RackTables stores the database information in the secret file inside inc folder. Set the permissions of this file to 644 so that Apache can write the information into this file during installation. We will change the permission of this file in the middle of the installation.

# systemctl restart httpd
# touch /var/www/html/RackTables-0.20.14/wwwroot/inc/secret.php
# chmod 644 /var/www/html/RackTables-0.20.14/wwwroot/inc/secret.php

Now run the installer by pointing your web browser to http://Server-IP/racktables/?module=installer

Racktables installation Step 1 of 7

Click ‘Proceed’. If SELINUX is enabled then disable it temporarily using setenforce

# setenforce 0
Racktables installation Step 2 of 7
Click ‘Proceed’
Racktables installation Step 3 of 7
Provide database name, database user and password that we have created in Step 2
Racktables installation Step 3 of 7
Click ‘Proceed’
Racktables installation Step 4 of 7

Change the permission and click “retry”

# chmod 440 /var/www/html/RackTables-0.20.14/wwwroot/inc/secret.php
Racktables installation Step 4 of 7
Click 'Proceed'

Racktables installation Step 5 of 7

Click 'Proceed'
Racktables installation Step 6 of 7
Click 'proceed'

Racktables installation Step 7 of 7
Click 'Proceed' , You will be asked to provide a username/password. Login with user as 'admin' and password that you have provided in installation step 6.

Login racktables
The racktables dashboard should be available to you.

Racktable main page

You can now customize dashboard according to your requirements.

Click RackTables Administrator (Top right)-> Quick links tab

Check the configuration and save it by clicking blue arrow at the bottom of the page. We have checked and saved ‘User interface’ in the image below that will show up in the dashboard.

Racktable settings

Once the installation is finished, you can enable the SELINUX using:

# setenforce 1

You can now start creating objects like servers, network devices etc. for your IT inventory. You can check racktables wiki for installing it in other linux distros.

Deploy your own for your company ? contact us support@khmerdigital.net, our expert will help you to deploy and host it.

Thanks for your reading!

Tola Leng

Tola is a Linux and F.O.S.S enthusiast, currently a System Engineer and Server Infrastructure, DevOps and a content creator for KhmerDigital Bright who loves working with computers and strongly believes in sharing knowledge. Email: pkaylinux@gmail.com

comments
  • Good and detail
    Thank you!

  • leave a comment

    Create Account



    Log In Your Account