win7+bugzilla+apache+mysql+activePerl

来源:互联网 发布:淘宝客已经不赚钱了 编辑:程序博客网 时间:2024/05/12 02:40

目 录

 

一下载软件... 2

1.Bugzilla

2.MySQL. 2

3.ActivePerl

4.Apache 2.x. 2

5.邮件fake.2

二安装、配置软件...2

1Bugzilla

2.MySQL. 2

3.Perl 3

4. Apache. 5

5配置 Bugzilla. 8

6配置支持邮件发送... 10

7汉化Bugzilla. 10

 Bugzilla迁移... 10

1Mysql/Bugzilla. 10

2.Perl/Apache. 11

3.备份迁移httpd.conf 11

4.备份迁移sendmail.exe. 11

四注意事项... 11

A.参考文献... 11

B.未完成的事情... 11

1.Linux下安装Bugzilla... 11

2.升级到2.20, 11

 


一 下载软件 

 

所有资源可以去我的博客资源里下载:http://download.csdn.net/user/tongkp 

 

1.bugzilla-4.1.3或更高版本

官网地址: http://bugzilla.org/download.html

2.MySQL

官网地址:下载MySQL "Windows Essentials"版本:http://dev.mysql.com/downloads/mysql/4.1.html

3.ActivePerl

下载ActivePerl_5.1或更高的版本

官网地址:http://activestate.com/Products/Download/Download.plex?id=ActivePerl

要提供邮箱之类的信息.

4.Apache 2.x

官网地址:下载Apache HTTP Server version 2.x或更高版本:http://httpd.apache.org/download.cgi

5.邮件fake

http://www.glob.com.au/sendmail/sendmail-bugzilla-setup.exe,据网上的文档以及该软件的使用文档所述,可以下载一个压缩包版本,解开之后配置即可,但事实上是

这么做,还是发不了邮件,而下载这个安装文件去安装,然后调整一下配置,才可以发送邮件,不太理解前者为何不能工作。

二 安装、配置软件

1Bugzilla2.1.8

解压压缩包即可,可解压至任意位置,为使用方便,可以解到根目录。为了下面的描述清晰起见,本文档假定解压至C:/bugzilla,注意不要重复创建bugzilla文件

夹,压缩包中已经带了路径bugzilla

2.MySQL

安装

可以选择典型(Typial)安装MySQL,将安装目录设置为:C:/mysql

创建Bugs数据库和用户

使用mysql 命令行创建,打开命令行窗口进入 C:/mysql/bin>

说明:网上的文档,包括BUGZILLA上推荐的一篇文档中,在输入mysql的用户名和密码时都有错误(通过-p传入密码时多了一个空格),因此导致在传入密码的情况

下,还需再输

入一次密码,就是下面有删除线的红色字体那行,只要输对了mysql的传参格式以及用户名和密码,是不需再次输入密码的。

正确的传mysql用户名和密码的格式是下列任意一种或组合:

mysql u root pmysql

mysql uroot pmysql

mysql --user=root --password=mysql

 

需要输入的蓝字命令如下:

C:/mysql/bin>mysql u root -pmysql

Enter password: ********(该行不会出现,除非你把密码改了)

Welcome to the MySQL monitor. Commands end with ; or /g.

Your MySQL connection id is 9 to server version: 4.1.3-beta-nt

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> create database bugs;

Query OK, 1 row affected (0.11 sec)

mysql> grant all privileges on bugs.* to 'bugs'@'localhost' identified by 'bugs';

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>

C:/mysql/bin>mysql -uroot -pmysql

Welcome to the MySQL monitor. Commands end with ; or /g.

Your MySQL connection id is 10 to server version: 4.1.3-beta-nt

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> set password for 'bugs'@'localhost' = OLD_PASSWORD('bugs');

Query OK, 0 rows affected (0.00 sec)

mysql> quit

Bye

C:/mysql/bin>

 

3.Perl

安装

将ActiveState Perl 安装到C:/Perl

安装 Modules(下面的重点推荐方法比较简易一些)

Bugzilla 需要安装一些perl模块,请确保你的计算机能连接到internet,所有需要模块都在http://landfill.bugzilla.org/ppm/

C:\>cd bugzilla

C:\cd bugzilla>ppm

