Implementing Bugzilla and TestLink on a Windows Environment

by 6th June 2012Operating Systems, Testing

In May, I started on a new project for a client, and one of their first requests was for a rapid analysis of open source (or in other words, "free") defect and test management products. Beyond the free aspect, I also had the constraint of a Windows server.

It’s natural that most open source products are designed for LAMP (Linux, Apache, MySQL and PHP), since the supporting operating system, web server, database server and programming language are also open source. By comparison, Windows Server, and the associated Internet Information Services (IIS, Microsoft’s equivalent web server), SQL Server (database) and Application Server Pages (ASPX programming language, be it in C#, VB or any variant) have certain associated costs. Admittedly, SQL Server, IIS and Visual Studio have free versions available, but once you port it to a commercial environment, the licence restrictions kick in.

The result was that I chose Bugzilla and TestLink, both well tried implementations with strong community support. Both require the use of Apache, MySQL and PHP, but you aren’t limited to Linux to implement this. Admittedly, it can be a little more complex to install and configure these on a Windows server, but there are some tools that can make your life more easy.

If you’re looking to implement Bugzilla and TestLink on a Windows environment, the following guide should help you towards getting both up and running with as few issues as possible. The installation process assumes you are installing to a 64 bit version of Windows, with the only difference being that installation for a 32 bit version should go to "Program Files" and not "Program Files (x86)".

Application Requirements

Before you start, you’re going to need to download the following packages:

ActivePerl
EasyPHP
Bugzilla
TestLink
GraphViz

Where you come across a value in italics and surrounded by {braces}, this should be replaced by details specific to your configuration.

Installing ActivePerl

  1. Install ActivePerl to C:Program FilesPerl64 using the ActivePerl executable.
  2. Add the following to the registry:
  3. [HKEY_CLASSES_ROOT.cgiShellExecCGICommand]
    @="C:Program FilesPerl64binperl.exe -T"
  4. From a command line, run the following:
  5. C:
    cd C:Program FilesPerl64bin
    ppm install AppConfig
    ppm install TimeDate
    ppm install DBI
    ppm install DBD-mysql
    ppm install Template-Toolkit
    ppm install MailTools
    ppm install GD
    ppm install Chart
    ppm install GDGraph
    ppm install PatchReader
    ppm install Net-LDAP-Express
    ppm install Email::Send::SMTP::TLS
    

Installing GraphViz

  1. Install GraphViz to C:Program Files (x86)GraphViz using the GraphViz executable.

Installing EasyPHP

  1. Install EasyPHP to C:Program Files (x86) using the EasyPHP executable.
  2. Right click on the EasyPHP icon in the icon bar and select the Configuration | EasyPHP menu option.
  3. Ensure Start on Session startup and Start Apache and MySQL as services (Administrator only) are checked.
  4. Ensure Check version at startup is not checked.
  5. Click on the OK button.

Configuring Apache

  1. Edit C:Program Files (x86)EasyPHPconf_fileshttpd.conf.
    1. Add the following at Line 244:
      #
      # Tell Apache to use Perl to execute .cgi
      #
      ScriptInterpreterSource Registry-Strict
                  
    2. Add index.cgi to the end of Line 256, e.g.
      DirectoryIndex index.html index.shtml index.wml index.pwml index.php
                  index.php3 index.php4 index.php5 index.cgi
    3. Add the following at Line 370:
      <Directory "${path}/www/bugzilla">
      Options FollowSymLinks Indexes
      AllowOverride All
      Options +ExecCGI
      allow from all
      </Directory>
    4. Remove the # from the beginning of Line 459:
      AddHandler cgi-script .cgi
    5. Save the file.
  2. Restart EasyPHP by going to the EasyPHP icon in the Notification area, right-clicking and selecting the Restart option.

Configuring MySQL

  1. Access the MySQL database by going to the EasyPHP icon in the Notification area, right-clicking and selecting the Administration option. A browser window will display.
  2. Click the Open link next to the MySQL Administration : PhpMyAdmin 3.4.9 under the Modules section. The phpMyAdmin website will open.
  3. Click on the SQL option at the top of the screen.
  4. Create the Bugzilla User Name with the following:
    GRANT ALL PRIVILEGES ON bugzilla.* TO 'bugzilla'@'localhost' IDENTIFIED BY '{password}';
  5. Close the browser.
  6. Edit C:Program Files (x86)EasyPHPmysqlmy.ini.
  7. Change Line 60 from max_allowed_packet = 1M to max_allowed_packet = 4M.
  8. Save the file.

Installing Bugzilla

  1. Extract Bugzilla.zip to C:Program Files (x86)EasyPHPwww.
  2. At the command line, enter the following commands:
    Cd C:Program Files (x86)EasyPHPwwwbugzilla
    Checksetup.pl
  3. If any packages are identified as missing, copy the install line and execute at the command line (e.g. ppm install PatchReader).
  4. Open C:Program Files (x86)EasyPHPwwwbugzilla localconfig in a text editor.
  5. Change the following lines, starting at line 58:
    # The DNS name or IP address of the host that the database server runs on.
    
    $db_host = '127.0.0.1';
    
    # The name of the database. For Oracle, this is the database's SID. For
    # SQLite, this is a name (or path) for the DB file.
    
    $db_name = 'bugzilla';
    
    # Who we connect to the database as.
    $db_user = 'bugzilla';
    
    # Enter your database password here. It's normally advisable to specify
    # a password for your bugzilla database user.
    # If you use apostrophe (') or a backslash () in your password, you'll
    # need to escape it by preceding it with a '' character. (') or ()
    # (It is far simpler to just not use those characters.)
    
    $db_pass = '{password}';
    
  6. Save the file.
  7. Edit the following file: C:Program Files (x86)EasyPHPwwwbugzilla.htaccess
    1. Change Line 2 from Deny from all to Allow from all.
  8. At the command line, enter the following commands again:
    C:
    Cd C:Program Files (x86)EasyPHPwwwbugzilla
    Checksetup.pl
  9. At the prompt for a mail server, set it to 127.0.0.1.
  10. At the prompt for the administrator email address enter your email address.
  11. At the prompt for the administrator’s real name, enter the administrator’s name.
  12. At the prompt for the administrator’s password, enter a valid password.
  13. Repeat the password at the next prompt.
  14. Log out of the server.

Configuring Bugzilla

  1. From a browser on your desktop, navigate to http://{server ip}/bugzilla.
  2. Login using your login email address and password. Bugzilla is now ready to set up for additional users and configuration.
  3. Click on the Administration link at the top of the screen.
  4. Select the Parameters link from the Administer your installation screen.
  5. Enter http://{server ip}/bugzilla/ in the urlbase field.
  6. Click on the Save changes button.
  7. Click on the General link on the left hand menu.
  8. Enter the administrator email address in the maintainer field.
  9. Click on the Save changes button.
  10. Click on the Email link on the left hand menu.
  11. Select SMTP:TLS from the mail_delivery_method drop down list.
  12. Enter the administrator email address in the mailfrom and smtp_username fields.
  13. Enter {smtp server}:{smtp port} in the smtpserver field.
  14. Enter the email login password in the smtp_password field.
  15. Click on the Save changes button.
  16. Click on the Dependency Graphs link on the left hand menu.
  17. Enter C:Program Files (x86)GraphVizbin in the webdotbase field.
  18. Click on the Save changes button.

Installing TestLink

  1. Extract TestLink.zip to C:Program Files (x86)EasyPHPwww.
  2. Navigate to http://{server ip}/testlink/.
  3. Click on the New Installation option.
  4. Accept the licence.
  5. Click the Continue button.
  6. Enter a table prefix for the project.
  7. Enter the database administration user (root, no password).
  8. Create a TestLink DB Login.
  9. Click the Process TestLink Setup! button.
  10. On the server, edit C:Program Files (x86)EasyPHPwwwtestlinkcfgbugzilla.cfg.php.
    //Set the bug tracking system Interface
    /** DB host to use when connecting to the Bugzilla db */
    define('BUG_TRACK_DB_HOST', '127.0.0.1');
    
    /** name of the database that contains the Bugzilla tables */
    define('BUG_TRACK_DB_NAME', 'bugzilla');
    
    /** charset of the database that contains the Bugzilla tables */
    define('BUG_TRACK_DB_CHARSET', 'UTF-8');
    
    /** useful if you have several schemas see BUGID 1444*/
    // define('BUG_TRACK_DB_SCHEMA', '[CONFIGURE_BUG_TRACK_DB_SCHEMA]');
    
    /** DB type used for the bugtracking db */
    define('BUG_TRACK_DB_TYPE','[CONFIGURE_BUG_TRACK_DB_TYPE]');
    
    /** DB user and password to use for connecting to the Bugzilla db */
    define('BUG_TRACK_DB_USER', 'bugzilla');
    define('BUG_TRACK_DB_PASS', '{password}');
    
    /** link of the web server */
    define('BUG_TRACK_HREF', "http://127.0.0.1/bugzilla/show_bug.cgi?id=");
    
    /** link to the bugtracking system, for entering new bugs */
    define('BUG_TRACK_ENTER_BUG_HREF',"http://127.0.0.1/bugzilla/");
    
  11. Save the file.
  12. Edit C:Program Files (x86)EasyPHPwwwtestlinkconfig.inc.php.
  13. Change line 225 from:
    $tlCfg->config_check_warning_mode = FILE
    

    to:

    $tlCfg->config_check_warning_mode = 'SILENT';
    
  14. Save the file.
  15. Copy the custom_config.inc.php.example to custom_config.inc.php and edit.
  16. Add the following at line 100:
    // Add in the Bugzilla configuration
    $g_interface_bugs = 'BUGZILLA';
    
  17. Edit the following sections as defined below.
    // SMTP server Configuration ("localhost" is enough in the most cases)
    $g_smtp_host        = '{smtp server}';  # SMTP server MUST BE configured
    
    # Configure using custom_config.inc.php
    $g_tl_admin_email     = '{admin email}'; # for problem/error notification
    $g_from_email         = '{admin email}';  # email sender
    $g_return_path_email  = '{admin email}';
    
    # Urgent = 1, Not Urgent = 5, Disable = 0
    // $g_mail_priority = 5;
    
    # Taken from mantis for phpmailer config
    #define ("SMTP_SEND",2);
    #$g_phpMailer_method = SMTP_SEND;
    
    // Configure only if SMTP server requires authentication
    $g_smtp_username    = '{smtp username}';  # user
    $g_smtp_password    = '{smtp password}';  # password 
  18. Save the file.

Configuring TestLink

  1. Navigate to http://{server ip}/testlink/
  2. Click on the hyperlink on the following page and login using admin/admin.
  3. Configure any additional users you might need.

With luck, you should have fully functioning implementations of Bugzilla and TestLink running on a Windows environment. If you find any errors or have problems, please let me know via the contact page or via Twitter.

Matthew Cunliffe Avatar
Matthew Cunliffe

Matthew is an IT specialist with more than 24 years experience in software development and project management. He has a wide range of interests, including international political theory; playing guitar; music; hiking, kayaking, and bouldering; and data privacy and ethics in IT.

Matthew Cunliffe

Author

Matthew is an IT specialist with more than 24 years experience in software development and project management. He has a wide range of interests, including international political theory; playing guitar; music; hiking, kayaking, and bouldering; and data privacy and ethics in IT.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Share this post