Bugzilla

From DreamHost

Jump to: navigation, search
The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.
Server changes may cause this to break. Be prepared to troubleshoot this yourself if this happens.
We seriously aren't kidding about this. Read the blinky part again.

Contents

Introduction

Bugzilla is a web-based tool for "change management", i.e. reporting and tracking changes (or requests for changes) to a product. It is typically used by software developers to allow a user to report a bug, provide a discussion forum for the bug, and to track any fixes (or other resolution) for the bug. However, Bugzilla is flexible enough that it can be used to manage any kind of requests for any kind of product or service. For example, it can be used by employees to request a service, such as asking the I.T. department to fix a paper jam in the printer in room 3E.

More information can be found at the Bugzilla web site: http://www.bugzilla.org/about/


Installing Bugzilla

The current stable version of Bugzilla (3.0) seems to require a couple of extra perl modules that Dreamhost does not have installed by default. See #Installing_3.0 for some help.

Before you begin

Go to the Dreamhost Manage Domain sub-panel of Domains (https://panel.dreamhost.com/index.cgi?tree=domain.manage&) and create the HTTP domain bugs.myOwnDomain.com to host the web interface to Bugzilla.

Hint: creating a sub-domain is cheaper (free) and faster than creating a new domain (the latter can take days to become active).

Creating the MySQL Database

Bugzilla uses MySQL as the database back-end. Fortunately, Dreamhost's MySQL support makes it real easy to set it up for Bugzilla. All you need to do is create a single database with some standard values.

Go the Dreamhost MySQL Web Admin panel (https://panel.dreamhost.com/index.cgi?tree=goodies.mysql), and enter in the following information:

DB name: userbugs
DB Hostname: mysql.myOwnDomain.com
DB Username: userbugs
DB Password: password
Repeat PW: password

where user is your userid and password is some password you've chosen.

After filling in all five fields, press the button labeled "Add a new database now!". The database will be ready to use in about 15 minutes, so if you complete all of the other steps before the database is ready, you'll just need to wait a little longer.

Configuring Bugzilla

The instructions provided in this article or section require shell access unless otherwise stated.

You can use the PuTTY client on Windows, or SSH on UNIX and UNIX-like systems such as Linux or Mac OS X.
Your account must be configured for shell access in the Control Panel.
More information may be available on the article's talk page.

  1. Log in to your account using SSH.
  2. Download the bugzilla tarball:
    wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-STABLE.tar.gz
  3. Change to your html directory (i.e. the directory that will store files for bugs.myOwnDomain.com) using the command
    cd myOwnDomain.com/bugs
    (Hint, if that directory does not exist you can make it with
    mkdir $HOME/myOwnDomain.com/bugs
  4. Untar the Bugzilla tarball into your html directory:
    tar zxf ../bugzilla-STABLE.tar.gz
  5. Change to the bugzilla directory with the command:
    cd bugzilla-###
    where ### is the version number on the folder that you just extracted.
  6. Create the default localconfig file by entering the command:
    nice -n 12 ./checksetup.pl

    You should see output similar to the following:

    * This is Bugzilla 3.0 on perl 5.8.4
    * Running on Linux 2.4.29-grsec+w+fhs6b+gr0501+nfs+a32+++p4+sata+c4+gr2b-v6.189 #1 SMP Mon Feb 7 13:23:30 PST 2005
    
    Checking perl modules...
    Checking for             CGI (v2.93)   ok: found v3.04 
    Checking for        TimeDate (v2.21)   ok: found v2.22 
    Checking for             DBI (v1.41)   ok: found v1.46 
    Checking for       PathTools (v0.84)   ok: found v0.87 
    Checking for Template-Toolkit (v2.12)   ok: found v2.14 
    Checking for      Email-Send (v2.00)   ok: found v2.185 
    Checking for Email-MIME-Modifier (any)     ok: found v1.442 
    
    Checking available perl DBD modules...
    Checking for          DBD-Pg (v1.45)    found v1.41 
    Checking for       DBD-mysql (v2.9003) ok: found v2.9006 
    
    The following Perl modules are optional:
    Checking for              GD (v1.20)   ok: found v2.23 
    Checking for     Template-GD (any)     ok: found v1.56 
    Checking for           Chart (v1.0)    ok: found v2.2 
    Checking for         GDGraph (any)     ok: found v1.43 
    Checking for      GDTextUtil (any)     ok: found v0.86 
    Checking for        XML-Twig (any)     ok: found v3.17 
    Checking for      MIME-tools (v5.406)  ok: found v5.417 
    Checking for     libwww-perl (any)     ok: found v2.033 
    Checking for     PatchReader (v0.9.4)  ok: found v0.9.5 
    Checking for      PerlMagick (any)     ok: found v6.0.6 
    Checking for       perl-ldap (any)     ok: found v0.32 
    Checking for       SOAP-Lite (any)     ok: found v0.66.1 
    Checking for     HTML-Parser (v3.40)   ok: found v3.45 
    Checking for   HTML-Scrubber (any)     ok: found v0.08 
    Checking for Email-MIME-Attachment-Stripper (any)      not found 
    Checking for     Email-Reply (any)      not found 
    Checking for        mod_perl (v1.999022)  not found 
    Checking for             CGI (v3.11)    found v3.04 
    Checking for      Apache-DBI (v0.96)    not found 
    
    * NOTE: You must run any commands listed below as root.
    
    **********************************************************************
    * OPTIONAL MODULES                                                   *
    **********************************************************************
    * Certain Perl modules are not required by Bugzilla, but by          *
    * installing the latest version you gain access to additional        *
    * features.                                                          *
    *                                                                    *
    * The optional modules you do not have installed are listed below,   *
    * with the name of the feature they enable. If you want to install   *
    * one of these modules, just run the appropriate command in the      *
    * "COMMANDS TO INSTALL" section.                                     *
    **********************************************************************
    
    ***********************************************************************
    *                    MODULE NAME * ENABLES FEATURE(S)                 *
    ***********************************************************************
    *                    Email-Reply * Inbound Email                      *
    * Email-MIME-Attachment-Stripper * Inbound Email                      *
    *                       mod_perl * mod_perl                           *
    *                     Apache-DBI * mod_perl                           *
    *                            CGI * mod_perl                           *
    ***********************************************************************
    COMMANDS TO INSTALL:
    
        Email-Reply: /usr/bin/perl -MCPAN -e 'install Email::Reply'
    Email-MIME-Attachment-Stripper: /usr/bin/perl -MCPAN -e 'install Email::MIME::Attachment::Stripper'
           mod_perl: /usr/bin/perl -MCPAN -e 'install mod_perl2'
         Apache-DBI: /usr/bin/perl -MCPAN -e 'install Apache::DBI'
                CGI: /usr/bin/perl -MCPAN -e 'install CGI'
    Reading ./localconfig...
    
    OPTIONAL NOTE: If you want to be able to use the 'difference between two
    patches' feature of Bugzilla (which requires the PatchReader Perl module
    as well), you should install patchutils from:
    
        http://cyberelk.net/tim/patchutils/
    
    
    This version of Bugzilla contains some variables that you may want to 
    change and adapt to your local settings. Please edit the file 
    ./localconfig and rerun nice -n 12 checksetup.pl.
    
    The following variables are new to ./localconfig since you last ran
    checksetup.pl:  create_htaccess, webservergroup, db_driver, db_host, db_name, db_user, db_pass, db_port, db_sock, db_check, index_html, cvsbin, interdiffbin, diffpath
    
    If any of the modules in the top section that doesn't say "optional" are listed as missing, please see the section below for the specific version of Bugzilla you are installing to fix the version-specific issues, then return here and do this step again. It is worth using "nice" to stop the install-module.pm from being too processor intensive, as DreamHost servers will kill processes it deems as using too much of the server resources, giving install errors. For example, to add MySQL support you would run
    nice -n 12 perl install-module.pl DBD::mysql
    to install with a lower process priority.
  7. Find out your primary group. On the command line, run:
    groups
    and make note of the group listed there. If there is more than one, you want the first one. Remember this, you'll need it in the next step.
  8. Edit localconfig with your favorite text editor. Make the following changes:
    1. Change $webservergroup = "apache" to $webservergroup = "yourgroup" where yourgroup is your primary group (which you looked up in the previous step). NOTE: Previous instructions here suggested to set $webservergroup = "" -- you do not want to do this as it will let anyone else hosted on the same machine with you screw with your bugzilla settings!
    2. Change $db_host = "localhost" to $db_host = "mysql.myOwnDomain.com" (the value specified in "DB Hostname" above).
    3. Change $db_name = "bugs" to $db_name = "userbugs" (the value specified in "DB name" above).
    4. Change $db_user = "bugs" to $db_user = "userbugs" (the value specified in "DB Username" above).
    5. Change $db_pass = ''; to $db_pass = 'password';, where password is the password you chose for "DB Password" above.
  9. re-run checksetup.pl:
    nice -n 12 ./checksetup.pl
  10. Dreamhost uses suexec to run your CGIs. This means the CGIs run as your user and not as the webserver. As of Bugzilla 3.4.2, checksetup.pl still doesn't know how to deal with this (it's likely this will be fixed in Bugzilla 3.6). After running checksetup.pl (and after every time you ever run checksetup.pl) you'll need to run the following commands to set some additional permissions to let Bugzilla work under suexec on Dreamhost:
    for i in docs graphs images js skins; do find $i -type d -exec chmod o+rx {} \; ; done
    for i in jpg gif css js png html rdf xul; do find . -name \*.$i -exec chmod o+r {} \; ; done
    find . -name .htaccess -exec chmod o+r {} \;
    chmod o+x . data data/webdot
    

That should be it. Launch your web browser and point it to http://www.myOwnDomain.com/bugs/bugzilla-###. You should see the Bugzilla front page.

Installing 2.18

As of May 12, 2006, installing Bugzilla 2.18 does not require any additional or updated modules. Just use the latest .tar.gz and follow the instructions as above.

Installing 2.20

As of May 12, 2006, installing Bugzilla 2.20 does not require any additional or updated modules. Just use the latest .tar.gz and follow the instructions as above.

Installing 2.22

As of May 12, 2006, installing Bugzilla 2.22 does not require any additional or updated modules. Just use the latest .tar.gz and follow the instructions as above.

Installing 3.0

Bugzilla 3.0 requires a couple of CPAN modules that are not installed by default. After executing checksetup.pl you will probably see a message indicating that you need to install Email::Send and Email::MIME::Modifier. Follow the instructions on the CPAN page to install a local copy of cpan and then execute the following commands:

$ cpan
cpan> install Email::Send
cpan> install Email::MIME::Modifier
cpan> bye

You will need to add the following lines (replacing username with your actual user name, and assuming you used perlmods as suggested on the CPAN page) to the top of Bugzilla/Mailer.pm

use lib qw( /home/username/perlmods/lib/perl/5.8 /home/username/perlmods/lib/perl/5.8.4 
            /home/username/perlmods/share/perl/5.8 /home/username/perlmods/share/perl/5.8.4 );

It's important that the above lines get put before the 'use Email::Send' and 'use Email::MIME::Modifier' lines that are already in the file.

Now re-execute checksetup.pl and you can continue the installation as above.

Making email work

To get Bugzilla to send email you will need to go to the Email configuration page in Bugzilla and set your mail_delivery_method to SMTP, your smtpserver to smarty.dreamhost.com, and your mailfrom to a valid email address you have created in the Dreamhost panel.

I'm told using the above method (smarty.dreamhost.com) has limits on how many emails you can send per hour, to prevent runaway processes (or infected machines) from sending lots of spam. If you have a small Bugzilla without a lot of people using it, you'll probably be fine. If your Bugzilla winds up getting a lot of traffic, you'll probably want to set up SMTP authentication on your assigned mail server, which as of Bugzilla 3.0, still requires some code modification to Bugzilla:

On the Email configuration page in Bugzilla, set your smtpserver to mail.yourdomain.com where yourdomain.com is your domain name.

Now, find these lines in Mailer.pm:

    if ($method eq "SMTP") {
        push @args, Host  => Bugzilla->params->{"smtpserver"},
                    Hello => $hostname

And add the following immediately after them (substitute the password for the account you used above for password below):

                    username => $from,
                    password => "password"

Installing 3.2 & 3.4

Bugzilla 3.2/4 requires a couple of CPAN modules that are not installed by default. However you won't need any of the workarounds listed above for Bugzilla 3.0. All of the scripts included with Bugzilla 3.2 already have a use lib statement allowing them to load modules from a lib/ subdirectory under Bugzilla. You can use the install-modules.pl script included with Bugzilla (as instructed by checksetup.pl) to install these modules directly into the lib/ directory, and you don't need to set up CPAN to do it!

From version 3.2, Bugzilla also directly supports authenticated SMTP, so you won't need to do anything special to make email work (other than configure it). Follow the same configuration instructions as above in the 3.0 section, but you won't need to modify any code.

Unfortunately, the built-in suexec support hasn't made it yet, so you'll still need to do step 10 to fix the file permissions.

Personal tools