Title: Bugzilla on Debin
Subject: Using Debina packages and Bugzilla 2.18 from bugzilla.org
StartDate:2005-04-18
#----------------------------------------------
# Install some supporting packages (with apt-get, aptitude, or synaptic )
aptitude install \
gawk \
libchart-perl \
libdbd-mysql-perl \
libdbi-perl \
libgd-gd2-perl \
libgd2-xpm \
libnet-daemon-perl \
libplrpc-perl \
libtemplate-perl \
libtimedate-perl \
libxml-parser-perl \
mysql-client-1.4 \
mysql-server-4.1 \
mysq-common-4.1 \
libapache-template-perl \
libappconfig-perl \
templatetoolkit-perl \
libtext-wrapi18n-perl \
libdata-dumper-simple-perl \
libdbd-mysql-perl \
libapache-dbi-perl \
libtime-modules-perl \
libxml-parser-perl \
libgd-graph-perl \
libgd-gd2-perl \
libgd-graph3d-perl \
libgd-text-perl \
libmime-perl \
libmime-types-perl \
libmailtools-perl \
libtimedate-perl \
libtime-piece-perl \
libtime-modules-perl \
libtime-human-perl \
libmysqlclient12-dev \
perl-doc \
procmail
# Pin mysql (aptitude dist-upgrade keeps trying to remove)
# Install the Bundle::Bugzilla (DBD-mysql needed test server)
perl -MCPAN -e 'install "Bundle::Bugzilla"'
pushd /root/.cpan/build/DBD-mysql-2.9006
perldoc lib/DBD/mysql/INSTALL.pod
perl Makefile.PL --testuser=root --testdb=test
make
make test
make install
popd
# Install perl module for wich there is no debian package
perl -MCPAN -e 'install PatchReader'
# Download the stuff
wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-2.18.tar.gz
# Put into web area and unpack
mv bugzilla-2.18.tar.gz /var/www/
pushd /var/www/
tar -zxvpf bugzilla-2.18.tar.gz
cd bugzilla-2.18
# run this once to create the initial localconfig
./checksetup.pl
# edit this thing for your system
vi localconfig
# Edit:
#------------------------------
#$db_host = "localhost";
#$db_port = 3306;
#$db_name = "bugs";
#$db_user = "bugs";
#$db_pass = 'm393s2gscEJ7yhli';
#------------------------------
#$webservergroup = "www-data";
#------------------------------
#"P6",
#"P7",
#"P8",
#"P9",
#"P10"
#------------------------------
# Add opsys "SIM", "MAPP",
# Add platforms "SIM,"
# Add maxattachmentsize="16M"
# Config more stuff
mgdiff /var/www/bugzilla-2.18/data/params /root/Bugzilla/htdocs/data/params
vi /var/www/bugzilla-2.18/data/params
# Change to:
#---------------------------------
# 'allowbugdeletion' => '1',
# 'chartgroup' => 'editbugs',
# 'commentonaccept' => '0',
# 'commentonclearresolution' => '1',
# 'commentonclose' => '1',
# 'commentonconfirm' => '0',
# 'commentoncreate' => '1',
# 'commentonduplicate' => '1',
# 'commentonreassign' => '0',
# 'commentonreassignbycomponent' => '0',
# 'commentonreopen' => '1',
# 'commentonresolve' => '1',
# 'commentonverify' => '1',
# 'defaultpriority' => 'P5',
# 'insidergroup' => 'insider',
# 'maintainer' => 'johns@meyersound.com',
# 'maintainer' => 'jons@meyersound.com',
# 'makeproductgroups' => '1',
# 'maxattachmentsize' => '16000',
# 'move-enabled' => '0',
# 'noresolveonopenblockers' => '1',
# 'noresolveonopenblockers' => '1',
# 'requirelogin' => '1',
# 'sendmailnow' => '1',
# 'supportwatchers' => '1',
# 'timetrackinggroup' => 'timetrack',
# 'timezone' => 'pacific',
# 'urlbase' => 'http://bugzilla.msli.com/',
# 'usebugaliases' => '1',
# 'useentrygroupdefault' => '1',
# 'useqacontact' => '1',
# 'usestatuswhiteboard' => '1',
# 'usetargetmilestone' => '1',
'whinedays' => '2',
# Add:
#---------------------------------
# 'auth_env_email' => '',
# 'auth_env_id' => '',
# 'auth_env_realname' => '',
# 'defaultopsys' => 'SIM',
'defaultplatform' => 'SIM',
# 'showallproducts' => 0,
# 'user_info_class' => 'CGI',
# 'user_verify_class' => 'DB',
# 'usevisibilitygroups' => 0,
# NEW Options:
#---------------------------------
# 'loginmethod' => 'DB',
# 'usebrowserinfo' => 1,
# 'useclassification' => 0,
##############################################
#
# TODO: needo to go back and tweek settings
# to what they used to be
#
###############################################
# Drop previous data
mysqladmin -uroot -p drop bugs
mysqladmin -uroot -p add bugs
# Drop previous bugzilla users, create a new one
cat << mysql mysql -uroot -p
# mysql> delete from user where User="bugzilla";
# mysql> delete from user where User="bugs";
# mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY '$db_pass';
# mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY '$db_pass';
# mysql> grant SELECT,INSERT,UPDATE,CREATE,DROP ON bugs.* TO 'bugs'@'localhost' identified by 'm393s2gscEJ7yhli';
# mysql> FLUSH PRIVILEGES;
# mysql> EXIT;
# Rerun config
./checksetup.pl
# Enter the e-mail address of the administrator: john@stilen.com
# You entered 'john@stilen.com'. Is this correct? [Y/n] y
# Enter the real name of the administrator: John Stile
# Enter a password for the administrator account:
# Please retype the password to verify:
# All kinds of darn apache permission problems...
# Test says it's because
./testserver.pl http://localhost/bugs
# TEST-WARNING Webserver is running under group id not matching $webservergroup.
# This if the tests below fail, this is probably the problem.
# Please refer to the webserver configuration section of the Bugzilla guide.
# If you are using virtual hosts or suexec, this warning may not apply.
# TEST-OK Got ant picture.
# TEST-OK Webserver is executing CGIs.
# TEST-OK Webserver is preventing fetch of http://localhost/bugs/localconfig.
# Finally fixed it by using default apache config and creating this file
vi /etc/apache2/conf.d/bugz.conf
Alias /bugs "/var/www/bugzilla-2.18"
AddType application/vnd.mozilla.xul+xml .xul
AddType application/rdf+xml .rdf
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI +FollowSymLinks
DirectoryIndex index.cgi
AllowOverride Limit
# Add this to the default apache root config (/etc/apache2/sites-enabled/000-default)
vi /etc/apache2/sites-enabled/000-default
Include conf.d/bugz.conf
# Transfer template backups from old bugzilla server
rsync -avz -e ssh Bugzilla root@debian1:~/
# Get into bugzilla dir, if you aren't already
pushd /var/www/bugzilla-2.18
# Does Size Matter? Im not sure which template is correct, so I figure it out by trial and error
du -sh /root/Bugzilla/htdocs/data/template/template/en/* /root/Bugzilla/htdocs/template/en/*
#Tested: Size: PATH:
------- ----- ------------------------------------------------------
#WRONG 42K /root/Bugzilla/htdocs/data/template/template/en/custom
#WRONG 1.9M /root/Bugzilla/htdocs/data/template/template/en/default
# 26K /root/Bugzilla/htdocs/template/en/custom
# 1.6M /root/Bugzilla/htdocs/template/en/default
# THIS DIRECTORY DELETED EACH RUN OF ./cecksetup.pl
# data/template/template/en/custom
# Fails
rm -rf template/en/custom
rsync -avz /root/Bugzilla/htdocs/template/en/default/ template/en/custom
./checksetup.pl
# Fails
rm -rf template/en/custom
rsync -avz /root/Bugzilla/htdocs/data/template/template/en/default/ template/en/custom
./checksetup.pl
# Kinda Works
rm -rf template/en/custom
rsync -avz /root/Bugzilla/htdocs/data/template/template/en/custom/ template/en/custom
./checksetup.pl
# Works!!!
rm -rf template/en/custom
rsync -avz /root/Bugzilla/htdocs/template/en/custom/ template/en/custom
./checksetup.pl
# Playing games ( add random bug image to front page
mkdir /var/www/bugzilla-2.18/bug_images
cd /var/www/bugzilla-2.18/bug_images
wget http://stilen.com/gallery/albums/bugs/bug{1,2,4,5,6,7,8,9,11,12,13}.jpg
# Mess with the template
vi /var/www/bugzilla-2.18/template/en/custom/index.html.tmpl
WELCOME TO BUGZILLA
|
./checksetup.pl
# The following parameters are no longer used in Bugzilla, and so have been
# removed from your parameters file and appended to old-params.txt:
# usevisibilitygroups, auth_env_realname, user_info_class, showallproducts,
# auth_env_email, defaultplatform, defaultopsys, auth_env_id,
# user_verify_class
###############################################
# Setup completed
###############################################
###############################################
# TODO: Notes from here on are in progress
###############################################
###############################################
# tweekening
###############################################
# Allow large attachments
vi /var/www/bugzilla-2.18/data/params
vi /etc/mysql/my.cnf
[mysqld]
# Allow packets up to 16M
max_allowed_packet = 16M
# Allow small words in full-text indexes
# http://www.mysql.com/doc/en/Fulltext_Fine-tuning.html.
ft_min_word_len=2
# Permit attachments table to grow beyond 4GB, to 20GB.
mysql bugs -uroot -p
mysql> ALTER TABLE attachments AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;
mysql> exit;
# Bug Graphs
crontab -e
5 0 * * * cd /var/www/bugzilla-2.18 ; ./collectstats.pl
# Dependency Charts, set path to dot from GraphViz
in params
Change:
'webdotbase' => 'http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%',
To:
'webdotbase' => '/usr/bin/dot',
# The Whining Cron
crontab -e
55 0 * * * cd /var/lib/bugzilla-2.18 ; ./whineatnews.pl
#DIDN'T COMPLETE Patch Viewer
aptitude install lxr bonsai cvs
# Database = bonsai
# User = bonsai
# Passwd = bonsai
# Passwd for administrator acocunt: bonsai
# READ /usr/share/doc/bonsai/README.Debian
# whereis cvs
# whereis lxr
# whereis bonsai
# vi editparams.cgi
# Fix email by installing Net::SMTP
aptitude install libnet-perl libnet-ph-perl libnet-snpp-perl libnet-telnet-perl
vi Bugzilla/BugMail.pm
---------------
CHANGE:
---------------
open(SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t -i") ||
die "Can't open sendmail";
print SENDMAIL trim($msg) . "\n";
close SENDMAIL;
---------------
TO:
---------------
use Net::SMTP;
my $smtp_server = 'mail.stilen.com'; # change this
($enableSendMail && $rcpt_to) || return;
# Use die on error, so that the mail will be in the 'unsent mails' and
# can be sent from the sanity check page.
my $smtp = Net::SMTP->new($smtp_server) ||
die 'Cannot connect to server \'$smtp_server\'';
$smtp->mail('bugzilla-daemon@stilen.com'); # change this
$smtp->to($rcpt_to);
$smtp->data();
$smtp->datasend($msg);
$smtp->dataend();
$smtp->quit;
###############################################
# Trnasfer Data from old old_bugzilla host
###############################################
mysqldump bugs -uroot -p --no-create-db --no-create-info --lock-tables > bugzilla_data_20050422.sql
du -sh bugzilla_data_20050422.sql
# s8.3M bugzilla_data_20050422.sql
# Transport data to new bugzilla
rsync -avz -e ssh root@old_bugzilla:/root/bugzilla_data_20050422.sql .
#Populate database
mysql bugs -uroot -p < bugzilla_data_20050422.sql
# Old database was missing a column in group_group_id named isbless, causing lots of errors:
Sanity check error:
Bad value 16 found in group_group_map.member_id
Looking at user and gourp info from the borwser, leasds to the following errors
mysql> show columns from group_group_map;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| member_id | mediumint(9) | | PRI | 0 | |
| grantor_id | mediumint(9) | | PRI | 0 | |
| grant_type | tinyint(4) | | PRI | 0 | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
mysql> select * from group_group_map where member_id=16;
+-----------+------------+------------+
| member_id | grantor_id | grant_type |
+-----------+------------+------------+
| 16 | 21 | 0 |
+-----------+------------+------------+
1 row in set (0.00 sec)
mysql bugs -uroot -p
mysql> ALTER TABLE group_group_map ADD `isbless` tinyint(4) NOT NULL default '0'
mysql> show columns from group_group_map;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| member_id | mediumint(9) | | PRI | 0 | |
| grantor_id | mediumint(9) | | PRI | 0 | |
| grant_type | tinyint(4) | | PRI | 0 | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
*** FIX ***
mysql bugs -uroot -p
mysql> ALTER TABLE group_group_map ADD `isbless` tinyint(4) NOT NULL default '0'
mysql> show columns from group_group_map;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| member_id | mediumint(9) | | PRI | 0 | |
| grantor_id | mediumint(9) | | PRI | 0 | |
| grant_type | tinyint(4) | | PRI | 0 | |
| isbless | tinyint(4) | | | 0 | |
+------------+--------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
# Setup replicaiton with old_bugzilla server
#-----------------------------------------------
# On old_bugzilla there is no my.cnf
#-----------------------------------------------
mysql mysql -uroot -p
mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%.msli.com' IDENTIFIED BY 'slavepass';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT SUPER,RELOAD,SELECT ON *.* TO 'repl'@'%.msli.com' IDENTIFIED BY 'slavepass';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
#-----------------------------------------------
# On new_bugzilla server my.cnf
#-----------------------------------------------
/etc/mysql/my.cnf
# Replication
server-id = 2
log-bin = /var/log/mysql/mysql-bin.log
master-host = old_bugzilla
master-user = repl
master-password = 'slave'
replicate-do-db = 'bugs.*'
log-warnings
# To get replicaiton working, I have to wait for a quiet night,
# On the master
mysql> FLUSH TABLES WITH READ LOCK ;
mysql> exit;
mysqldump bugs -uroot -p --lock-tables > bugzilla_data_20050426.1831.sql
mysql> SHOW MASTER STATUS ;
+---------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+---------------------+----------+--------------+------------------+
| bugzilla-bin.000001 | 129508 | | |
+---------------------+----------+--------------+------------------+
mysql> UNLOCK TABLES ;
# From the slave:
rsync -avz -e ssh root@bugzilla.msli.com:/root/bugzilla_data_20050426.1831.sql
# Ditch the old tables from new bugzilla install
mysqladmin -uroot -p drop bugs
cd /var/www/bugzilla-2.18
rm -rf data/versioncache*
./checkconfig.pl
mysql bugs -uroot -p < /root/bugzilla_data_20050426.1831.sql
mysql bugs -uroot -p < bugzilla_data_20050426.1252.sql
mysql bugs -uroot -p
mysql> ALTER TABLE group_group_map ADD `isbless` tinyint(4) NOT NULL default '0' ;
rm -rf /var/lib/mysql/master.info*
rm -rf /var/lib/mysql/relay-log.info
mysql> SHOW PROCESSLIST ;
mysql> LOAD DATA FROM MASTER;
mysql> show master status;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000038 | 8785397 | | |
+------------------+----------+--------------+------------------+
mysql> START SLAVE;
mysql> SHOW PROCESSLIST ;
+-----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------+------------------+
| 152 | root | localhost | bugs | Query | 0 | NULL | SHOW PROCESSLIST |
| 153 | system user | | NULL | Connect | 74 | Waiting for master to send event | NULL |
| 154 | system user | | NULL | Connect | 73 | Has read all relay log; waiting for the slave I/O thread to update it | NULL |
+-----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------+------------------+
# Is it working?
# The Time column of the 'SHOW PROCESSLIST;' is number of seconds since the last replication with the MASTER.
# On the master:
mysql> FLUSH TABLES WITH READ LOCK ;
mysql> SHOW MASTER STATUS ;
# Position was: 142574
# On the slave:
mysql> SELECT MASTER_POS_WAIT('bugzilla-bin.000001', 142574);
# On the master
mysql> UNLOCK TABLES
#######################
## This doesn't belong here. i did it ablve.
######################
#Back on old_bugzilla again:
mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'new_bugzilla' IDENTIFIED BY 'slave';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT SUPER,RELOAD,SELECT ON *.* TO 'repl'@'new_bugzilla' IDENTIFIED BY 'slave';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
#Back on new_bugzilla again:
mysql> LOAD DATA FROM MASTER;
Query OK, 0 rows affected (0.81 sec)
Modify /etc/bugzilla/localconfig
/usr/share/bugzilla/lib/checksetup.pl
mysql> show slave status;
--------------------------------------------------------------------
Database problem:
The old bugzilla, debian package bugzilla, and bugzilla.org-relase all have different schema!
What the hay!
---------------------------------------------------------------------
Debian testing (SARGE) old_bugzilla new_bugzilla
--------------------- --------------------- ---------------------
mysql> show tables; mysql> show tables; mysql> show tables;
+-------------------+ +--------------------+ +--------------------+
| Tables_in_bugs | | Tables_in_bugs | | Tables_in_bugs |
+-------------------+ +--------------------+ +--------------------+
| attachments | | attachments | | attachments |
| attachstatusdefs |
| attachstatuses |
| bug_group_map | | bug_group_map |
| bugs | | bugs | | bugs |
| bugs_activity | | bugs_activity | | bugs_activity |
| category_group_map | | category_group_map |
| cc | | cc | | cc |
| classifications |
| components | | components | | components |
| dependencies | | dependencies | | dependencies |
| duplicates | | duplicates | | duplicates |
| fielddefs | | fielddefs | | fielddefs |
| flagexclusions | | flagexclusions |
| flaginclusions | | flaginclusions |
| flags | | flags |
| flagtypes | | flagtypes |
| group_control_map | | group_control_map |
| group_group_map | | group_group_map |
| groups | | groups | | groups |
| keyworddefs | | keyworddefs | | keyworddefs |
| keywords | | keywords | | keywords |
| logincookies | | logincookies | | logincookies |
| longdescs | | longdescs | | longdescs |
| milestones | | milestones | | milestones |
| namedqueries | | namedqueries | | namedqueries |
| products | | products | | products |
| profiles | | profiles | | profiles |
| profiles_activity | | profiles_activity | | profiles_activity |
| quips | | quips |
| series | | series |
| series_categories | | series_categories |
| series_data | | series_data |
| shadowlog |
| tokens | | tokens | | tokens |
| user_group_map | | user_group_map |
| versions | | versions | | versions |
| votes | | votes | | votes |
| watch | | watch | | watch |
+-------------------+ | whine_events | +--------------------+
| whine_queries |
| whine_schedules |
+--------------------+
---------------------------------------
Tools:
/var/www/bugzilla-2.18/checksetup.pl
Fires off debian-init.pl
Fires off globals.pl
installs .htaccess files in every directory
Removes /var/cache/bugzilla
Old script Looks in templates in templates/{custom,extention,default}
New script Looks for templates in /var/bugzilla/lib/template/en/custom
/usr/share/bugzilla/template/en/default
# Can be evil.
# cause we have different table defs
# It will:
# - check for required perl modules
# - set defaults for local configuration variables
# - create and populate the data directory after installation
# - set the proper rights for the *.cgi, *.html ... etc files
# - check if the code can access MySQL
# - creates the database 'bugs' if the database does not exist
# - creates the tables inside the database if they don't exist
# - automatically changes the table definitions of older BugZilla
# installations
# - populates the groups
# - put the first user into all groups so that the system can
# be administrated
# - changes already existing SQL tables if you change your local
# settings, e.g. when you add a new platform
#
===================================================
ALTER TABLE group_group_map ADD `isbless` tinyint(4) NOT NULL default '0'
#Install phpMyadmin
#----------------------------------
# Download and unpack
#----------------------------------
wget http://nchc.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.6.2.tar.gz
cd /var/www/
tar -zxpvf /root/phpMyAdmin-2.6.2.tar.gz
cd phpMyAdmin-2.6.2/
#----------------------------------
# Edit config
#----------------------------------
vi config.inc.php
$cfg['PmaAbsoluteUri'] = 'http://subversion01.msli.com/phpMyAdmin';
#----------------------------------
# Setup the htaccess file
#----------------------------------
vi .htaccess
AuthUserFile /etc/apache2/phpMyAdmin.passwd
AuthName phpMyAdmin
AuthType Basic
require user johns@meyersound.com #<-- this can be "user " or "group "
#----------------------------------
# Create apacheConfig:
#----------------------------------
HTTP-AUTH (in a
.htaccess file). See the multi-user sub-section of the FAQ for
additional information, especially FAQ 4.4.
vi /etc/apache2/conf.d/phpMyAdmin.conf
#################################################
# -BEGIN- Custom Config for phpMyAdmin #
#################################################
Alias /phpMyAdmin "/usr/local/httpd/htdocs/phpMyAdmin"
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch +Includes +ExecCGI
Order allow,deny
Allow from all
Order deny,allow
Deny from all
#################################################
# -END- Custom Config for phpMyAdmin #
#################################################
---------------------------------------
# Install scmbug (bugzilla svn integration)
mkdir svn_SCUMBUG_0-6-0
cd svn_SCUMBUG_0-6-0/
wget http://www.public.asu.edu/~makrists/scmbug/SCMBUG_RELEASE_0-6-0/ChangeLog_RELEASE_0-6-0
wget http://www.public.asu.edu/~makrists/scmbug/SCMBUG_RELEASE_0-6-0/SCMBUG_RELEASE_0-6-0.tar.gz
wget http://www.public.asu.edu/~makrists/scmbug/SCMBUG_RELEASE_0-6-0/scmbug-common_0.6.0_all.deb
wget http://www.public.asu.edu/~makrists/scmbug/SCMBUG_RELEASE_0-6-0/scmbug-doc_0.6.0_all.deb
wget http://www.public.asu.edu/~makrists/scmbug/SCMBUG_RELEASE_0-6-0/scmbug-server_0.6.0_all.deb
wget http://www.public.asu.edu/~makrists/scmbug/SCMBUG_RELEASE_0-6-0/scmbug-tools_0.6.0_all.deb
---------------------------------------