Thursday, July 21, 2011

Bugzilla Installation on Windows with Apache+MySQL+Perl

Get Bugzilla

download the Bugzilla from http://bugzilla.org/download.html.
There are two ways of gettng it - through CVS or direct downloading the tar file.
Suggested to download tar file and extract with Winzip or WinRAR.
Create a folder
c:\bugzilla
Copy all the content to this folder.
also create a tem folder
c:\temp

Get MySQL

Get MySQL database. Get the latest version, avoid beta version.

Get Perl

Next, you need to install Perl on the machine.
http://activestate.com/Products/Download/Download.plex?id=ActivePerl

Install Modules
Bugzilla requires a number of perl modules to be installed. They are available in the ActiveState repository and the following additional repositories:
Check the version of perl and accordingly as the repo.
Perl 5.8.x:
http://theoryx5.uwinnipeg.ca/ppms/
Perl 5.10.x:
http://cpan.uwinnipeg.ca/PPMPackages/10xx/ and
http://trouchelle.com/ppm10/
or
http://theoryx5.uwinnipeg.ca/ppms/
http://cpan.uwinnipeg.ca/PPMPackages/12xx/ and
http://trouchelle.com/ppm12/
C:\>ppm version
ppm 4.06 (ActivePerl 1006)
Copyright (C) 2009 ActiveState Software Inc. All rights reserved.

C:\>ppm repo add UWinnipeg http://cpan.uwinnipeg.ca/PPMPackages/10xx/
Downloading ActiveState Package Repository packlist...done
Updating ActiveState Package Repository database...done
Downloading UWinnipeg packlist...done
Updating UWinnipeg database...done
Repo 2 added.

C:\>ppm repo add Trouchelle http://trouchelle.com/ppm10/
Downloading Trouchelle packlist...done
Updating Trouchelle database...done
Repo 3 added.

C:\>ppm repo list
+---------------------------------------------+
¦ id ¦ pkgs ¦ name ¦
+----+-------+--------------------------------¦
¦ 1 ¦ 11417 ¦ ActiveState Package Repository ¦
¦ 2 ¦ 291 ¦ UWinnipeg ¦
¦ 3 ¦ 11737 ¦ Trouchelle ¦
+---------------------------------------------+
(3 enabled repositories)

C:\>ppm upgrade
Syncing site PPM database with .packlists...done
Archive-Tar 1.54 (have 1.52-r1)
Attribute-Handlers 0.87 (have 0.86)
AutoLoader 5.70 (have 5.69)
Bit-Vector 7.1 (have 6.9)
Class-Accessor 0.34 (have 0.33)
Class-ISA 0.36 (have 0.33)
Compress-Raw-Bzip2 2.021 (have 2.020)
Compress-Raw-Zlib 2.021 (have 2.020)
DBD-ODBC 1.23 (have 1.22)
DBI 1.609 (have 1.607)
Date-Calc 5.8 (have 5.6)
Encode 2.37 (have 2.35)
ExtUtils-CBuilder 0.260301 (have 0.2603)
ExtUtils-Manifest 1.57 (have 1.56)
ExtUtils-ParseXS 2.21 (have 2.2002)
File-Path 2.08 (have 2.07_03)
File-Which 1.09 (have 1.07)
IO-Compress 2.021 (have 2.020)
IPC-Cmd 0.50 (have 0.46)
Log-Message-Simple 0.06 (have 0.04)
Math-BigRat 0.24 (have 0.22)
Module-CoreList 2.20 (have 2.17)
Module-Loaded 0.06 (have 0.02)
Object-Accessor 0.36 (have 0.34)
Safe 2.19 (have 2.17)
Test-Simple 0.94 (have 0.92)
Text-CSV_XS 0.68 (have 0.67)
Text-Reform 1.20 (have 1.11)
constant 1.19 (have 1.18)
parent 0.223 (have 0.221)
version 0.7702 (have 0.7701)

C:\>ppm install AppConfig
Downloading AppConfig-1.66...done
Unpacking AppConfig-1.66...done
Generating HTML for AppConfig-1.66...done
Updating files in site area...done
14 files installed

C:\>ppm install TimeDate
Downloading TimeDate-1.19...done
Unpacking TimeDate-1.19...done
Generating HTML for TimeDate-1.19...done
Updating files in site area...done
41 files installed

C:\>ppm install DBI
No missing packages to install

C:\>ppm install DBD-mysql
Downloading DBD-mysql-4.011...done
Unpacking DBD-mysql-4.011...done
Generating HTML for DBD-mysql-4.011...done
Updating files in site area...done
12 files installed

