Back to the main page

RackTables installation


Have LAMP (Linux, Apache, MySQL, PHP) on your system, RackTables are written in PHP.

Let's creating a system account for RackTables, it will own all Racktables php files, it's more secure then having root ownes files.
# useradd -s /sbin/nologin -c "RackTables User" -m -d /home/racktables racktables
# id racktables
uid=1784(racktables) gid=1784(racktables) groups=1784(racktables)

Now let's create the RackTables mysql database (and ignore existing ones!)
# service mysqld start 
Starting mysqld:                     [  OK  ]

# mysql -u root -p 
Enter password: (type password)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>  create database racktables; 
Query OK, 1 row affected (0.00 sec)

mysql>  show databases; 
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| observium          |
| racktables         |
| test               |
+--------------------+
5 rows in set (0.00 sec)

The RackTables app can login to MySQL as root user, but to have system more secure let's create new database user "rtadmin" and this account has only access to the Racktables database.
mysql> grant all privileges on racktables.* TO 'rtadmin'@'localhost' identified by 'rtpasswd'; 
Query OK, 0 rows affected (0.00 sec)

Exit and test that you can login to mysql as this user with password (rtpasswd), note there is no space between '-p' and 'rtpasswd'.
mysql> exit
Bye

# mysql -u rtadmin -prtpasswd
Welcome to the MySQL monitor.  Commands end with ; or \g.

Get the RackTables software, and then as racktables user untar it.
# sudo su - -s /bin/bash  racktables

[racktables@comp ~]$ pwd
/home/racktables
[racktables@comp ~]$ tar -zxvf /tmp/RackTables-0.20.10.tar.gz
[racktables@comp ~]$ exit
logout

Then as root user move RackTables-0.20.10/wwwroot to /var/www/racktables
[root@comp ~]# mv /home/racktables/RackTables-0.20.10/wwwroot /var/www/racktables

[root@comp ~]# ls -la /var/www/racktables
total 36
drwxrwxr-x. 6 racktables racktables 4096 Jan 25  2015 .
drwxr-xr-x. 7 root       root       4096 Aug  1 00:30 ..
drwxrwxr-x. 2 racktables racktables 4096 Jan 25  2015 css
drwxrwxr-x. 2 racktables racktables 4096 Jan 25  2015 inc
-rw-rw-r--. 1 racktables racktables 9556 Jan 25  2015 index.php
drwxrwxr-x. 3 racktables racktables 4096 Jan 25  2015 js
drwxrwxr-x. 3 racktables racktables 4096 Jan 25  2015 pix

Make sure httpd/mysqld are running. If Apache DocumentRoot is /var/www then by putting RackTables files into /var/www/racktables allow us to go to RackTables via http://${hostanme}/racktables.

And next part of installation is via the web browser, once you go to http://${host_name}/racktables you'll see this "Configuration error" so click on the link.







Some programs are not present as we see here, so install them. Like in this example I install php-bcmath rpm and reload httpd.



RackTables keeps mysql info in the file /var/www/racktables/inc/secret.php so as suggested here create the file and set ownership to 666.



Let's see what database tables are created.
mysql> show tables;
+---------------------------+
| Tables_in_racktables      |
+---------------------------+
| Atom                      |
| Attribute                 |
| AttributeMap              |
| AttributeValue            |
| CachedPAV                 |
| CachedPNV                 |
| CachedPVM                 |
| CactiGraph                |
| CactiServer               |
| Chapter                   |
| Config                    |
| Dictionary                |
| EntityLink                |
| File                      |
| FileLink                  |
| IPv4Address               |
| IPv4Allocation            |
| IPv4LB                    |
| IPv4Log                   |
| IPv4NAT                   |
| IPv4Network               |
| IPv4RS                    |
| IPv4RSPool                |
| IPv4VS                    |
| IPv6Address               |
| IPv6Allocation            |
| IPv6Log                   |
| IPv6Network               |
| LDAPCache                 |
| Link                      |
| Location                  |
| Molecule                  |
| MountOperation            |
| MuninGraph                |
| MuninServer               |
| Object                    |
| ObjectHistory             |
| ObjectLog                 |
| ObjectParentCompat        |
| PatchCableConnector       |
| PatchCableConnectorCompat |
| PatchCableHeap            |
| PatchCableHeapLog         |
| PatchCableOIFCompat       |
| PatchCableType            |
| Port                      |
| PortAllowedVLAN           |
| PortCompat                |
| PortInnerInterface        |
| PortInterfaceCompat       |
| PortLog                   |
| PortNativeVLAN            |
| PortOuterInterface        |
| PortVLANMode              |
| Rack                      |
| RackObject                |
| RackSpace                 |
| RackThumbnail             |
| Row                       |
| Script                    |
| TagStorage                |
| TagTree                   |
| UserAccount               |
| UserConfig                |
| VLANDescription           |
| VLANDomain                |
| VLANIPv4                  |
| VLANIPv6                  |
| VLANSTRule                |
| VLANSwitch                |
| VLANSwitchTemplate        |
| VLANValidID               |
| VS                        |
| VSEnabledIPs              |
| VSEnabledPorts            |
| VSIPs                     |
| VSPorts                   |
+---------------------------+
77 rows in set (0.00 sec)




As suggested, change owner and permissions of secret.php file.
[root@comp inc]# pwd
/var/www/racktables/inc
[root@comp inc]# chmod 400 secret.php
[root@comp inc]# chown apache:apache secret.php




Create admin account for web login to RackTables.






Finally login to RackTables




Back to the main page