Introduction

In this tutorial we will learn, how to install bugzilla with MySQL 5.6 on Ubuntu 14.04 LTS server. Bugzilla famously known as bug tracking tool and it is a Mozilla project.

Details of practical environment

Server : AWS Ubuntu 14.04 LTS Server Instance
Bugzilla Version : bugzilla-4.4.6
Web Server : Apache 2.4
Database Server : MySQL 5.6

Install Bugzilla on Ubuntu 14.04 LTS Server : Follow given below steps

Login into Ubuntu server. And follow the below given steps.

Install Web Server,Database Server and other dependencies

Install Apache 2.4 , MySQL server 5.6 and other dependencies.

sudo apt-get install apache2 mysql-server-5.6 libappconfig-perl libdate-calc-perl libtemplate-perl libmime-perl build-essential libdatetime-timezone-perl libdatetime-perl libemail-sender-perl libemail-mime-perl libemail-mime-modifier-perl libdbi-perl libdbd-mysql-perl libcgi-pm-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl apache2-mpm-prefork libapache2-mod-perl2 libapache2-mod-perl2-dev libchart-perl libxml-perl libxml-twig-perl perlmagick libgd-graph-perl libtemplate-plugin-gd-perl libsoap-lite-perl libhtml-scrubber-perl libjson-rpc-perl libdaemon-generic-perl libtheschwartz-perl libtest-taint-perl libauthen-radius-perl libfile-slurp-perl libencode-detect-perl libmodule-build-perl libnet-ldap-perl libauthen-sasl-perl libtemplate-perl-doc libfile-mimeinfo-perl libhtml-formattext-withlinks-perl libgd-dev lynx-cur python-sphinx

While installation, on screen you will see window to set MySQL root password. Hence, set the desired mysql root password.

Download latest Bugzilla package

We always recommend to download the latest stable bugzilla release package. At the time of writing of this post, we have bugzilla-4.4.6 version available

You may download latest package from Bugzilla Download page.

wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.4.6.tar.gz

Decompress the downloaded package by tar command

Now decompress the downloaded bugzilla package by using tar command.
Check downloaded bugzilla package name in case you have new version ,replace with bugzilla-4.4.6.tar.gz in below given command.

tar -xvzf bugzilla-4.4.6.tar.gz

Move the decompressed Bugzilla package to Apache Document Root

Now move the decompressed bugzilla package which you got from above tar command. In our case the directory called bugzilla-4.4.6 we got after extracting by using tar command.

sudo mv bugzilla-4.4.6 /var/www/html/bugzilla

The bugzilla-4.4.6 directory will be moved to /var/www/html/ and also renamed to directory called bugzilla.

Change Owner and group of /var/www/html/bugzilla

Now change owner and group of bugzilla at /var/www/html/ . Because we are using Apache 2.4 in Ubuntu system, the web server user and group is with same name called www-data . Hence, we change owner and group with www-data to /var/www/html/bugzilla.

sudo chown -R www-data:www-data /var/www/html/bugzilla

Set Database and Database user for bugzilla

Login into mysql server by using below command and give mysql root password when it prompt.
(On first step you have set the mysql root password while installing many packages.)

mysql -u root -p

After login into MySQL Server, you will get mysql> prompt .
Create Database, user and grant privileges to bugzilla user on bugzilla database.

create database bugzilladb;

CREATE USER 'bugzillauser'@'localhost' IDENTIFIED BY 'SetYourPassword';

GRANT ALL ON bugzilladb.* TO 'bugzillauser'@'localhost';

flush privileges;

exit;

Set parameter for maximum attachment size and search for short words

First take the backup of my.cnf file

sudo cp -p /etc/mysql/my.cnf /etc/mysql/my.cnf.orig

Edit my.cnf file.

sudo vi /etc/mysql/my.cnf

In my.cnf file ,modify max_allowed_packet size in Mb

 max_allowed_packet = 100M

And add new line in my.cnf file inside [mysqld] section

ft_min_word_len=2

Save the file and exit.

Restart MySQL Server

Restart the MySQL Server.

sudo service mysql restart

Configure Apache for bugzilla

Create new file called bugzilla.conf in /etc/apache2/sites-available

sudo vi /etc/apache2/sites-available/bugzilla.conf

Copy-paste and save the below given contents in bugzilla.conf file.
Replace ec2-54-165-142-204.compute-1.amazonaws.com with your bugzilla domain name.

ServerName ec2-54-165-142-204.compute-1.amazonaws.com
ServerAdmin email-id@example.com
DocumentRoot /var/www/html/bugzilla

AddHandler cgi-script .cgi
Options +ExecCGI
DirectoryIndex index.cgi index.html
AllowOverride Limit FileInfo Indexes Options

Enable/Disable Apache module and sites

Enable apache module cgi,headers,expires and rewrite.

a2enmod cgi headers expires rewrite

Enable bugzilla apache configuration

sudo a2ensite bugzilla

Disable 000-default apache configuration

sudo a2dissite 000-default

Restart the apache service

sudo service apache2 restart

Login as superuser

Now login as superuser to do rest of the steps

sudo su -

Run ./checksetup.pl

Run the script ./checksetup.pl for pre check.

cd /var/www/html/bugzilla
./checksetup.pl

In output, you will read about further requirements for bugzilla. Now move to next step.

Install perl modules

Run below given command inside directory /var/www/html/bugzilla

