Bugzilla Setup with Apache / Nginx and Mysql

# How to install Bugzilla on Ubuntu / Debian

Assumptions:

Ubuntu/Debian is already installed and configured on machine.

bugzilla_home_page

Bugzilla Home Page

Here are the main steps:

Install Perl(5.8.1 or above)
Install MySQL
Install Web-server Apache2/Nginx
Install Bugzilla 4.X
Install Perl modules
Bugzilla using Apache2 and Nginx

1. Perl
Verify if Perl is installed:

$ perl -v

If not installed then

$ sudo apt-get install perl

2. MySQL
Verify if MySQL is installed:

$ mysql --version

If not installed :

$ sudo apt-get install mysql-client mysql-server mysql-admin

Now Create a database ‘bugzilla_demo’ and

Grant privileges to ‘bugzilla_demo’ database to ‘bugzilla’ user:

I usually set the Mysql user password through the mysql command line

$ mysql -uroot -p -e "create database bugzilla_demo"
Enter password: (Enter root password here)
$ mysql -uroot -p -e "show databases"
Enter password:

# Will show bugzilla_demo in database list

mysql -uroot -p
CREATE USER 'bugzilla'@'localhost' IDENTIFIED BY 'bugzilla@123';
GRANT ALL PRIVILEGES ON bugzilla_demo. * TO 'bugzilla'@'localhost';
FLUSH PRIVILEGES;
$ mysql -uroot -p -e "select user,host from mysql.user"
Enter password:

# Will show bugzilla user for database

3. Apache 2
Verify if Apache is installed:

$ apache2 -v

You can also view in a web browser the default welcome page at http://localhost
If not installed :

$ sudo apt-get install apache2

4. Bugzilla 4.4.9

Download Bugzilla from the site “ https://www.bugzilla.org/”.
Tip: Download a stable release.

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

Untar the downloaded file to your download folder

$sudo tar -xvf bugzilla-4.4.9.tar.gz

Move bugzilla directory to /usr/local/

$ sudo mv bugzilla-4.4.9/ /usr/local/

Make a symbolic link from /usr/local/bugzilla4.x to /var/www/bugzilla

$ sudo ln -s /usr/local/bugzilla4.4.9 /var/www/bugzilla

Make sure the directory had rw permissions:

$ sudo chmod -R 755  /usr/local/bugzilla-4.4.9/
$ sudo chown -R www-data:www-data /var/www/bugzilla

5. Perl Modules
Bugzilla’s installation process is based on a script called checksetup.pl.
The first thing it checks is whether you have appropriate versions of all the required Perl modules.
The aim of this section is to pass this check.

Verify if Perl modules are installed

$ cd /usr/local/bugzilla-4.4.9/
$ sudo ./checksetup.pl --check-modules

If not installed:

$ /usr/bin/perl install-module.pl --all  # Recommended

   // OR try to update Perl

$ sudo perl -MCPAN -e install

Now Generate and Edit the ‘localconfig’ file

$ sudo ./checksetup.pl

This version of Bugzilla contains some variables that you may want to
change and adapt to your local settings. The following variables are
new to ./localconfig .

Please edit the file ./localconfig and then re-run checksetup.pl
to complete your installation.

$ sudo vi localconfig

Change the $db_name, $db_pass and $db_user value to the correct values.

Here’s how it looks like in my localconfig (replace the password with your actual password,
this is just a placeholder here

# as root or as a user who is a member of the specified group.
# Note : The default web-server group either www-data or apache2.
# To Check Web-server Group Run
# ps aux | grep apache

$webservergroup = 'www-data';

# The DNS name or IP address of the host that the database server runs on.
$db_host = 'localhost';

# The name of the database
$db_name = 'bugzilla_demo';

# Who we connect to the database as.
$db_user = 'bugzilla';

# Enter your database password here.
$db_pass = 'bugzilla@123';

#Setting this to 0 means "use the default port for database server."
$db_port = 0 ; # or set 3306 for default localhost

./localconfig for Bugzilla Show Image
# Run the checksetup.pl again.This will add a whole lot of tables forbugzilla, and you can verify that by looking at the tables in the ‘bugzilla’ database.

$ sudo ./checksetup.pl

6. Configure Apache2 for Bugzilla
Add the following directives to /etc/apache2/apache2.conf

$sudo vi /etc/apache2/apache2.conf

configure to work without symlink

bugzilla_apache_setup

Apache configuration for Bgzilla

Apache_Configuration_for_Bugzilla Download Snippet
#To Enable CGI module in Apache

$ sudo a2enmod cgi

with Nginx

#For Fast-CGI Module of Nginx to run fastcgi-wrapper .

$ sudo apt-get install libfcgi-perl nginx wget

$ sudo wget http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper -O /usr/bin/fastcgi-wrapper.pl

$ sudo wget http://nginxlibrary.com/downloads/perl-fcgi/perl-fcgi -O /etc/init.d/perl-fcgi

$ sudo chmod +x /usr/bin/fastcgi-wrapper.pl

$ sudo chmod +x /etc/init.d/perl-fcgi

$ sudo update-rc.d perl-fcgi defaults

$ sudo insserv perl-fcgi

$ sudo /etc/init.d/perl-fcgi start

#Useful Reference http://nginxlibrary.com/perl-fastcgi/

#Edit server Block

$ sudo vi /etc/nginx/conf.d/nginx.conf

OR

$ sudo vi /etc/nginx/sites-available/default
Nginx_configuration_for_fastcgi_bugzilla

Nginx Configuration for fastcgi perl Module @ bugzilla

Nginx_Configuration_for_Bugzilla Download Snippet
7. Finalize Installation

$ cd /usr/local/bugzilla-4.4.9/
$ sudo ./checksetup.pl

#Note :- this command can be run any time it will show tha status and all detail for proper working
This will ask you to setup your administrator for bugzilla. Go ahead and enter the password and email id.

8. Start Using Bugzilla
Restart the apache server using the command

$ sudo service apache2 restart

Type the in your browser http://localhost/bugzilla/ . You should be getting the bugzilla login page as shown above.

Login using the email and password you did at end of Step 7.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s