-
Notifications
You must be signed in to change notification settings - Fork 27
Installation Instructions
The installation will require the installation of the following components
-
Ubuntu (these instructions are for Ubuntu version 12.04 LTS)
-
Configure Proxy Settings
-
Git
-
RVM and Ruby 1.9.3
-
MongoDB
-
Libxml2
-
Nokogiri
-
Bonnie Source Code
-
Configure Startup Processes
-
Configure Passenger / Apache
-
Installing Ubuntu
The ISO for ubuntu 12.04 LTS can be downloaded from the following URL: http://releases.ubuntu.com/precise/
These instructions were developed against the "64-bit PC (AMD64) server install CD" (ubuntu-12.04.1-server-amd64.iso).
Installing Ubuntu is a fairly straight-forward process, but for more details on installing Ubuntu please visit the following URLs:
Graphical install using the desktop CD: https://help.ubuntu.com/community/GraphicalInstall
Installation using the Alternate CD (more configuration options): https://help.ubuntu.com/12.04/installation-guide/index.html
Once Ubuntu has been installed you need to update the Apt packages. Apt is a software package management system used by Ubuntu. Note: the last command in the group below is only necessary if any packages were actually upgraded.
sudo apt-get update
sudo apt-get upgrade
sudo shutdown -r now
Once the machine reboots you will likely want to install an SSH server. This will allow you to connect remotely to the machine.
sudo apt-get install openssh-server
Once SSH is installed, you can determine the IP address of the machine using the command
ifconfig
In the output of this command, look under the block labelled eth0, you should find an IP address after the label inet addr:.
- Configure Proxy Settings
This step is only required if the server you are installing Bonnie onto needs to go through an HTTP proxy server to reach the internet. These steps will ensure that the appropriate proxy settings are in place for every user that logs into the system.
Use your favourite text editor to create a file in /etc/profile.d named http_proxy.sh with the following contents. In the sample below, replace your.proxy.host.com with the fully-qualified host name of your proxy server, and your.proxy.port with the port number that the proxy server uses.
# Set up system-wide HTTP proxy settings for all users
http_proxy='http://your.proxy.host.com:your.proxy.port/'
https_proxy='http://your.proxy.host.com:your.proxy.port/'
export http_proxy https_proxy
Set proper permissions on the new file, and load the settings into the current environment. NOTE: the proxy settings will automatically be loaded when a user logs in, but we are manually loading them here, to avoid having to log out and log back in again.
sudo chmod 0644 /etc/profile.d/http_proxy.sh
source /etc/profile.d/http_proxy.sh
Make sure that the sudo command will allow the new proxy settings to be passed to commands it launches. This is done by using your text editor to create a file in the /etc/sudoers.d directory named http_proxy (no extension) with the following contents:
# keep http_proxy environment variables.
Defaults env_keep += "http_proxy https_proxy"
Set proper permissions on the new file:
sudo chmod 0440 /etc/sudoers.d/http_proxy
- Installing Git
Git is a source control system. It will be used later to download the Bonnie source code.
sudo apt-get install git-core
- Installing RVM and Ruby 1.9.3
RVM is a system that allows managing different versions of Ruby. It will allow the correct version of ruby to be easily installed on the system. Ruby is the development language used for the Bonnie application.
First we will need to install some dependencies:
sudo apt-get install build-essential openssl libssl-dev libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
Next install RVM. This will install RVM for all users
curl -L get.rvm.io | sudo -i bash -s stable
Log out, and then log back in again so that the settings RVM installs will be loaded in your environment. Once you have logged back in, run the following commands. These will install some more dependencies.
We will install these dependencies using an admin console. The admin console can be opened with the following command:
sudo -i
Next we want to set the autolibs flag in rvm
rvm autolibs enable
Next we want to install Ruby 1.9.3 using RVM
rvm install 1.9.3-p448
If you get a message about installing dependencies, press 'q'. We have already installed everything we will need.
Set ruby version 1.9.3 to be the default version:
rvm --default 1.9.3-p448
Install bundler. Bundler is a Ruby Gem that allows downloading additional dependencies once we have the Bonnie source code:
gem install bundler -v '1.2.3'
Install the ruby debugger gem
gem install debugger -v '1.6.3'
Close the admin console by running:
exit
setup rvm for the admin user:
source /etc/profile.d/rvm.sh
rvm use 1.9.3-p448
rvm --default 1.9.3-p448
- Installing MongoDB
MongoDB is the database used by Bonnie. To install MongoDB run the commands:
sudo sh -c "echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' >> /etc/apt/sources.list"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo apt-get update
sudo apt-get install mongodb-10gen=2.4.6
To test connection (wait at least 15 seconds to let the db start up), run the command below. If the command exits with a error about not being able to connect, then reboot, and log back in as the admin user. Sometimes mongodb fails to create a network socket when it is started immediately after installation. It should automatically start when the system is rebooted.
mongo
This should output MongoDB shell version: 2.4.x
Type 'exit' to exit the mongo shell
exit
- Installing libxml2 2.8 from source
Libxml2 version 2.8 must be installed for XML processing and validation. It can be installed from source using the following commands:
cd /tmp
wget ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
tar xzf libxml2-2.8.0.tar.gz
cd libxml2-2.8.0/
./configure
make
sudo make install
cd
- Installing Nokogiri using libxml2 2.8
Nokogiri is used by Bonnie for XML processing and validation and must be installed against the libxml2 2.8 libraries that were installed in step 6.
sudo -i
gem install nokogiri -v '1.6.0' -- --with-xml2-dir=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2
exit
- Bonnie Source Code
add bonnie user
sudo adduser bonnie
sudo usermod -G sudo bonnie
sudo su - bonnie
Getting the Bonnie code
git clone https://github.com/projecttacoma/bonnie.git
cd bonnie
git checkout v2.4.0 -b 2.4.0
bundle install
bundle exec rake assets:precompile
exit
- Configure Passenger / Apache
Install apache and passenger with the following commands:
sudo -i
apt-get install apache2
gem install passenger -v '3.0.18'
These should be the dependencies required for passenger:
apt-get install libcurl4-openssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev
Install the apache passenger module. If you need other dependencies, the installer will tell you:
passenger-install-apache2-module
The end of the passenger apache module install will tell you to edit two files.
The following set of commands will do those edits for you. Update the site configuration with:
echo -e '<VirtualHost *:80>\n DocumentRoot /home/bonnie/bonnie/public\n <Directory /home/bonnie/bonnie/public>\n AllowOverride all\n Options -MultiViews\n </Directory>\n</VirtualHost>\n' > /tmp/default
mv /tmp/default /etc/apache2/sites-available/bonnie
Make the default apache site be the bonnie provided content:
rm /etc/apache2/sites-enabled/000-default
ln -s ../sites-available/bonnie /etc/apache2/sites-enabled/000-default
Update the apache configuration with the following commands:
echo 'LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-3.0.18/ext/apache2/mod_passenger.so' > /etc/apache2/mods-available/bonnie.conf
echo 'PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-3.0.18' >> /etc/apache2/mods-available/bonnie.conf
echo 'PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p448/ruby' >> /etc/apache2/mods-available/bonnie.conf
ln -s ../mods-available/bonnie.conf /etc/apache2/mods-enabled/bonnie.conf
Restart apache:
service apache2 restart
Exit the root shell:
exit
To open the Bonnie web app you'll need the server IP address from step 1. The server IP address was found from the ifconfig command. Open a web browser and enter
http://<server_ip_address from step 1>/
This should open the Bonnie web application. Click on the "Register" link to add a new user and to get started with Bonnie