Sunday, 23 February 2014

How to setup The Bug Genie (thebuggenie) on Ubuntu using virtualbox virtual machine

I have had a very hard time setting up thebuggenie on windows. In the end I had to set the software to run on a virtual machine. This is a real shame as the software is first class, but the installation doesn't seem to be well documented. So I thought I would write this post to help share the steps that I took. These steps should work to install the software directly onto Ubuntu, or to install it onto a virtual machine running Ubuntu on any host.

Virtualbox

Download virtualbox from here, and install

Virtual Machine

To create the virtual machine, start Virtualbox, and then
  1. Create a new virtual machine
  2. Use name Ubuntu, type Linux, Version Ubuntu 64
  3. Update memory to 1024mb
  4. Choose Create a virtual hard drive
    1. Type VDI 
    2. Dynamically allocated
    3. Give name ubuntu and leave size at 8gb
  5. Now you have created it, we need to update the network settings to other computers on the network can see it. To do this, choose Settings, Network, and change Attached to from NAT to Bridged Adapter
  6. Next we need to point the CD rom at the ubuntu iso
    1. Download Ubuntu 12.04 LTS from here
    2. Choose Settings, Storage, then on the left choose Controller IDE, Empty. On the right choose the disk icon to the right of IDE Secondary Master, and "choose a virtual CD/DVD disk file...". In the popup, choose the iso file you previously downloaded
  7. Start the virtual machine
  8. Go through the installation procedure for Ubuntu, taking all the defaults
  9. At the point of sofware setup, choose to install OpenSSH server
  10. When the virtual machine finally boots, login using the credentials you configured during setup
  11. To update all the software, enter sudo apt-get update, then sudo apt-get upgrade
  12. Type ifconfig, to see the ip address that has been allocated
  13. The Virtualbox terminal isn't very nice - can't scroll back and has no history. So from the host machine, use either SSH if running Linux/Mac or putty if running Windows, and connect to the machine. This will give you a nicer shell to enter the commands into

Software

You need to install several pieces of software, to enter the command sudo -s to become root - this just speeds up installation. Once finished with the installation, exit the root session with the command exit.

Install Apache

To install apache, enter the following command and accept the prompt

apt-get install apache2

Once installed test from your host by opening a browser and navigating to http://your.ip.address/. You should see a page that says "It works!".

To enable .htaccess files to override settings, you need to edit the file /etc/apache2/sites-available/default and add the following just below the entry for /var/www

  <Directory /var/www/thebuggenie>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>

PHP

To install php, enter the following command

apt-get install php5 libapache2-mod-php5 php5-mysql php5-gd

To test, we need to create a simple php page. So enter the following command
  • vi /var/www/test.php
  • Paste in the following and save
<?php phpinfo(); ?>
  • From the host, navigate to http://your.ip.address/test.php. You should see details of the php installation
  • Next you have to enable MySql integration, so enter the following commands
cd /etc/php5/apache2
vi php.ini

Then add the following lines to the file

extension=mysql.so

Restart apache

service apache2 restart

MySql

To install MySql, enter the following command

apt-get install mysql-server

Now you need to setup a user and a database. To do this, enter the following commands
  • Connect to mysql with mysql -u root -p
  • Create the database with CREATE DATABASE thebuggenie;
  • Create the user with CREATE USER thebuggenie@localhost IDENTIFIED BY 'password';
  • Grant privileges with GRANT ALL ON thebuggenie.* TO thebuggenie;
  • Flush privileges with FLUSH PRIVILEGES;
  • Logout from root - quit
  • Then test you can connect using mysql -u thebuggenie -p, and then enter the password. If you can connect successfully, then quit and continue

The Bug Genie

To install thebuggenie, follow these steps

  • Download the bug genie from here. I downloaded v3.2.6
  • unzip to a temporary directory using the command unzip thebuggenie_3.2.6.zip thebuggenie
  • Move the directory to where apache can serve it mv thebuggenie /var/www
  • Next we have to fix some directory permission using the following commands
chmod a+w /var/www/thebuggenie/
chmod a+w -R /var/www/thebuggenie/core/cache
chmod a+w /var/www/thebuggenie/thebuggenie/
touch /var/www/thebuggenie/core/b2db_bootstrap.inc.php
chmod a+w /var/www/thebuggenie/core/b2db_bootstrap.inc.php

  • the bug genie uses url rewriting to make the urls look nice. To make apache allow this, you need to use the following command to enable mod_rewrite, and restart apache

a2enmod rewrite
service apache2 restart

Now you should be able to navigate to http://your.ip.address/thebuggenie/thebuggenie/ and complete the setup.

Incoming Email

In order to allow for thebuggenie to poll for incoming email, you need to install imap support in php. To do this, execute the following commands

cd /etc/php5/apache2
vi php.ini

Then add the following lines to the file

extension=imap.so

Then install the software, and finally restart apache

apt-get install php5-imap
service apache2 restart

Hopefully that little lot will help someone else.

No comments:

Post a Comment