C:\>ppm install Template-Toolkit
Downloading Template-Toolkit-2.22...done
Unpacking Template-Toolkit-2.22...done
Generating HTML for Template-Toolkit-2.22...done
Updating files in site area...done
140 files installed

C:\>ppm install MailTools
Downloading MailTools-2.04...done
Downloading Test-Pod-1.40...done
Unpacking MailTools-2.04...done
Unpacking Test-Pod-1.40...done
Generating HTML for MailTools-2.04...done
Generating HTML for Test-Pod-1.40...done
Updating files in site area...done
43 files installed

C:\>ppm install GD
No missing packages to install

C:\>ppm install Chart
Downloading Chart-2.4.1...done
Unpacking Chart-2.4.1...done
Generating HTML for Chart-2.4.1...done
Updating files in site area...done
16 files installed

C:\>ppm install GDGraph
Downloading GDGraph-1.44...done
Unpacking GDGraph-1.44...done
Generating HTML for GDGraph-1.44...done
Updating files in site area...done
21 files installed

C:\>ppm install PatchReader
Downloading PatchReader-0.9.5...done
Unpacking PatchReader-0.9.5...done
Generating HTML for PatchReader-0.9.5...done
Updating files in site area...done
12 files installed

C:\>ppm install Net-LDAP-Express
Downloading Net-LDAP-Express-0.11...done
Downloading perl-ldap-0.39...done
Downloading Convert-ASN1-0.22...done
Unpacking Net-LDAP-Express-0.11...done
Unpacking perl-ldap-0.39...done
Unpacking Convert-ASN1-0.22...done
Generating HTML for Net-LDAP-Express-0.11...done
Generating HTML for perl-ldap-0.39...done
Generating HTML for Convert-ASN1-0.22...done
Updating files in site area...done
103 files installed

Install Apache

Installing Apache on Windows is again a smooth process. Just follow the instructions. Make sure you Install it for All Users. Apache always install itself in Apache2 directory. On my machine, apache is in C:\Program Files\Apache Group\Apache2.

Configure Apache

Edit C:\Program Files\Apache Group\Apache2\conf\httpd.conf with your favourite text editor.


# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80

Change the DocumentRoot setting to point to C:\Bugzilla. Note there are two locations in httpd.conf that need to be updated.

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Bugzilla"

#
# This should be changed to whatever you set DocumentRoot to.
#



Enable CGI support in Apache by uncommenting the AddHandler cgi-script .cgi line.

#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi

And allow .cgi scripts in the Bugzilla directory by adding the ExecCGI option. We also need to allow Bugzilla's .htaccess file to restrict access to sensitive documents by allowing it to override the defaults. This involves changing AllowOverride None to AllowOverride All.

Apache also needs to know to use Perl to execute .cgi files, via the ScriptInterpreterSource directive.

#
# This should be changed to whatever you set DocumentRoot to.
#


#
# 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.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks 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
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

#
# Tell Apache to use Perl to execute .cgi
#
ScriptInterpreterSource Registry-Strict




You also should add index.cgi to the DirectoryIndex list.

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var index.cgi


In order for ScriptInterpreterSource Registry-Strict to work, you also need to add an entry to the Registry so Apache will use Perl to execute .cgi files.

Create a key HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command with the default value of the full path of perl.exe with a -T parameter. For example C:\Perl\bin\perl.exe -T

Restart Apache

C:\>net stop apache2
The Apache2 service is stopping..
The Apache2 service was stopped successfully.

C:\>net start apache2
The Apache2 service is starting.
The Apache2 service was started successfully.

Bugzilla Configuration

Once all of the above steps are executed successfully, we are ready to test bugzilla installation.
On the console window, go to c:\bugzilla, and execute the following command:
c:\bugzilla>perl checksetup.pl

If it runs without error message,then congratulations,otherwise figure out what mighty be wrong according to the error message,it is very obvious.

Now, we are ready to configure bugzilla. Open a file called localconfig in your favourite text editor.

First, update the DB info:

$db_host = "localhost"; # where is the database?
$db_port = 3306; # which port to use
$db_name = "bugsdb"; # name of the MySQL database
$db_user = "bugs_user"; # user to attach to the MySQL database
$db_pass = 'bugs_pass';

Customize following variables according to your needs to initialize mysql database

@severities,the secerity level of the bug to be specified when creating a new bug
@priorities,the priority you can assign to the bug
@opsys,possible operating system of your test environment
@platforms,hardware platform your system is running on.


You can also update these variables any time after the installation and configuration is over.

Then run the above command again,this will initialize database and create required tables.
c:\bugzilla>perl checksetup.pl

If things go wrong during database setup,try to make sure you have edited database connect parameters correctly .


No comments:

Post a Comment

Followers

About Me

Pune, Maharashtra, India