Bugzilla安装指南(Windows)(转)

上一篇 / 下一篇  2008-11-05 09:30:41 / 个人分类:测试工具

Bugzilla安装指南(Windows

1.  准备
BugzillaWindows下的安装颇为复杂,所以有很多人写了安装指南。但是使用安装的时候发现每个指南写的都有缺陷。这里我仅仅是把我安装的过程记录下来,给大家一个参考。同时还列出了一些我觉得有帮助的参考文章和站点。
工欲善其事必先利其器,建议你在开始安装之前把所有需要的软件下载齐全,这样可以提高效率和成功率。Bugzilla所需的软件都是开源的,都可以从它们的官方网站上下载到(我个人不喜欢去华军软件园之类的下载网站上找,因为即不安全,找到的也不一定是最新的版本)。下面把所需东西和下载网站罗列一下:
n         MySQL4.1
http://dev.mysql.com/downloads/mysql
n         Perl  5.8.7.815
http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl
n         Perl模块
有两个简单的途径可以获得Bugzilla所需的Perl模块。一个是Bugzilla汉化项目整理的,收集的很全而且比较新,还有一个安装批处理程序,所以推荐大家用这个;另外一个是Bugzilla测试服务器,它也提供了完整的Perl模块集合,但是版本似乎比较老。第三条道路也是有的,但是需要自己去找然后再编译。对于像我一样不懂Perl德人来说是在复杂,因此不推荐大家这样做。
http://sourceforge.net/project/showfiles.php?group_id=75477
http://landfill.bugzilla.org/ppm/
n         Bugzilla2.20
http://www.bugzilla.org/download/
n         Bugzilla汉化包(2.20
http://sourceforge.net/project/showfiles.php?group_id=75477

2.  安装和配置MySQL
安装MySQL很简单,只要按照安装程序的提示一步一步的做就可以了,如果有问题可以到MySQL官方网站(http://dev.mysql.com/doc/)上查看在线手册。
接下来要配置MySQL。有些文章里写道需要手工修改root用户的密码,其实这一步在MySQL安装程序里就已经完成了(可能那些文档写的较早,MySQL的安装程序可能不太好用吧),因此不用再去设置。我们要新建一个Bug数据库和一个Bugzilla访问这个数据库的用户。操作如下:
C:\mysql\bin>mysql --user=root -p mysql
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 4.0.20a-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database <database_name>;
Query OK, 1 row affected (0.11 sec)
mysql> grant all privileges on <database_name>.* to '<user_name>'@'<server_name>' identified by '<password>';
Query OK, 0 rows affected (0.03 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
C:\mysql\bin>

3.  安装Perl及其模块
安装Perl也很容易,按照安装程序提示一步一步装就可以了。稍微复杂一点的是安装它的模块。不过有了Bugzilla汉化项目提供的批处理程序,这个步骤也非常简单了。大家只要记住一个简单的命令就可以了:
ppn install <module_name>
ppn uninstall <module_name>

4.  安装Bugzilla
把下载到压缩包解压到一个文件夹,然后运行Bugzilla的安装检查程序(CheckSetup.pl)。它会自动验证是不是安装了必须的软件。如果没有什么问题它会在Bugzilla目录里生成一个localconfig文件(没有扩展名)。
用文本编辑器打开localconfig文件,找到下面两段文字。$db_host表示服务器名称,$db_name表示数据库名称,$db_user表示登录用户名,$db_pass表示密码。修改这几个值并保存。
#
# How to access theSQLdatabase:
#
$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
#
# 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 (\)
# (Far simpler just not to use those characters.)
#
$db_pass = 'bugs@agfa';
再次运行Bugzilla的安装检查程序(CheckSetup.pl)。这时如果正常它将初始化数据库结构和Demo数据。不过不要高兴得太早,可能会出现“Client does not support authentication protocol requested by server……”错误信息。这个问题整整困扰了我一个上午,幸亏后来找到Byron Jones写的《Installing Bugzilla on Microsoft Windows》。产生这个错误是因为MySQL 4.1及以后的版本使用了新的密码加密算法,而使用的PerlDBD::MySql模块不够新,不支持新的加密算法。你可以采取两种方式来解决这个问题:一是使用新的DBD::MySql模块,不过需要自己编译;另一种是在MySQL中强制使用兼容老版本的密码加密算法:
C:\mysql\bin>mysql --user=root -p mysql
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 4.1.11-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> set password for '<user_name>'@'<server_name>' = OLD_PASSWORD ('<password>');
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
C:\mysql\bin>
5.  配置IIS
打开IIS管理界面。新建一个虚拟路径,指向Bugzilla所在文件夹。
然后按应用程序设置按钮。增加一个映射,将.cgi文件映射到perl.exe。这里特别注意,有些文档里写成:perl.exe “%s” %s,这样不正确,在运行时出错(又花去一个小时)。正确的配置应该如下:
<perl完整路径>\perl.exe -x<Bugzilla完整路径> -wT "%s" %s
例如:
c:\perl\bin\perl.exe -xc:\bugzilla -wT "%s" %s


最后,将index.cgi加入到默认文档列表中。最好移到最前面,这样可以加快查询速度。如果不希望/不能把index.cgi加入到默认文档列表中,也可以在安装Bugzilla的时候,将localconfig文件中$index_html的值改为1。这样运行checksetup.pl时,就会生成一个index.html,自动重定向到index.cgi。
#
# With the introduction of a configurable index page using the
# template toolkit, Bugzilla's main index page is now index.cgi.
# Most web servers will allow you to use index.cgi as a directory
# index, and many come preconfigured that way, but if yours doesn't
# then you'll need an index.html file that provides redirection
# to index.cgi. Setting $index_html to 1 below will allow
# checksetup.pl to create one for you if it doesn't exist.
# NOTE: checksetup.pl will not replace an existing file, so if you
#       wish to have checksetup.pl create one for you, you must
#       make sure that index.html doesn't already exist
$index_html = 1;

6.  配置Bugzilla
不想多写了,在浏览器中打开http://localhost/bugzilla(根据你的具体情况而定)。如果你的Bugzilla是第一次使用,它会自动转向到Setup页面,按部就班的做就可以了。

7.  汉化Bugzilla
最后要做的就是汉化了,不过你不想汉化也没有问题。将汉化包解压解压到cn文件夹,将整个文件目录 cn 拷贝至 Bugzilla 的子目录 template下;然后以管理员身份登录Bugzilla,点击页脚的 Parameters(系统参数设置)链接,将 languages 一项的值改为 cn,保存,则以后见到的Bugzilla页面就是汉语页面了。如果想返回英文界面,将 cn 改回 en 即可。
为保证向后兼容,汉化的文件全部存为 UTF-8 格式。但不管你是否汉化Bugzilla,为强迫Bugzilla采用UTF-8来处理字符串,避免Bugzilla偶然出现的乱码,强烈建议大家将文件 <Bugzilla安装目录>\Bugzilla\CGI.pm 的第55行改为 $self->charset('UTF-8')。

8.  总结
到这里,Bugzilla的安装就基本上搞定了。也许你已经发现了,这篇文档没有说明关于邮件的问题。这时因为我没有配置,不过按照Bugzilla文档的说明,它已经提供了内置的SMTP支持。可是它不支持需要认证的SMTP,可以使用Glob's sendmail wrapper来解决。

9.  参考
Bugzilla官方网站http://www.bugzilla.org
Bugzilla汉化项目http://sourceforge.net/projects/bugzilla-cn
http://cosoft.org.cn/projects/bugzillchinese/
Perl官方网站http://www.perl.com
ActivePerl官方网站http://www.activestate.com/Products/ActivePerl
MySQL官方网站http://www.mysql.com
Fake Sendmait for Windows   http://www.glob.com.au/sendmail/
Installing Bugzilla on Microsoft Windows
http://www.bugzilla.org/docs/win32install.html
The Bugzilla Guidehttp://www.bugzilla.org/docs/2.20/html
Bugzilla windows安装红宝书http://blog.fz0132.com/trackback.asp?tbID=654

10. 附录
安装配置Bugzilla的工作清单
□下载Perl
□  下载Perl模块
□  下载MySQL
□  下载Bugzilla
□  下载Bugzilla汉化包
□  安装MySQL
□  生成Bug数据库
□  生成Bugzilla数据库用户并分配权限
□  安装Perl
□  安装Perl模块
□  解压Bugzilla压缩包
□  运行CheckSetup.pl检查安装
□  修改localconfig文件,设置数据库访问方式
□  再次运行CheckSetup.pl完成数据库初始化
□  修改Bugzilla数据库用户密码加密方式(视情况而定)
□  在IIS管理器中为Bugzilla建立虚拟路径
□  将.cgi文件映射到perl.exe
□  将index.cgi加入到默认文档列表中(可选)
□  配置Bugzilla
□  汉化Bugzilla

TAG: 测试工具

 

评分:0

我来说两句

Open Toolbar