Monday, 18 April 2016

How to install Bugzilla 4.2 on CentOS 7



Bugzilla is an advanced bug tracking system, developed by the Mozilla Foundation. Bugzilla allows you to track defects and code changes in applications, allow communicating in your dev team easily and submitting and reviewing patches.


Prerequisites for CentOS

SELinux:

To disable selinux, please find the link here, after those changes reboot the machine:

Enable EPEL Repository:

To enable EPEL repository, please find the steps here.

Install Httpd and and other dependencies:

[root@linuxcnf ~]# yum install httpd mod_ssl mode_perl perl* gd gd-devil wget patchutils gcc gcc-c++ graphviz

Start the http service and enable to start on boot:

[root@linuxcnf ~]# service httpd start
[root@linuxcnf ~]# chkconfig httpd on

Allow port 80 or 443 from the local firewall:

[root@linuxcnf ~]# firewall- cmd --permanent --add- port=80/tcp
 [root@linuxcnf ~]# firewall-cmd --reload

Install Mysql Database Server:

Download mysql yum repository pacakage from here and install as below.

[root@linuxcnf ~]# yum localinstall mysql57-community-release-el7-7.noarch.rpm
[root@linuxcnf ~]# yum install mysql-server
[root@linuxcnf ~]# service mysqld start
[root@linuxcnf ~]# chkconfig mysqld on

Run the below command to set Mysql root password and follow the instructions:

[root@linuxcnf ~]# mysql_secure_installation

Add a line max_allowed_packet=64M in Mysql configuration file in mysqld section:

[root@linuxcnf ~]# vim /etc/my.cnf
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
#Bugzilla Setting
max_allowed_packet=64M

After make this changes restart mysqld service:

[root@linuxcnf ~]# service mysqld restart

Create database for it and setup some final steps:

[root@linuxcnf ~]# mysql –u root –p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.6.30 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>CREATE DATABASE bugzilladb;
mysql>GRANT ALL ON bugzilladb.* TO ‘bugs’@’localhost’ IDENTIFIED BY ‘password’;
mysql>FLUSH PRIVILEGES;
mysql>EXIT


















Download bugzilla

Download bugzilla 4.2 from official website and extract it as below.

[root@linuxcnf ~]# tar –zxvf bugzill-4.2.tar.gz –C /var/www/html
[root@linuxcnf ~]#cd /var/www/html
[root@linuxcnf html]#./checksetup.pl --checkmodules

Install missing modules using below command and run ./checksetup.pl. After setup
successful done edit the ./localconfig as per DB setting and rerun ./cheksetup.pl and
follow the  instructions to complete the setup.

[root@linuxcnf html]#/usr/bin/perl install-module.pl –all
[root@linuxcnf html]#./checksetup.pl
[root@linuxcnf html]# vim ./localconfig
[root@linuxcnf html]#./checksetup.pl
………
Creating default classification 'Unclassified'...
Setting up foreign keys...
Setting up the default status workflow...
Creating default groups...
Setting up user preferences...
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: rajkumar.prajapati@ xxxxxxxx.com
Enter the real name of the administrator: Admin
Enter a password for the administrator account:
Please retype the password to verify:
rajkumar.prajapati@drughub.in is now set up as an administrator.
Creating initial dummy product 'TestProduct'...
Creating group TestProduct...
Adding a new user setting called 'view_testopia'
Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.
checksetup.pl complete.
[root@linuxcnf html]#

Configure httpd configuration to host bugzilla

Open /etc/httpd/conf/httpd.conf and edit as per below:

[root@linuxcnf ~]# vim /etc/httpd/conf/httpd.conf
<Directory "/var/www/html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    AddHandler cgi-script .cgi
    Options +Indexes +ExecCGI
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    DirectoryIndex index.cgi
    AllowOverride Limit FileInfo Indexes
    #
    # Controls who can get stuff from this server.
    #
    #Require all granted
</Directory>
[root@linuxcnf ~] # service httpd restart

Test Bugzilla installation with browser, use any browser and open url http://<localhsot or ip address>

Use the credentials that those provide at the bugzilla installation time
Email address : xxxxxxxxxxx@xxxx.com

Password         : admin@123

No comments:

Post a comment