BugzillaQ?版本 2.18 Q?a >http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-2.18.tar.gzQ?br />汉化包:2.18rc3-cn-0.9 Q?a >http://heanet.dl.sourceforge.net/sourceforge/bugzilla-cn/bugzilla-2.18rc3-cn-0.9.rarQ?不需?g不兼?/p>
My SQL DatabaseQ?版本 4.1.10 Q?a >http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-4.1.10-win32.zip/from/http://mysql.ihostunit.com/Q?/p>
ActivePerlQ版?5.8.6.811 Q?a >http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.6.811-MSWin32-x86-122208.msiQ?据说q个版本有bug,但是g也没什么大?
Perl ModulesQ(http://landfill.bugzilla.org/ppmQ?/p>
sendmailQ(http://download.ebugs.org/download/bugzilla/mailer.rarQ?/p>
ApacheQ版?2.0.53 Q?a >http://archive.apache.org/dist/httpd/binaries/win32/apache_2.0.53-win32-x86-no_ssl.msiQ?/p>
二、相兌Y件的安装
安装mysql?br />Mysql默认安装到C:\Mysql是一个很不错的主意,因ؓ在Bugzilla的Checksetup.pl中默认Mysql安装在C:\mysqlQ如果您安装C其他目录Q那么安装时需要对该文件进行手工修改,指定Mysql的安装\径。对于Mysql的安装,一路点M一步即可?br />安装完成后,手动q行C:\mysql\bin\winmysqladmin.exe文gQ它会自动将mysql数据库注册ؓ服务q启动。此操作仅需q行一ơ,因ؓMysql注册的服务ؓ自动cdQ所以每ơ计机启动时均会自动运行?br />然后Q我们需要mysql中创建Bugzilla的用户以及数据库Q主要三条命令ؓQ?
a、徏立数据库bugs
create database bugs;
b、徏立用户bugsQ密码ؓI,对Bugs数据库具有一定权?
GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE, LOCK TABLES,DROP,REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY '';
c、从 mysql 数据库授权表中重新装载权限?
FLUSH PRIVILEGES
执行q程如下图:Q这里我们徏立的数据库名为BugsQ数据库用户名ؓBugsQ密码ؓI)
1.
注意Q刚刚徏立的数据库的用户为rootQ没有密码,你可以安装mysqlcc在图形界面中更改密码Q也可以使用SQL语句“UPDATE user SET password = password('new_password') WHERE user = 'root';”来更改密码?
安装Activeperl?br />Activeperl的安装很单,一路点击Next卛_Q它会自动安装到C:\perl目录。同时在pȝ变量Path中增加自q C:\perl\bin路径信息?
Apache的配|?br />对于 Apache 服务器,此步骤稍微复杂一点,需要手工配|文本文ӞC:\Program Files\Apache Group\Apache2\conf\httpd.conf
1、增?cgi ?pl 的执行,只需要在配置文g中增加如下二?br />AddHandler cgi-script .cgi
AddHandler cgi-script .pl
2、增加默认文档,在文档中查找DirectoryIndex index.html index.html.var一行,在后面添加index.cgiQ即更改为:DirectoryIndex index.html index.html.var index.cgi
3、增加虚拟目录映,q设|目录权限。增加下列几行,q里默认Bugzilla文g目录位于C:\BuzillaQ别名ؓbugzillaQ注意:在配|文件中是用?”而不是“\?br />Alias /bugzilla "D:/Bugzilla/"
<Directory "D:/Bugzilla/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
#
# Tell Apache to use Perl to execute .cgi
#
ScriptInterpreterSource Registry-Strict
</Directory>
AddHandler cgi-script .cgi
DirectoryIndex index.html index.html.var index.cgi
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
#CustomLog logs/access.log common
讄完成后,重新启动 Apache 服务器设|即可生效?/p>
Perl脚本的安装以及Bugzilla的初步配|?br />Bugzilla为我们准备了一个很好的脚本文gchecksetup.pl来进行配|,我们随时可以q行chekcsetup.pl文g来进行服务器配置而不会对Bugzillapȝ造成M影响?br />q行该脚本的Ҏ是,在命令行下进入Bugzilla的主目录Q键入:perl checksetup.plQ运行后Q该脚本会给出系l所~的各种元素乃至获取办法?br />初次q行的时候,pȝ首先会验证perl模块是否_Q一般会~少比较多的perl模块。如果我们是单独下蝲的每个perl模块q行安装Q则需要用ppm install <perl模块?ppd> q行?br />如果是用本文中所提供的压~包q行安装的,那么一切变得很单,只需要双击运行Install.bat文gQ此批处理文件会自动调用ppm安装好运行所需要的perl模块?/p>
当插件安装完后,再次q行perl checksetup.plQ系l会生成localconfig文gQ此文g是包含了Bugzilla的一些配|信息,如果您的mysql安装到C:\mysqlQ所创徏的数据库名称为bugs 数据库用户ؓbugsQ密码ؓI,那么不需要对localconfig文gq行M修改Q否则需要对localconfig的相应条目进行修攏V?br />修改好localconfig文gQ再ơ运?perl checksetup.plQ如果不出意外的话,会顺利编译模板,然后建立数据库,最后提C入超U用户信、用户姓名以及口令。输入后QBugzilla 基本安装完成Q可以从 web 上来q行讉K了?/p>
让Bugzilla界面q行hQ?br />当我们?web 面览http://127.0.0.1/bugzilla/Ӟ意外的发现出错了?br />如果?IIS Q可能的信息为:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Can't open perl script "C:\bugzilla\index.cgi": Permission denied
如果?Apache Q可能的错误信息为标准的 500 号内部错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
More information about this error may be available in the server error log.
?
Apache/2.0.48 (Win32) Server at 127.0.0.1 Port 80>
虽然提示信息不同Q但是二者出错原因是cM的,对于IISQ是因ؓperl脚本的第一句中不支?-wT 参数Q将所有的 -wT 替换?-w 卛_
卻I?#!/usr/bin/perl –wT 替换为:?#!/usr/bin/perl –w
对于Apache服务器,是因为Apache找不到perl文g的\径,因此?cgi?pl的顶部的perl路径?use/bin/perl 替换成C:/perl/bin/perl卛_?br />卻I?#!/usr/bin/perl 替换为:#!C:/perl/bin/perl
作ؓ一个通用的解x法,可以所有的#!/usr/bin/perl –wT?!/usr/bin/perl –w替换?!C:/perl/bin/perl
修改后,再次览http://127.0.0.1/bugzilla/QOKQ我们可以看到Bugzilla的主界面了?
实现Bugzilla的Email发送功能?br />因ؓBugzilla更大E度是基于unix的,其发送邮仉分功能是直接调用unix下的sendmail来实现的Q这q在windows下运行造成了很大难度。对此,Bugzilla的官Ҏ档给出的办法是将Sendmail部分用perl的Net::Smtp模块来代ѝ但是在最新的Bugzilla版本中,一共有11个文仉要修改,且各C码修Ҏ式均有所不同Q且目前大部分smtp服务器均需要认证才能发信,信密码写在程序源码中毕竟不是一个好办法Q基于以上种U原因,我们自己~程实现了windows下的 sendmailQ基本能够完成unix下sendmail的功能。我们需要做的是用新sendmail的\径替换旧有的sendmail路径可以了?
如:sendmail位于bugzilla目录下的mailer目录下,我们可以用“|Mailer/sendmail”替换“|/usr/lib/sendmail”?br />除此以外Q还要将contrib\bug_email.pl中的“| /usr/sbin/sendmail”替换成“|Mailer/sendmail”, contrib\mysqld-watcher.pl 中的?usr/lib/sendmail”替换成“Mailer/sendmail?
替换完成后,我们要运行BugMailer.exeq行配置Q输入SMTP服务器的地址、端口号以及发信认证相关信息可以了。配|后Q会在当前目录生配|文件BugMailer.iniQ当发送邮件时Q如果生错误,详细信息会生在当前目录的BugMailer.log文g中?
对于BugzillaQ还?个文件ƈ不是使用配置中所输入的信p行发信的Q而是使用了固定的用户“bugzilla-admin-daemon”、“bugzilla-request-daemon”来q行发送,而某些需要SMTP认证的邮件服务器是不允许验证用户使用其他人的名称q行发送的Q所以需要手工将其替换成BugMailer.exe中输入的邮g地址?br />包含以下几个文g
template\en\default\account\cancel-token.txt.tmpl
template\en\default\account\password\forgotten-password.txt.tmpl
template\en\default\account\email\change-new.txt.tmpl
template\en\default\account\email\change-old.txt.tmpl
template\en\default\request\email.txt.tmpl
xBugzilla的邮件发送功能基本完成,同时QBugzilla也已基本安装完成Q下一步就是以用户d?bugzillaq行配置了?
三、补充说?/p>
对于Bugzilla的安装,比较ȝ的就是安装Perl模块及对Bugzilla源文件的修改。安装过E的要点是不断的q行perl checksetup.pl脚本Q随时根据里面提C的信息q行相关操作可以了?/p>
记得修改Email的头信息的编码ؓGB2312.q个和语a包相?而且MySQL最好用gb2312的编?和Apache的default charset一?
参考文献:
Installing Bugzilla on Microsoft Windowshttp://ebugs.org/bugzilla/2.php
Bugzilla 应用(2)——Bugzilla 的安?/a>