cd /var/www/html/bugzilla
/usr/bin/perl install-module.pl PatchReader
/usr/bin/perl install-module.pl Email::Reply
/usr/bin/perl install-module.pl Apache2::SizeLimit
/usr/bin/perl install-module.pl DateTime::Locale
/usr/bin/perl install-module.pl Email::Send

Run once again ./checksetup.pl

Now run once again ./checksetup.pl file

cd /var/www/html/bugzilla
./checksetup.pl

Edit localconfig file

After running ./checksetup.pl script, the new file called localconfig will be created. Edit the file and give the information.

cd /var/www/html/bugzilla

vi localconfig

Set below given parameters in localconfig file. Replace the values as per your information.

$create_htaccess = 1;
$webservergroup = 'www-data';
$use_suexec = 0;
$db_driver = 'mysql';
$db_host = 'localhost';
$db_name = 'bugzilladb';
$db_user = 'bugzillauser';
$db_pass = 'SetYourPassword';

The below given is reference from our system. This is complete set we have done in localconfig file.

$create_htaccess = 1;
$webservergroup = 'www-data';
$use_suexec = 0;
$db_driver = 'mysql';
$db_host = 'localhost';
$db_name = 'bugzilladb';
$db_user = 'bugzillauser';
$db_pass = 'SetYourPassword';
$db_port = 0;
$db_sock = '';
$db_check = 1;
$index_html = 0;
$cvsbin = '';
$interdiffbin = '';
$diffpath = '/usr/bin';
$site_wide_secret = 'QEjYRF64ZozoFzONMz33N2ylKJl4mk0AAm8ICFsYU9Clsn4yNefmTz0fnrVRTpNI';

Rerun ./checksetup.pl script to set admin credentials and email

After properly setting the localconfig file. Rerun the script ./checksetup.pl .

cd /var/www/html/bugzilla
./checksetup.pl

At the end of script output, you will get to provide information for admin user.
See the below given screenshot for reference.

bugzilla-admin

Test the bugzilla server

You can test the bugzilla server by below given command.

./testserver.pl http://localhost/

Open Bugzilla in Web browser

Now open the bugzilla site in web browser, use the domain name which you set for bugzilla.
And try login with admin user.

bugzilla

Now you can use and explore the bugzilla after login as admin.

We have already written post on to disable the user self registration in Bugzilla, if you are interested you can read our this post.

Read Some More Articles

11 Comments

  1. Hi Sharad,
    i am facing the following issue while when i execute “./testserver.pl http://localhost/

    TEST-OK Webserver is running under group id in $webservergroup.
    TEST-FAILED Fetch of images/padlock.png failed
    Your web server could not fetch http://localhost/images/padlock.png.
    Check your web server configuration and try again.

    By Referring the comment section i execute find /var/www/html -name padlock.png

    OUT PUT : /var/www/html/bugzilla/images/padlock.png

    Please help on resolving this issue ….Thanks in advance

  2. Hi Sharad, i had some trouble so far, but i made it through here. here is the output of find, the guy “Irappaq” owes you 🙂

    find /var/www/html -name padlock.png
    /var/www/html/bugzilla/images/padlock.png

    can you please help? I’m so close 🙂

    1. Hi Irappaq,

      I need some info before troubleshooting further.
      Login into server with root user id and find the file called padlock.png by using below given command –

      find /var/www/html -name padlock.png
      

      Let me know what is the output.

      Regards
      Sharad

  3. Great installation instructions. I followed your instructions and was able to install Bugzilla. However, you did not give example of a URL to run Bugzilla. Please kindly provide an URL to invoke Bugzilla from a browser.

    Thank you!!

    Shawn

    1. Hello Shawn,

      Thank you for reaching us on bugzilla question.
      For URL, you must have DNS in place. Set A record in DNS for bugzilla and straight forward it will work.

      Regards
      Sharad

  4. Hi Sharad,

    Same issue on Steve. After issue command > service apache2 restart.

    Already issue the command cat /etc/issue is say “Ubuntu 14.04.3 LTS n l”

    Thank you so much. 🙂

    1. Ubuntu 14.04.2 LTS n l. I have the same issue with the “AllowOverride Limit FileInfo Indexes Options” line giving me an issue. When I remove it, its stops the error message, but then the test fails:
      ./testserver.pl http://localhost/
      TEST-OK Webserver is running under group id in $webservergroup.
      TEST-OK Got padlock picture.
      Use of uninitialized value $response in pattern match (m//) at ./testserver.pl line 101.
      Use of uninitialized value $response in pattern match (m//) at ./testserver.pl line 103.
      TEST-FAILED Webserver is not executing CGI files.
      TEST-FAILED Webserver is permitting fetch of http://localhost/localconfig.
      This is a serious security problem.
      Check your web server configuration.

  5. Hi,

    Thanks for a very clear document, I need to build a test bugzilla site and have followed your instructions I have next to no experience with ubuntu or any form of Linux. When I get to this point a2enmod cgi headers expires rewrite i get a AH00526 Line 8 invalid command AllowOveride can yo give a pointer to what I might be doing wrong.

    steve

    1. Hello Steve,

      First of all thanks for selecting our tutorial. We need some more clear information, which linux you are using.
      To get this information you can use these commands cat /etc/issue and cat /etc/redhat-release .
      As I am not sure which OS you are using hence given 2 commands.

      Regards
      Sharad

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.