进入DOS命令行,输入ppm,或通过运行安装perl时创建的快捷方式,在开始ActivePerl_5.1 程序Perl Package Manager 从而启动ppm(图形界面)来选择需要升级的包。

需要升级如下包:

AppConfig

TimeDate

DBI

DBD-mysql

Template-Toolkit

MailTools

GD

Chart

GDGraph

GDTextUtil

PatchReader

Net::LDAP

 

选中需要升级的包,右键点击,选择Install **** ,****是包名,最后点击下图中右侧红色框位置处的按钮或通过菜单File->Run Marked Actions 或者Ctrl + Enter,来触发升级命令。

 如果没有找到可以安装或更新的包,或者没有你要想的包请将 http://ppm4.activestate.com/MSWin32-x64/5.14/1402/package.xml添加到你的Perl Package Manager的库里,

添加的方法如下图:

步骤一:

步骤二:

Name随便写个有点意义的就可以了

Location就写 http://ppm4.activestate.com/MSWin32-x64/5.14/1402/package.xml

点Add,再点OK就添加上了

 

 

在这之前我看过前辈周怀进同志在2007年的文章,说有时候网络速度慢或不具备网络条件时,上面的在线安装方式就不爽了。

推荐的下载地址是http://landfill.bugzilla.org/ppm/bugzilla-bundle.zip不过我试过很多次都找不到网页,也许是很久以前的了吧,不过还是要

感谢他的文章给我了很大的帮助。

perl的安装目录下有lib和site/lib,lib里是perl自带的库,site/lib里是用户自己安装的包,在做下面5配置 Bugzilla时,如果提示某个包的版本比较低,可以比较这

两个地方的文件版本,如果确实都低于最低要求,那去网上找最新的包文件,一般情况下可能是用户

自己安装的包的版本太低,只要删掉site/lib下的相关的文件即可。

  这个细节很重要,很多文档都没有提到这个问题。

 

如果在checksetup.pl时候报如下错误:

Checking available perl DBD modules...

Invalid version format (non-numeric data) at Bugzilla/Install/Requirements.pm line 721.

如图:

 

本人的经验是将C:\bugzilla\Bugzilla\Install\Requirements.pm文件的一个判断给注释了,如下:

#if ($found and $found eq "-1") { 
#          $found_string = install_string('module_not_found');
#}

至于为什么因为暂时还没有时间研究,如果哪位找到了导致错误的真正原因请在本文添加评论或加我msn交流,谢谢

 

修改注册表

在注册表中创建

HKEY_CLASSES_ROOT/.cgi/Shell/ExecCGI/Command 编辑默认值为 C:/Perl/bin/perl.exe –T

 

4. Apache

 这里推荐使用Apache作为运行Bugzillaweb引擎。如果你想将Bugzilla运行在IIS上,可以参考:http://www.bugzilla.org/docs/2.18/html/configuration.html#http-iis

安装

默认安装即可,假设安装的路径是C:/Program Files/Apache Group它将安装在 C:/Program Files/Apache Group/Apache2。

如果你已经运行了IIS或oracle的http server,你在安装时配置apache运行在不同于80端口,否则你将不能访问。如果你的windows系统未安装IIS及其它http server选择默认安装即可。

允许Apache可写

创建如下目录:

• C:/Bugzilla/data

• C:/Program Files/Apache Group/Apache2/logs

• C:/Temp

配置httpd.conf文件

在记事本中编辑 C:/Program Files/Apache Group/Apache2/conf/httpd.conf

将httpd.conf和以下相应的内容比较,对照红色字体内容修改原有的内容。

#

# Listen: Allows you to bind Apache to specific IP addresses and/or

# ports, instead of the default. See also the <VirtualHost>

# directive.

#

# Change this to Listen on specific IP addresses as shown below to

# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)

#

#Listen 12.34.56.78:80

Listen 80

#

# DocumentRoot: The directory out of which you will serve your

# documents. By default, all requests are taken from this directory, but

# symbolic links and aliases may be used to point to other locations.

#

DocumentRoot "C:/bugzilla"

#

# Each directory to which Apache has access can be configured with respect

# to which services and features are allowed and/or disabled in that

# directory (and its subdirectories).

#

# First, we configure the "default" to be a very restrictive set of

# features.

