Difference between revisions of "RackTablesInstallHowto"

From RackTables Wiki
Jump to navigation Jump to search
(replace with README)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= RackTables On Ubuntu 7.10 Server =
+
= DEPRECATED =
[[Image:rackdemolayout.png|right|thumb]]
+
'''This article has been replaced with the [https://github.com/RackTables/racktables/blob/maintenance-0.20.x/README.md README file].'''
 
 
Originally [http://howtoforge.com/racktables-on-ubuntu-7.10-server published] by Mike Fields at HowtoForge
 
 
 
In the words of the developers, RackTables is "A management framework for rackspace, IP addresses, servers, switches, routers and much more!". To me, it is the solution to a project that I have been working on for some time - A means of mapping out our data center at work. I have, for a long time, wanted a way to map out and make available in a web interface, our server racks. An example of what RackTables looks like can be seen to the right
 
 
 
 
 
The closest I have come is using [http://www.network-weathermap.com/ network-weathermap] and although it is a fantastic application, I don't think that the use I was trying to use it for was its intended purpose. So, when I stumbled upon !RackTables a few days ago, I was thrilled. While I was installing it on a development system, I (as usual) made notes of my steps so that if I decided to implement it on a production system, I would have my guide laid out before me. That being the case, I decided to share what I put together with you.
 
 
 
Now, onto the tutorial. There are two methods that you can use to implement !RackTables - a web based install and a command line install. I will cover both in this tutorial.  Just as a side note, this guide works under the assumption that you have an existing and functional LAMP server.  If not, then you may want to follow [http://howtoforge.com/perfect_server_ubuntu7.10 "The Perfect Server - Ubuntu Gutsy Gibbon (Ubuntu 7.10)"] guide.
 
<br clear="all" />
 
 
 
=Scripted Installation=
 
==Download and Deploy RackTables Web Application==
 
The first step is to obtain the source code, unpack it and move it into a web accessible directory.  Perform the following commands to prepare for the web based portion of the tutorial.
 
<pre>
 
cd /tmp/
 
wget wget --no-check-certificate https://downloads.sourceforge.net/project/racktables/RackTables-0.19.6.tar.gz
 
tar -xvzf RackTables-0.19.6.tar.gz
 
sudo cp -r RackTables-0.19.6/wwwroot /var/www/racktables
 
</pre>
 
 
 
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.
 
 
 
===CentOS and RedHat===
 
For CentOS and RedHat the destination directory is different:
 
<pre>
 
sudo mv -r RackTables-0.19.6/wwwroot /var/www/html/racktables
 
</pre>
 
 
 
==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.
 
<pre>
 
mysql -uroot -p
 
</pre>
 
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:
 
<pre>
 
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');
 
exit
 
</pre>
 
With that done, it is now time to proceed to the actual installation.
 
==Using browser based install script==
 
 
 
It is time to begin the web based portion of the install. Open your favorite web browser and point it to the installation URL.
 
===Browser install: Step 1===
 
 
 
[[Image:rackwebstep1.png|right]]
 
 
 
Open your browser and navigate to your RackTables installation <tt>http://address.to.your.server/racktables/install.php</tt>, which should give a response similar to the image on the left. The repored errors are normal at this stage of the installation, and it is safe to ignore them as they will be taken care of during the install.
 
 
 
Click "Proceed" to continue.
 
<br clear="all" />
 
===Browser Install: Step 2===
 
 
 
[[Image:rackwebstep2.png]]
 
 
 
Again, click "Proceed" to continue.
 
 
 
:'''Notes for Step 2:'''
 
 
 
#If your failure is on "Multibyte string extension", install php-mbstring via package manager (yum, up2date, etc). (This has been tested and works for CentOS 5.5 64bit via yum)
 
#If your failure is on "PCRE compiled with --enable-unicode-properties", then please follow these directions:
 
##On the command line run "pcretest -C" to confirm it says "No Unicode properties support".
 
##Follow [http://chrisjean.com/2009/01/31/unicode-support-on-centos-52-with-php-and-pcre/ this wonderful guide] for rebuilding the pcre package to include the "--enable-unicode-properties". Once built, use RPM to force the re-installation/upgrade of the package. (rpm -Uvh --force ~/src/rpm/RPMS/x86_64/pcre-6.6-2.el5_1.7.x86_64.rpm)
 
##Rerun "pcretest -C" to confirm that it now says "Unicode properties support".
 
##Using your package manager, reinstall php.  (sudo yum reinstall php).
 
##Restart httpd (sudo /etc/rc.d/init.d/httpd restart)
 
##Click Retry on Step 2, and confirm this passes.
 
#If your failure is on "LDAP extension", install php-ldap via package manager (yum, up2date, etc). (This has been tested and works for CentOS 5.5 64bit via yum)
 
<br clear="all" />
 
===Browser Install: Step 3===
 
[[Image:rackwebstep3.png]]
 
 
 
[[Image:rackwebstep4.png]]
 
 
 
[[Image:rackwebstep5.png]]
 
 
 
Now we need to do a little more command line work. In your terminal, enter the following commands:
 
<pre>
 
sudo touch /var/www/racktables/inc/secret.php
 
sudo chmod 666 /var/www/racktables/inc/secret.php
 
</pre>
 
Now click on the "retry" button to proceed further with step 3.
 
<br clear="all" />
 
===Browser Install: Step 4===
 
 
 
[[Image:rackwebstep6.png]]
 
 
 
Fill in the requested data (as shown in the example above) with the database username and password that you created above. When done, again click on the "retry" button to move on with step 3.
 
<br clear="all" />
 
===Browser Install: Step 5===
 
 
 
[[Image:rackwebstep7.png]]
 
 
 
[[Image:rackwebstep8.png]]
 
 
 
With that finally out of the way, click "Proceed" to continue to step 4.
 
<br clear="all" />
 
===Browser Install: Step 6===
 
 
 
[[Image:rackwebstep9.png]]
 
 
 
Make sure that there are no errors present and click "proceed" to continue.
 
 
 
In this step, you will enter the password you wish to use for the "admin" login for your RackTables Web site. Enter the password that you want and click on the "retry" button.
 
 
 
With the password set, click "proceed" to continue.
 
<br clear="all" />
 
===Browser Install: Completed===
 
 
 
[[Image:rackwebstep10.png]]
 
 
 
Congratulations! !RackTables has now been installed. Click on the "proceed" button to be prompted for your login information. The default username is "admin" and you will use the password that you created in step 5.
 
<br clear="all" />
 
 
 
=Command Line Installation (DOES NOT WORK in 0.17.0 and later releases)=
 
!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:
 
<pre>
 
cd /tmp/
 
wget http://racktables.org/files/RackTables-0.14.12.tar.gz
 
tar -xvzf RackTables-0.14.12.tar.gz
 
sudo mv RackTables-0.14.12 /var/www/racktables
 
</pre>
 
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.
 
<pre>
 
mysql -uroot -p
 
</pre>
 
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:
 
<pre>
 
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');
 
exit
 
</pre>
 
With that done, it is now time to proceed to the actual installation.
 
==Edit Configs==
 
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:
 
<pre>
 
sudo cp inc/secret-sample.php inc/secret.php
 
sudo nano inc/secret.php
 
</pre>
 
Within the "secret.php" file you will find a section to set your database username and password as shown below:
 
<pre>
 
$db_username = 'username';
 
$db_password = 'password';
 
</pre>
 
Change it so that it resembles this:
 
<pre>
 
$db_username = 'rackuser';
 
$db_password = 'rackpw';
 
</pre>
 
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:
 
<pre>
 
sudo nano install/init-auth.sql
 
</pre>
 
The file will initially look like this:
 
<pre>
 
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');
 
</pre>
 
Change it to resemble my example below:
 
<pre>
 
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');
 
</pre>
 
==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):
 
<pre>
 
mysql -uroot -p racktables < install/init-structure.sql
 
mysql -uroot -p racktables < install/init-auth.sql
 
mysql -uroot -p racktables < install/init-dictbase.sql
 
mysql -uroot -p racktables < install/init-dictvendors.sql
 
</pre>
 
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.
 
<pre>
 
http://your_servers_ip_address/racktables/
 
</pre>
 
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.
 
 
 
[[Image:rackwebstep10.png]]
 
 
 
=Acknowledgements=
 
 
 
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.
 
 
 
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.
 

Latest revision as of 14:37, 6 February 2017

DEPRECATED

This article has been replaced with the README file.