Bugzilla Manual
一、安装Bugzilla
1. linux环境
#cat /etc/issue
Red Hat Enterprise Linux AS release 4 (Nahant Update 4) |
2. 管理员登录
以管理员root账号登录
3. 公网配置DNS
A记录
scm6.***.cn -> ***.51.173.92 |
#nslookup scm6.***.cn
4. 配置time
#crontab -e
0 21 * * * /usr/sbin/ntpdate 10.1.56.203 |
5. 配置iptables
#vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-securitylevel # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #scm1.***.cn -A RH-Firewall-1-INPUT -s ***.51.173.20 -j ACCEPT #scm2.***.cn -A RH-Firewall-1-INPUT -s ***.51.173.21 -j ACCEPT #scm4.***.cn -A RH-Firewall-1-INPUT -s ***.51.173.23 -j ACCEPT #scm3.***.cn -A RH-Firewall-1-INPUT -s ***.51.173.22 -j ACCEPT #scm6.***.cn -A RH-Firewall-1-INPUT -s ***.51.173.92 -j ACCEPT #scm7.***.cn -A RH-Firewall-1-INPUT -s ***.51.173.94 -j ACCEPT #ruanjianyuan bangongqu -A RH-Firewall-1-INPUT -s ***.51.173.153 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.154 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.155 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.156 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.157 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.158 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.160 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.165 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.166 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.167 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.168 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.169 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.170 -j ACCEPT #ruanjianyuan bangongqu xianzhi daikuan -A RH-Firewall-1-INPUT -s ***.51.173.159 -j ACCEPT #project.***.cn -A RH-Firewall-1-INPUT -s ***.157.98.58 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.157.98.68 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.157.98.62 -j ACCEPT #huilongsen bangongqu -A RH-Firewall-1-INPUT -s ***.249.75.106 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.249.75.107 -j ACCEPT #yizhuang wangtong idc -A RH-Firewall-1-INPUT -s 10.1.0.0/255.255.0.0 -j ACCEPT #yizhuang wangtong idc bangongqu -A RH-Firewall-1-INPUT -s ***.51.173.56 -j ACCEPT #openvpn -A RH-Firewall-1-INPUT -s 192.168.0.0/255.255.0.0 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.10.72.132 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.10.72.133 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.51.173.81 -j ACCEPT #shanghai bangongqu -A RH-Firewall-1-INPUT -s ***.160.165.70 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.160.165.71 -j ACCEPT -A RH-Firewall-1-INPUT -s ***.160.165.66 -j ACCEPT #guangzhou bangongqu -A RH-Firewall-1-INPUT -s ***.62.144.226 -j ACCEPT #shenzhen bangongqu -A RH-Firewall-1-INPUT -s ***.15.143.145 -j ACCEPT #guangzhou idc bangongqu -A RH-Firewall-1-INPUT -s ***.14.9.141 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited COMMIT |
6. 本机配置hosts
#vi /etc/hosts
增加如下行
***.51.173.92 scm6.***.cn hgfi |
7. 关闭selinux
#vi /etc/selinux/config
修改如下行
SELINUX=disabled |
#reboot
8. 安装mysql
#rpm -ivh perl-DBD-MySQL-2.9004-3.1.i386.rpm
#rpm -ivh mysql-bench-4.1.20-1.RHEL4.1.i386.rpm
#rpm -ivh mysqlclient10-devel-3.23.58-4.RHEL4.1.i386.rpm
#rpm -ivh mysql-devel-4.1.20-1.RHEL4.1.i386.rpm
#rpm -ivh mysql-server-4.1.20-1.RHEL4.1.i386.rpm
9. 重启mysqld服务
#service mysqld restart
#chkconfig --add mysqld
#tail -f /var/log/mysqld.log
#mysql -u root mysql
mysql>update user set password=password('***') where user='root';
mysql>flush privileges;
mysql>quit
10. 安装bugzilla
#tar -zxvf bugzilla-2.20.2.tar.gz
#mv bugzilla-2.20.2/ /var/www/
11. 安装bugzilla汉化包
#unzip bugzilla-2.20-cn-1.0.zip -d bugzilla-2.20-cn-1.0
#cd bugzilla-2.20-cn-1.0
#unzip cn_GB2312.zip -d cn_GB2312
#cp -a cn_GB2312/ /var/www/bugzilla-2.20.2/template/cn
#vi /var/www/bugzilla-2.20.2/template/cn/default/admin/components/create.html.tmpl
<input type="hidden" name='nonopen_name' value='All Closed'> |
#vi /var/www/bugzilla-2.20.2/template/cn/default/global/field-descs.none.tmpl
"REMIND" => "需求变更", |
12. 安装gdlib-config
#tar -zxvf gd-2.0.28.tar.gz
#cd gd-2.0.28
#./configure --prefix=/usr/local/gd
#make
#make install
#cp -a /usr/local/gd/bin/gdlib-config /usr/bin/
#make uninstall
13. 配置bugzilla
#mysql -uroot -p***
mysql>GRANT SELECT, INSERT,
UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*
TO bugs@localhost IDENTIFIED BY 'bugs_pass';
mysql>FLUSH PRIVILEGES;
mysql>exit;
#cd /var/www/bugzilla-2.20.2/
#./checksetup.pl --check-modules
#./checksetup.pl
#mysql -uroot -p***
mysql>use bugs;
mysql>ALTER TABLE attachments
AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;
mysql>exit;
#vi localconfig
$db_driver = "mysql"; $db_host = 'localhost'; # where is the database? $db_name = 'bugs'; # name of the SQL database $db_user = 'bugs'; # user to attach to the SQL database $db_port = 0; $db_pass = 'bugs_pass'; $db_sock = ''; $db_check = 1; |
#./checksetup.pl
#vi /var/www/bugzilla-2.20.2/data/params
%param = ( … 'allowemailchange' => '1', … 'commentonclearresolution' => '1', 'commentonclose' => '1', … 'commentoncreate' => '1', 'commentonduplicate' => '1', 'commentonreassign' => '1', … 'commentonreopen' => '1', 'commentonresolve' => '1', … 'createemailregexp' => '', … 'defaultlanguage' => 'cn', … 'maintainer' => 'scm@***.cn', 'makeproductgroups' => '1', 'maxattachmentsize' => '1000', … 'maxpatchsize' => '1000', … 'quip_list_entry_control' => 'closed', … 'requirelogin' => '1', … 'showallproducts' => '0', … 'urlbase' => 'http://scm6.***.cn/bugzilla/', … 'useentrygroupdefault' => '1', … 'useqacontact' => '1', … 'usevisibilitygroups' => '1', 'usevotes' => '0', … |
#cp -a /var/www/bugzilla-2.20.2/ /var/www/bugzilla-2.20.2-en/
#vi /var/www/bugzilla-2.20.2/data/params
… 'defaultlanguage' => 'en', … 'urlbase' => 'http://scm6.***.cn/bugzilla-en/', … |
14. 配置httpd
#vi /etc/httpd/conf/httpd.conf
<VirtualHost ***.51.173.92> ServerName scm6.***.cn AddDefaultCharset GB18030 Alias /bugzilla "/var/www/bugzilla-2.20.2/" <Directory "/var/www/bugzilla-2.20.2/"> AddHandler cgi-script .cgi Options +Indexes +ExecCGI DirectoryIndex index.cgi AllowOverride Limit </Directory> Alias /bugzilla-en "/var/www/bugzilla-2.20.2-en/" <Directory "/var/www/bugzilla-2.20.2-en/"> AddHandler cgi-script .cgi Options +Indexes +ExecCGI DirectoryIndex index.cgi AllowOverride Limit </Directory> </VirtualHost> |
#./checksetup.pl
15. 启动httpd服务
#service httpd restart
#chkconfig --add httpd
#chkconfig --level 35 httpd on
#tail -f /var/log/httpd/error_log
16. 初始登陆
http://scm6.***.cn/bugzilla
账号:scm@***.cn
口令:***
17. 配置sendmail
#vi /etc/mail/sendmail.mc
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl |
#vi /etc/mail/local-host-names
scm6.***.cn |
#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
18. 启动sendmail服务
#service sendmail restart
#chkconfig --add sendmail
#chkconfig --level 35 sendmail on
#tail -f /var/log/maillog
#echo test | mail -s 'test' zbwangjian@***.cn
19. 配置账号维护脚本
#vi /bin2/w.sh
内容如下
#!/bin/sh export LC_ALL=zh_CN.GB18030 n0=`expr index $1 "@"` if [ $n0 = 0 ] then echo "***账号格式不对,请输入完整的mail地址***" exit fi n1=$1 n2=`echo ${n1##*@}` if [ "$n2" = "***.cn" ] then n3=`echo ${n1%%@*}` else n3=`echo ${n1/@/.}` fi echo ...bugzilla... ssh $LOGNAME@scm6.***.cn "mysql -u root -p*** -e "use bugs; update profiles set disabledtext = 'zx' where disabledtext like '' and login_name like '$n1'";" /bin/echo "$n1" | /usr/bin/mutt -s "logoff-user" scm-dept@scm5.***.cn |
二、维护Bugzilla
1. 备份
#service httpd stop
#mysqldump --opt -uroot -p*** bugs > bugs.sql
2. 恢复
#mysql -uroot -p***
mysql>drop database bugs;
mysql>create database bugs;
mysql>quit
#mysql -uroot -p*** bugs < bugs.sql
#cd /var/www/bugzilla-2.20.2/
#./checksetup.pl
#mysqlcheck -uroot -p*** --databases bugs
#mysql_fix_privilege_tables --password=***
#service httpd restart
http://zh.linuxvirtualserver.org/node/515
http://wiflish.javaeye.com/blog/307340
三、升级Bugzilla到3.4.3
1. Sanity Check
View the Sanity Check (Section 3.16) page on your installation before upgrading. Attempt to fix all warnings that the page produces before you go any further, or you may experience problems during your upgrade.
2. 备份
#service httpd stop
#sh /bin4/rsync-sys2.sh
#rm -f /var/lib/mysql.bak/bugs.sql
3. 安装bugzilla
#tar zxvf bugzilla-3.4.3.tar.gz
#mv bugzilla-3.4.3/ /var/www/
#cp /var/www/bugzilla-2.20.2/localconfig* /var/www/bugzilla-3.4.3/
#cp -r /var/www/bugzilla-2.20.2/data/ /var/www/bugzilla-3.4.3/
#cd /var/www/bugzilla-3.4.3/
#./checksetup.pl --check-modules
#./checksetup.pl
#/usr/bin/perl install-module.pl --all
#./checksetup.pl
#vi /var/www/bugzilla-3.4.3/data/params
'upgrade_notification' => 'disabled', |
#./checksetup.pl
#mysqldump --hex-blob --opt --default-character-set=latin1 -uroot -p*** bugs --ignore-table=bugs.attach_data > tmp/bugs.sql
#mysqldump --opt --default-character-set=latin1 -uroot -p*** bugs attach_data > tmp/bugs2.sql
#iconv -f gb2312 -t utf-8 -c tmp/bugs.sql -o tmp/bugs.sql.utf8
#sed -i "s/latin1/utf8/" tmp/bugs.sql.utf8
#sed -i "s/latin1/utf8/" tmp/bugs2.sql
#vi /etc/my.cnf
[client] default-character-set=utf8 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 default-character-set=utf8 init_connect='SET NAMES utf8' |
#service mysqld restart
#mysql -uroot -p***
mysql> show variables like 'char%';
mysql> show variables like '%collation%';
mysql>drop database bugs;
mysql>create database bugs;
mysql>quit
#mysql -uroot -p*** bugs < tmp/bugs.sql.utf8
#mysql -uroot -p*** bugs < tmp/bugs2.sql
mysql> show table status;
mysql> show full columns from attach_data;
#vi /var/www/bugzilla-3.4.3/data/params
'utf8' => '1', |
#./checksetup.pl
4. 安装bugzilla汉化包
#unzip bugzilla.zh-CN.3.4.3.r20091222.zip -d bugzilla.zh-CN.3.4.3.r20091222
#mv bugzilla.zh-CN.3.4.3.r20091222/zh-CN/ /var/www/bugzilla-3.4.3/template/
#vi /var/www/bugzilla-3.4.3/template/zh-CN/default/global/field-descs.none.tmpl
… "MOVED" => "已搬移 (MOVED)", "REMIND" => "需求变更 (REMIND)", "---" => "---", … |
#./checksetup.pl
#cp -a /var/www/bugzilla-3.4.3/ /var/www/bugzilla-3.4.3-en/
#rm -fr /var/www/bugzilla-3.4.3-en/template/zh-CN/
#vi /var/www/bugzilla-3.4.3/data/params
… 'urlbase' => 'http://scm6.***.cn/bugzilla/', … |
#./checksetup.pl
#vi /var/www/bugzilla-3.4.3-en/data/params
… 'urlbase' => 'http://scm6.***.cn/bugzilla-en/', … |
#./checksetup.pl
5. 配置httpd
#vi /etc/httpd/conf/httpd.conf
<VirtualHost ***.51.173.92> ServerName scm6.***.cn Alias /bugzilla "/var/www/bugzilla-3.4.3/" <Directory "/var/www/bugzilla-3.4.3/"> AddHandler cgi-script .cgi Options +Indexes +ExecCGI DirectoryIndex index.cgi AllowOverride Limit </Directory> Alias /bugzilla-en "/var/www/bugzilla-3.4.3-en/" <Directory "/var/www/bugzilla-3.4.3-en/"> AddHandler cgi-script .cgi Options +Indexes +ExecCGI DirectoryIndex index.cgi AllowOverride Limit </Directory> </VirtualHost> |
#./checksetup.pl
6. 启动httpd服务
#service httpd restart
7. Sanity Check
View the Sanity Check (Section 3.16) page in your upgraded Bugzilla.
http://www.itlearner.com/article/4384
ibdata1太大
http://hi.baidu.com/higkoo/blog/item/4d52f05241dab9050df3e3ce.html
mysql>UPDATE bugs SET lastdiffed = delta_ts WHERE lastdiffed < delta_ts;
http://bbs.phome.net/showthread-13-112450-0.html
http://www.diguodaxue.com/diguojiqiao/538.html
http://www.zhaopin.net.ru/list.php/id/438
http://blog.sina.com.cn/s/blog_5cf546320100jdwo.html
http://xoops.org.cn/modules/article/view.article.php/40
#tar zxvf Encode-Detect-1.01.tar.gz
#cd Encode-Detect-1.01
#perl Makefile.PL
#make;make install
http://bbs.chinaunix.net/viewthread.php?tid=817699
http://blog.csdn.net/huithe/archive/2010/01/16/5198100.aspx
http://zhidao.baidu.com/question/61561368
http://lovingtree.blog.163.com/blog/static/144853420078107182318/
http://fixunix.com/mozilla/412192-trouble-moving-utf-8-bugzilla-3-0-recode-pl-checksetup-pl.html
http://forums.mysql.com/read.php?108,145268,192173#msg-192173
http://140.128.161.101/student65/taxonomy/term/2?page=30
http://www.0djx.com/article/20100415/5966.html
http://www.lvseshidai.com/513.html
Bugzilla demo