RackTables On Ubuntu 7.10 Server - Page 2
Terminal Based Installation Method
RackTables also offers a terminal based method of installation. Being a command line kind of guy, this was my initial choice (probably not the popular one). It begins exactly like the web based method.
The first step is to obtain the source code, unpack it and move it into a web accessible directory. Perform the following commands:
tar -xvzf RackTables-0.14.12.tar.gz
sudo mv RackTables-0.14.12 /var/www/racktables
At this point, you will be prompted for your password, since you are issuing the 'sudo' command - type it in and press the "Enter" key.
Create Database And Database User
RackTables does use a MySQL back end to store the data, so you will need to create a database and a user for the installation to be successful. Perform the following commands to create everything that you will need to proceed.
mysql -uroot -p
You will now be prompted for the password for your 'root' MySQL user. Type it in and press the "Enter" key. Once you are at the MySQL command prompt, issue the following commands:
create database racktables;
grant all on racktables.* to root;
grant all on racktables.* to root@localhost;
grant all on racktables.* to rackuser;
grant all on racktables.* to rackuser@localhost;
set password for rackuser@localhost=password('rackpw');
With that done, it is now time to proceed to the actual installation.
There are a few changes that need to be made to some of the configuration files, before you can proceed. The first will be to create the "secret.php" file and create your admin password. Issue the following commands:
sudo cp inc/secret-sample.php
sudo nano inc/secret.php
Within the "secret.php" file you will find a section to set your database username and password as shown below:
$db_username = 'username'; $db_password = 'password';
Change it so that it resembles this:
$db_username = 'rackuser'; $db_password = 'rackpw';
Now press Ctrl-O to write out your changes and Ctrl-X to exit the editor.
You now need to edit the "init-auth.sql" file to set your admin password. Issue the following command to do so:
sudo nano install/init-auth.sql
The file will initially look like this:
INSERT INTO `UserAccount` (`user_id`, `user_name`, `user_enabled`, `user_passwo$ VALUES (1,'admin','yes',sha1( # Uncomment and change the next line to your password, e.g.: # 'mysecretpassword' # ... and comment out the line below: PLEASE_READ_THE_INSTALL_DOCUMENTATION ),'RackTables Administrator');
Change it to resemble my example below:
INSERT INTO `UserAccount` (`user_id`, `user_name`, `user_enabled`, `user_password_hash`, `user_realname`) VALUES (1,'admin','yes',sha1( # Uncomment and change the next line to your password, e.g.: 'some_secret_password_only_you_know' # ... and comment out the line below: # PLEASE_READ_THE_INSTALL_DOCUMENTATION ),'racktables Administrator');
Import sql Files Into Your Database
You now need to import some sql files into your database to set the structure and create your admin account. Perform the following commands (keeping in mind that after each one, you will need to enter your "root" MySQL password):
mysql -uroot -p racktables <
mysql -uroot -p racktables < install/init-auth.sql
mysql -uroot -p racktables < install/init-dictbase.sql
mysql -uroot -p racktables < install/init-dictvendors.sql
Once that is done, you are ready to log in to your newly created RackTables web site.
Opening The Web Site
Using your favorite web browser and point it to your web site's URL.
You will be prompted for your username and password. The default username is "admin" and the password will be the one that you set in the "init-auth.sql" file above.
That completes the installation guide, covering both methods of the installation process. Something to keep in mind though is that even though I wrote this guide using Ubuntu 7.10 server, it is pretty generic. It should be easily adaptable to any distribution with minor difficulty. The only section that comes to mind is the command for moving the racktables directory into your web space. For example, under CentOS, you could substitute the following command and I believe everything else would be the same.
sudo mv RackTables-0.14.12 /var/www/html/racktables
This is a great project and I am happy that I found it. I hope that some of you will find it useful as well and that my guide makes it a little easier for you to implement.