RackTables is a data center asset management system. It is a nifty and robust solution for data center/server room asset management and helps document hardware assets, network addresses, space in racks, networks configuration and much much more. This article covers step by step installation of Racktables in CentOS 7.
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 wwwroot
subdirectory 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
Click 'Proceed'. If SELINUX is enabled then disable it temporarily using setenforce
# setenforce 0
Click 'Proceed'
Provide database name, database user and password that we have created in Step 2
Click 'Proceed'
Change the permission and click "retry"
# chmod 440 /var/www/html/RackTables-0.20.14/wwwroot/inc/secret.php
Click 'Proceed'
Click 'Proceed'
Provide Administrator password and click 'retry'
Click 'proceed'
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.
The racktables dashboard should be available to you.
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.
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.
Hi Dwijadas Dey
I am Stuck after 3rd Step Web page is blank not showing anything I Tired Of Refresh no luck Please Suggest .
in apache error log you can find error of php:
PHP Fatal error: require_once(): Failed opening required '/var/www/html/racktables/wwwroot/inc/secret.php'
recurtion ))))
Im my situation can help my this commands:
chown apache. secret.php
chmod 440 secret.php