#

<Directory />

Options FollowSymLinks

AllowOverride None

</Directory>

#

# Note that from this point forward you must specifically allow

# particular features to be enabled - so if something's not working as

# you might expect, make sure that you have specifically enabled it

# below.

#

#

# This should be changed to whatever you set DocumentRoot to.

#

<Directory " C:/bugzilla">

#

# AddHandler allows you to map certain file extensions to "handlers":

# actions unrelated to filetype. These can be either built into the server

# or added with the Action directive (see below)

#

# To use CGI scripts outside of ScriptAliased directories:

# (You will also need to add "ExecCGI" to the "Options" directive.)

#

AddHandler cgi-script .cgi

 

#

# 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>

#You also should add index.cgito theDirectoryIndexlist.

#

# DirectoryIndex: sets the file that Apache will serve if a directory

# is requested.

#

# The index.html.var file (a type-map) is used to deliver content-

# negotiated documents. The MultiViews Option can be used for the

# same purpose, but it is much slower.

#

DirectoryIndex index.html index.html.var index.cgi

 

重新启动 Apache

1).在命令行中重新启动Apache

C:/>net stop apache2

The Apache2 service is stopping..

The Apache2 service was stopped successfully.

C:/>net start apache2

The Apache2 service is starting.

The Apache2 service was started successfully.

C:/>

2).通过Apache控制台重起apache服务,一般最小化在系统的右下角系统托盘处.

 

5配置 Bugzilla

第一次执行checksetup.pl

如下在命令行中操作,将自动创建localconfig文件。

以下信息可能会由于你的软件版本不同而不一致。

C:/>cd bugzilla

C:/bugzilla>perl checksetup.pl

Checking perl modules ...

Checking for       AppConfig (v1.52)   ok: found v1.63

Checking for             CGI (v2.93)   ok: found v3.20

Checking for    Data::Dumper (any)     ok: found v2.121_08

Checking for    Date::Format (v2.21)   ok: found v2.22

Checking for             DBI (v1.36)   ok: found v1.52

Checking for      DBD::mysql (v2.1010) ok: found v2.9004

Checking for      File::Spec (v0.82)   ok: found v3.12

Checking for      File::Temp (any)     ok: found v0.16

Checking for        Template (v2.08)   ok: found v2.13

Checking for      Text::Wrap (v2001.0131) ok: found v2005.082401

 

The following Perl modules are optional:

Checking for              GD (v1.20)   ok: found v2.16

Checking for     Chart::Base (v1.0)    ok: found v2.3

Checking for     XML::Parser (any)     ok: found v2.34

Checking for       GD::Graph (any)     ok: found v1.43

Checking for GD::Text::Align (any)     ok: found v1.18

Checking for     PatchReader (v0.9.4)  ok: found v0.9.5

 

All the required modules are available at:

    http://landfill.bugzilla.org/ppm/

You can add the repository with the following command:

    ppm rep add bugzilla http://landfill.bugzilla.org/ppm/

Checking user setup ...

This version of Bugzilla contains some variables that you may want

to change and adapt to your local settings. Please edit the file

'./localconfig' and rerun checksetup.pl

The following variables are new to localconfig since you last ran

checksetup.pl: index_html cvsbin interdiffbin diffpath create_htaccess

webservergroup db_driver db_host db_pass db_sock db_check

C:/bugzilla>

编辑 localconfig

打开 C:/bugzilla/localconfig 找到上一个步骤创建的localconfig文件用记事本编辑它,内容如下,请对照是否有蓝字所标出的内容,如没有如下内容请在localconfig文件中修改。

#

# How to access the SQL database:

#

$db_host = "localhost"; # where is the database?

$db_port = 3306; # which port to use

$db_name = "bugs"; # name of the MySQL database

$db_user = "bugs"; # user to attach to the MySQL 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 (//)

#

$db_pass = 'bugs';

 

再次运行checksetup.pl

C:/bugzilla>perl checksetup.pl

这时将创建数据库相关表和初始化Bugzilla.下面蓝色字是创建过程中你要输入的。

….

创建过程中的日志这里就略去了.

….

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

accidently been deleted.

Enter the e-mail address of the administrator: admin@test.com

You entered 'byron@example.com'. Is this correct? [Y/n] y

