Bugzilla是用于软件缺陷追踪的网络应用程序。
简单介绍一下我的测试环境:系统为CentOS 5.4 ,使用系统自带的 Apache、MySQL 。整个安装过程使用 root 用户进行操作。
用yum安装mysql-server、mysql-devel、gd-devel、mod_perl-devel、ImageMagick-devel、ImageMagick-perl 。当然,并非只依赖这几个包,不过安装这几个包就能通过依赖关系把其他相关的包一起安装完。
yum install mysql-server mysql-devel gd-devel mod_perl-devel ImageMagick-devel ImageMagick-perl
# 解压源代码包:
tar -xvzf bugzilla-3.2.5.tar.gz -C /usr/local/src/
cd /usr/local/src/bugzilla-3.2.5/
# 进行安装检测
./checksetup.pl --check-modules
* This is Bugzilla 3.2.5 on perl 5.8.8
* Running on Linux 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009
Checking perl modules...
Checking for CGI.pm (v3.21) found v3.15
Checking for TimeDate (v2.21) not found
Checking for PathTools (v0.84) ok: found v3.12
Checking for DBI (v1.41) ok: found v1.52
Checking for Template-Toolkit (v2.15) not found
Checking for Email-Send (v2.00) not found
Checking for Email-MIME (v1.861) not found
Checking for Email-MIME-Encodings (v1.313) not found
Checking for Email-MIME-Modifier (v1.442) not found
Checking available perl DBD modules...
Checking for DBD-Pg (v1.45) not found
Checking for DBD-mysql (v4.00) found v3.0007
Checking for DBD-Oracle (v1.19) not found
The following Perl modules are optional:
Checking for GD (v1.20) not found
Checking for Chart (v1.0) not found
Checking for Template-GD (any) not found
Checking for GDTextUtil (any) not found
Checking for GDGraph (any) not found
Checking for XML-Twig (any) not found
Checking for MIME-tools (v5.406) not found
Checking for libwww-perl (any) not found
Checking for PatchReader (v0.9.4) not found
Checking for PerlMagick (any) ok: found v6.2.8
Checking for perl-ldap (any) not found
Checking for Authen-SASL (any) not found
Checking for RadiusPerl (any) not found
Checking for SOAP-Lite (any) not found
Checking for HTML-Parser (v3.40) not found
Checking for HTML-Scrubber (any) not found
Checking for Email-MIME-Attachment-Stripper (any) not found
Checking for Email-Reply (any) not found
Checking for mod_perl (v1.999022) ok: found v2.000004
***********************************************************************
* REQUIRED MODULES *
***********************************************************************
* Bugzilla requires you to install some Perl modules which are either *
* missing from your system, or the version on your system is too old. *
* *
* The latest versions of each module can be installed by running the *
* commands below. *
***********************************************************************
COMMANDS:
/usr/bin/perl install-module.pl CGI
/usr/bin/perl install-module.pl Date::Format
/usr/bin/perl install-module.pl Template
/usr/bin/perl install-module.pl Email::Send
/usr/bin/perl install-module.pl Email::MIME
/usr/bin/perl install-module.pl Email::MIME::Encodings
/usr/bin/perl install-module.pl Email::MIME::Modifier
***********************************************************************
* DATABASE ACCESS *
***********************************************************************
* In order to access your database, Bugzilla requires that the *
* correct "DBD" module be installed for the database that you are *
* running. *
* *
* Pick and run the correct command below for the database that you *
* plan to use with Bugzilla. *
***********************************************************************
COMMANDS:
PostgreSQL: /usr/bin/perl install-module.pl DBD::Pg
Minimum version required: 1.45
MySQL: /usr/bin/perl install-module.pl DBD::mysql
Minimum version required: 4.00
Oracle: /usr/bin/perl install-module.pl DBD::Oracle
Minimum version required: 1.19
**********************************************************************
* 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) *
***********************************************************************
* GD * Graphical Reports, New Charts, Old Charts *
* Chart * New Charts, Old Charts *
* Template-GD * Graphical Reports *
* GDTextUtil * Graphical Reports *
* GDGraph * Graphical Reports *
* XML-Twig * Move Bugs Between Installations *
* MIME-tools * Move Bugs Between Installations *
* libwww-perl * Automatic Update Notifications *
* PatchReader * Patch Viewer *
* perl-ldap * LDAP Authentication *
* Authen-SASL * SMTP Authentication *
* RadiusPerl * RADIUS Authentication *
* SOAP-Lite * XML-RPC Interface *
* HTML-Parser * More HTML in Product/Group Descriptions *
* HTML-Scrubber * More HTML in Product/Group Descriptions *
* Email-MIME-Attachment-Stripper * Inbound Email *
* Email-Reply * Inbound Email *
***********************************************************************
COMMANDS TO INSTALL:
GD: /usr/bin/perl install-module.pl GD
Chart: /usr/bin/perl install-module.pl Chart::Base
Template-GD: /usr/bin/perl install-module.pl Template::Plugin::GD::Image
GDTextUtil: /usr/bin/perl install-module.pl GD::Text
GDGraph: /usr/bin/perl install-module.pl GD::Graph
XML-Twig: /usr/bin/perl install-module.pl XML::Twig
MIME-tools: /usr/bin/perl install-module.pl MIME::Parser
libwww-perl: /usr/bin/perl install-module.pl LWP::UserAgent
PatchReader: /usr/bin/perl install-module.pl PatchReader
perl-ldap: /usr/bin/perl install-module.pl Net::LDAP
Authen-SASL: /usr/bin/perl install-module.pl Authen::SASL
RadiusPerl: /usr/bin/perl install-module.pl Authen::Radius
SOAP-Lite: /usr/bin/perl install-module.pl SOAP::Lite
HTML-Parser: /usr/bin/perl install-module.pl HTML::Parser
HTML-Scrubber: /usr/bin/perl install-module.pl HTML::Scrubber
Email-MIME-Attachment-Stripper: /usr/bin/perl install-module.pl Email::MIME::Attachment::Stripper
Email-Reply: /usr/bin/perl install-module.pl Email::Reply
To attempt an automatic install of every required and optional module
with one command, do:
/usr/bin/perl install-module.pl --all
从上面信息可以看出,缺少很多 perl 模块……
# 安装缺少的 Perl 模块
/usr/bin/perl install-module.pl --all
这里需要连网……你也可以下载我提供的包,在文章后面会给出链接。
安装到一定时候会提示:
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies...
[Core Features]
- Test::More ...loaded. (0.94)
- Mail::Header ...missing. (would need 1.01)
- Mail::Internet ...missing. (would need 1.0203)
- Mail::Field ...missing. (would need 1.05)
- MIME::Base64 ...loaded. (3.07 >= 2.2)
- IO::File ...loaded. (1.13 >= 1.13)
- IO::Handle ...loaded. (1.25)
- IO::Stringy ...missing. (would need 2.11)
- File::Spec ...loaded. (3.12 >= 0.6)
- File::Path ...loaded. (1.08 >= 1)
- File::Temp ...missing. (would need 0.18)
==> Auto-install the 5 mandatory module(s) from CPAN? [y]
从这里开始需要按回车确认一些东西,直到出现下面提示:
First, pick a nearby continent and country (you can pick several of
each, separated by spaces, or none if you just want to keep your
existing selections). Then, you will be presented with a list of URLs
of CPAN mirrors in the countries you selected, along with previously
selected URLs. Select some of those URLs, or just keep the old list.
Finally, you will be prompted for any extra URLs -- file:, ftp:, or
http: -- that host a CPAN mirror.
(1) Africa
(2) Asia
(3) Australasia
(4) Central America
(5) Europe
(6) North America
(7) Oceania
(8) South America
Select your continent (or several nearby continents) [] 2
Sorry! since you don't have any existing picks, you must make a
geographic selection.
(1) China
(2) Hong Kong
(3) India
(4) Indonesia
(5) Japan
(6) Kazakhstan
(7) Republic of Korea
(8) Russia
(9) Singapore
(10) Taiwan
(11) Thailand
(12) Turkey
Select your country (or several nearby countries) [] 1
Sorry! since you don't have any existing picks, you must make a
geographic selection.
(1) http://cpan.wenzk.com/
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. '1 4 5' [] 1
以上几个需要手动输入,后面再碰到需要确认的东西直接回车确认即可。
# 第二次检测,其实这个意义不大……
./checksetup.pl --check-modules
* This is Bugzilla 3.2.5 on perl 5.8.8
* Running on Linux 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009
Checking perl modules...
Checking for CGI.pm (v3.21) ok: found v3.48
Checking for TimeDate (v2.21) ok: found v2.23
Checking for PathTools (v0.84) ok: found v3.12
Checking for DBI (v1.41) ok: found v1.52
Checking for Template-Toolkit (v2.15) ok: found v2.22
Checking for Email-Send (v2.00) ok: found v2.198
Checking for Email-MIME (v1.861) ok: found v1.902
Checking for Email-MIME-Encodings (v1.313) ok: found v1.313
Checking for Email-MIME-Modifier (v1.442) ok: found v1.902
Checking available perl DBD modules...
Checking for DBD-Pg (v1.45) not found
Checking for DBD-mysql (v4.00) ok: found v4.013
Checking for DBD-Oracle (v1.19) not found
The following Perl modules are optional:
Checking for GD (v1.20) ok: found v2.44
Checking for Chart (v1.0) ok: found v2.4.1
Checking for Template-GD (any) ok: found v1.56
Checking for GDTextUtil (any) ok: found v0.86
Checking for GDGraph (any) ok: found v1.44
Checking for XML-Twig (any) ok: found v3.32
Checking for MIME-tools (v5.406) ok: found v5.427
Checking for libwww-perl (any) ok: found v5.834
Checking for PatchReader (v0.9.4) ok: found v0.9.5
Checking for PerlMagick (any) ok: found v6.2.8
Checking for perl-ldap (any) ok: found v0.39
Checking for Authen-SASL (any) ok: found v2.13
Checking for RadiusPerl (any) ok: found v0.15
Checking for SOAP-Lite (any) ok: found v0.710.10
Checking for HTML-Parser (v3.40) ok: found v3.64
Checking for HTML-Scrubber (any) ok: found v0.08
Checking for Email-MIME-Attachment-Stripper (any) ok: found v1.316
Checking for Email-Reply (any) ok: found v1.202
Checking for mod_perl (v1.999022) ok: found v2.000004
我们可以看到,所有模块都已经安装完成。
# 设置 MySQL 数据库
在 /etc/my.cnf 文件的 [mysqld] 中添加
# Allow packets up to 4MB
max_allowed_packet=4M
# Allow small words in full-text indexes
ft_min_word_len=2
注意,配置文件在修改后需要重启 MySQL 数据库服务。
# 创建数据库用户:
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY '密码';
mysql> FLUSH PRIVILEGES;
# 创建数据库:
mysql> create database bugs;
# 开始安装过程
./checksetup.pl
# 修改 localconfig 文件:
修改 /usr/local/src/bugzilla-3.2.5/localconfig 文件,在 $db_pass = ''; 中设置上面创建数据库用户时所设置的密码
# 开始安装:
./checksetup.pl
请在这一步执行之前启动 MySQL 数据库服务,因为需要往数据库中写入数据。
最后提示:
Looks like we don't have an administrator set up yet.
Either this is your first time using Bugzilla, or your
administrator's privileges might have accidentally been deleted.
Enter the e-mail address of the administrator: 输入邮箱,登录时将使用这个进行登录。
Enter the real name of the administrator:
Enter a password for the administrator account: 输入密码
Please retype the password to verify: 确认密码
# 创建一个软链接到 web 目录:
ln -s /usr/local/src/bugzilla-3.2.5 /var/www/html/bugzilla
# 修改 Apache 的配置文件 /etc/httpd/conf/httpd.conf :
cat >> /etc/httpd/conf/httpd.conf << "EOF"
# BugZilla
Alias /bugzilla/ "/var/www/html/bugzilla/"
<Directory "/var/www/html/bugzilla/">;
AddHandler cgi-script .cgi
Options +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit
</Directory>
EOF
# 调整数据库:
mysql> use bugs
mysql> ALTER TABLE attachments AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;
# 访问你的 BugZilla 吧~
访问之前当然要先启动你的 Apache 服务,浏览器访问 http://IP地址/bugzilla/ 就能看到你的 BugZilla 页面了~
关于前面提到的CPAN的包,下载地址为:http://cid-bace553dcea1dbb1.skydrive.live.com/self.aspx/Blog%e7%9b%b8%e5%85%b3%e6%96%87%e4%bb%b6/bugzilla%5E_cpan.tar.bz2
由于我整个安装过程都使用的 root 用户,这个包直接解压到 /root/ 目录即可,在安装过程中就不需要联网下载软件包了。


