How to Install RackTables on Arch Linux

RackTables is a powerful and easy-to-use data center asset management system that helps you keep track of your hardware devices, network equipment, and other IT assets. This tutorial will guide you through the steps to install RackTables on Arch Linux.

Step 1: Update Your System

Before you begin, it's important to ensure your Arch Linux system is up-to-date. Open a terminal and run the following command:

sudo pacman -Syu

This will update all packages on your system to the latest version.

Step 2: Install Required Dependencies

Next, you need to install some dependencies that RackTables needs to run. Run the following command to install them:

sudo pacman -S apache php php-apache php-gd php-ldap php-mysql php-snmp php-xml unzip

This command will install Apache, PHP, and other required PHP modules. It will also install the unzip utility which will be required to extract the RackTables package.

Step 3: Download and Extract RackTables

Once you have installed the required dependencies, download the latest RackTables package from the official website using the following command:

wget https://github.com/RackTables/racktables/archive/refs/tags/v0.21.4.tar.gz

Next, use the unzip utility to extract the downloaded package:

tar -zxvf v0.21.4.tar.gz

This will extract the contents of the RackTables package into a new directory called racktables-0.21.4.

Step 4: Configure Apache

To configure Apache for RackTables, edit the httpd.conf file located in the /etc/httpd/conf/ directory:

sudo nano /etc/httpd/conf/httpd.conf

Add the following lines at the end of the file:

ServerName localhost
DocumentRoot "/path/to/racktables-0.21.4/wwwroot"
<Directory "/path/to/racktables-0.21.4/wwwroot">
    AllowOverride All
    Options FollowSymlinks
    Require all granted
</Directory>

Replace /path/to/racktables-0.21.4 with the actual path to the RackTables directory that you extracted earlier.

Save and close the file.

Step 5: Configure MySQL

RackTables requires a MySQL database to store its data. If you have not already installed MySQL, you can do so using the following command:

sudo pacman -S mysql

Once MySQL is installed, create a new database and user for RackTables:

sudo mysql -u root -p

Enter your MySQL root password when prompted.

Create a new database called racktables:

CREATE DATABASE racktables;

Create a new user called racktables with a strong password:

CREATE USER 'racktables'@'localhost' IDENTIFIED BY 'password';

Grant the racktables user full access to the racktables database:

GRANT ALL PRIVILEGES ON racktables.* TO 'racktables'@'localhost';

Exit the MySQL shell:

exit

Step 6: Install RackTables

To configure RackTables, copy the config.php.sample file to config.php:

cd racktables-0.21.4/wwwroot/inc
cp config.php.sample config.php

Edit the config.php file using your favorite text editor:

sudo nano config.php

Find the following lines:

$db_username = 'user';
$db_password = 'password';
$db_database = 'racktables';

Replace user with racktables and password with the password you chose earlier.

Save and close the file.

Finally, move the entire racktables-0.21.4 directory to /srv/http/:

sudo mv racktables-0.21.4 /srv/http/

Step 7: Configure SELinux

If you are using SELinux, you need to configure it to allow Apache to access RackTables files and the MySQL database.

To do this, run the following commands:

sudo chcon -t httpd_sys_content_t /srv/http/racktables-0.21.4 -R
sudo chcon -t httpd_sys_rw_content_t /srv/http/racktables-0.21.4/wwwroot/var -R

These commands set the proper SELinux context for RackTables files and folders.

Step 8: Restart Apache

Finally, restart Apache to apply the changes:

sudo systemctl restart httpd

Step 9: Access RackTables

Open your web browser and navigate to http://localhost. You should see the RackTables login page.

Enter the default login credentials:

Username: admin
Password: admin

You will be prompted to change the password on first login.

Congratulations, you have successfully installed RackTables on Arch Linux! You can now start adding your devices and managing your assets.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!