Enter the real name of the administrator: admin

Enter a password for the administrator account: 123456

Please retype the password to verify: 123456

'admin@test.com' is now set up as an administrator account.

C:/bugzilla>

 

现在就可以通过http://localhost/登陆Bugzilla,至此你就能使用等待以久的Bugzilla缺陷跟踪系统了。下面是两个附加工作。

 

6配置支持邮件发送

下载了上述5.邮件fake,参考里面的文档来配置即可,主要注意的事项是usr目录的位置,如果你的bugzilla装在c盘,则将usr目录放到c:/下,如果装在d盘,则将usr目录放到d:/下。

我在安装测试的过程中,用免费的那些SMTP服务器,如smtp.126.com,我也设置了认证信息就是发不出去,以前我用PHP发送邮件,用126SMTP还是可以发出去的,不确定是否和这个程序有关系。后来改用公司的mail server没有问题,是不需认证的。

另外配置成功后,能收到邮件后,邮件里面的一些信息需要修改,比如urlbaseurlbase默认是http://you-havent-visited-editparams.cgi-yet/

修改方法:

1).你可以以管理员身份登陆,访问http://****/editparams.cgi,然后修改urlbase,“****”表示是bugzilla所在的机器名或域名或IP地址。

2).直接修改配置文件

修改C:/bugzilla/data/params文件,

查找 'urlbase' => 'http://you-havent-visited-editparams.cgi-yet/',将后面的字符串改为你所需要的。

7汉化Bugzilla

    http://www.bugzilla.org/download/里能找到相应版本的bugzilla汉化包,按包内的文档去做就可以了。

汉化时的一些注意点,有些翻译的词汇不准确的话,你自己可以用UltraEdit等编辑器去批量查找到,自己去修改。比如在2.18中汉化包中,把bug信息中的summary译成注释,这就不准确了,摘要更为准确一些。自己去修改吧。

三 Bugzilla迁移

1Mysql/Bugzilla

把这两个软件目录直接拷贝到目标服务器,从简化工作的角度来说,你可以不要改变这两个软件的位置,原先在C盘,你还放在C盘,在D盘,你就放在D盘。

    对于Mysql,你执行一下C:/mysql/bin/winmysqladmin.exe,mysql 以后就作为服务而随系统启动自动加载了。

2.Perl/Apache

    完全按照上面的安装配置文档,全新安装这两个软件,主要是那些module还需重新安装,当然第二次安装时,会熟练许多J。

3. 备份迁移httpd.conf

将源服务器上的C:/Program Files/Apache Software Foundation/Apache2.2/conf/ httpd.conf备份,并拷贝至目标服务器Apache安装目录对应的位置中。

4. 备份迁移sendmail.exe

直接拷贝对应的目录即可。将/usr目录拷贝到bugzilla安装目录所在驱动器上.

 

随后启动相关服务,如apachemysql,则迁移工作完成。

四 注意事项

如果你的机器装了Oracle 10GOracle则会创建一个环境变量PERL5LIB,指向了Oracle安装目录中perl相关目录,它的版本比较低,是perl 5.8.3,在安装配置bugzilla时,执行

perl checksetup会报错。你只需将该环境变量屏蔽即可。

A.参考文献

http://www.bugzilla.org/docs/win32install.html

http://bbs.51testing.com/viewthread.php?tid=22398大概需要注册帐号才能下载,我参考的文档是一个朋友递过来的,但我还是根据文档中作者的信息到网上找到了这

个来源,以尊重作者的辛勤付出。(Windows下安装Bugzilla》作者shorelew@hotmail.com)

……

互联网

感谢开源软件的作者和团队!感谢共享相关知识的朋友!

B.未完成的事情

1.Linux下安装Bugzilla

据相关文档介绍比windows下简单,但我没有实践过。

2.升级到2.20,

文档显示,在2.20下不需要额外的sendmail.exe来支持发送邮件,2.20下及更高版本中已有模块,直接配置相关文件即可,可以到bugzilla官方网站去查找相关资料。

 

本文基于周怀进同志的文章加实际操作编写,希望对大家有帮助

 

原文作者联系方式:

msn: zhj_michael@hotmail.com

blog: http://spaces.msn.com/members/zhj-michael/

0 0
原创粉丝点击