Monday, September 29, 2014

Bugzilla + Testopia Installation Guide for Linux

Originally posted:  September 29, 2014  Br1an6

Bugzilla is a server software to help you with development.

However, installing Bugzilla is a little complicated.

The installation process may make your machine insecure for short periods of time. Make sure there is a firewall between you and the Internet.

I highly recommend you to make a backup of your system before installing Bugzilla.

I use ubuntu14.04.1 in this guide.



First of all, update your Linux!


$ sudo apt-get update


Perl
Check the version of Perl:


$ perl -v
Better with 5.8.1 or higher. Otherwise, you’d better upgarde it.

MySQL
Bugzilla supports MySQL, PostgreSQL, and Oracle. I choose MySQL.

Check the version of MySQL:

$ mysql --verison
At least 5.0.15.

If you do not have MySQL installed:


$ sudo apt-get install mysql-server mysql-admin mysql-client
( If it doesn’t work, try ” $ sudo apt-get install mysql-server ” and
$ sudo apt-get install mysql-client ” )
After finishing, add a MySQL account:


$ mysql -u root -p
Then type in the following to add a bugzilla@localhost account:

mysql> GRANT SELECT, INSERT,
UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugzilla.*
TO bugzilla@localhost IDENTIFIED BY 'DB_PASSWORD';
mysql> FLUSH PRIVILEGES;
DB_PASSWORD will be your password. ( not literally “DB_PASSWORD” )

Apache
You have freedom of choice here, pretty much any web server that is capable of running CGI scripts will work.

However, I strongly recommend using the Apache web server (either 1.3.x or 2.x).

If you don’t have Apache and your OS doesn’t provide official packages,

visit http://httpd.apache.org/ or use $ sudo apt-get install apache2.



Bugzilla
Download Bugzilla:


$ wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.4.2.tar.gz
Unzip it and put it to a desirable place:


$ tar zxvf bugzilla-4.4.2.tar.gz
$ sudo mv bugzilla-4.4.2 /usr/local/
Add an alias to your configuration file of Apache according to your path:

( $ vim /etc/apache2/httpd.conf )


Alias /bugzilla/ /usr/local/bugzilla-4.4.2/
usr/local/bugzilla-4.4.2> 
  AddHandler cgi-script .cgi 
  Options +ExecCGI
  DirectoryIndex index.cgi index.html
  AllowOverride Limit FileInfo Indexes Options
</Directory>

Then check whether you have the required Perl modules:


$ cd /usr/local/bugzilla-4.4.2/
$ sudo ./checksetup.pl --check-modules
These will show a list of the required and optional Perl modules.
However, you may already have several of them installed and you don’t
have to install them all.
The following are some required modules:
• CGI (3.51)
• Date::Format (2.23)
• DateTime (0.28)
• DateTime::TimeZone (0.71)
• DBI (1.54)
• DBD::mysql (4.001) (for MySQL)
• DBD::Pg (2.7.0) (for PostgreSQL)
• DBD::Oracle (1.19) (for Oracle)
• Digest::SHA
• Email::Send (2.04)
• Email::MIME (1.904)
• Template (2.22)
• URI (1.37)

You can install them individually.
e.g. $ sudo apt-get install libdbd-pg-perl libapache2-mod-perl2
Or install them all with install-module.pl:

$ sudo perl install-module.pl --all

After installing Perl modules, time to set up a basic configuration:

$ sudo ./checksetup.pl ( Make sure it’s at the correct path.
e.g. $ cd /usr/local/bugzilla-4.4.2/ )
Then write the file “./localconfig”:
$db_host = ‘localhost’; # Host address
$db_name = ‘bugzilla’; # Name of DataBase
$db_user = ‘bugzilla’; # ID of DataBase
$db_pass = ‘DB_PASSWORD’; # Password or DataBase
$webservergroup = ‘www-data’; # Group of Configuration File
( Make sure the ID and password is the same with your MySQL DB )

Do the checksetup.pl again


$ sudo ./checksetup.pl
It might require an administrator.

Looks like we don’t have an administrator set up yet. Either this is
your first time using Bugzilla, or your administrator’s privileges
might have accidentally been deleted.
Enter the e-mail address of the administrator:

Just follow what it says and type in the Email and password.
Restart Apache and Mysql
Restart Apache


$ /etc/init.d/apache2 restart
↑It might need a sudo at the beginning
Restart Mysql


$ /etc/init.d/mysql restart
Type http://local/bugzilla/ ( It might be different with your configuration ).
Then you are good to go!

Testopia
Download:
ftp://ftp.mozilla.org/pub/mozilla.org/webtools/testopia/testopia-2.5-BUGZILLA-4.2.tar.gz

1. After finishing downloading, move it to the path where your bugzilla
installed. e.g. /usr/local/bugzilla-4.4.2/
2. Unzip it:

 $ tar zxvf testopia-2.5-BUGZILLA-4.2.tar.gz

3. Delete the archive file:

$ rm testopia-2.5-BUGZILLA-4.2.tar.gz

4. Run checksetup’s Perl :

$ ./checksetup.pl

Restart Apache and Mysql
And there you have it!

No comments:

Post a Comment

The Good, the Bad, and the Ugly of Working as a Software Engineer at AWS

After 5 incredible years at AWS, I have recently decided to join Zscaler. Working at Amazon Web Services is like being on a roller coaster y...