ubuntu 系统中搭建bugzilla系统

随着时间的推移,在大脑中形成的记忆总会慢慢的淡去,人的记忆力就是这样,所以最好的办法就是形成博客去记录下来,一方面给自己以后回顾用,一方面也算是自己的一个积累。所以一旦选择了一个行业,最好不要轻 易转行,因为很多知识需要不断的重复才能真正的掌握,而一个行业又需要很多真正掌握的知识,有人称这是积累的过程。不管怎么说,不论哪个行业都不是熬几个 通宵就搞定的。而你的积累也就变成想转此行别人的壁垒,你积累的越多,壁垒也就越高。所以一旦选择,就要一直走下去,相信不久的将来你会看到不一样的曙 光,因为有很多人在路上半途而废。我坚信这一点。 


我在ubuntu上安装bugzilla系统部署,也是一头雾水,现在能做的也就是从网络上借鉴各种大牛的教程然后加上自己的总结和实际操作中遇到的困难从而记录下来写成博客。

Bugzilla简介
        
Bugzilla是一个共享的免费的产品缺陷记录及跟踪工具(Bug-Tracking System)。由Mozilla公司提供。创始人是Terry Weissman,开始时使用一种名为“TCL”的语言创建的,后用Perl语言实现,并作为Open source发布。它可以管理软件开发中缺陷的提交(new),修复(resolve),关闭(close)等整个生命周期。
Bugzilla特点
Bugzilla能够为你建立一个完善的bug跟踪体系,包括报告bug、查询bug记录并产生报表、处理解决bug、管理员系统初始化和设置四部分。Bugzilla具有如下特点:
1.基于Web方式,安装简单、运行方便快捷、管理安全。
2.有利于缺陷的清楚传达。本系统使用数据库进行管理,提供全面详尽的报告输入项,产生标准化的bug报告。 提供大量的分析选项和强大的查询匹配能力,能根据各种条件组合进行bug统计。当缺陷在它的生命周期中变化时,开发人员、测试人员、及管理人员将及时获得 动态的变化信息,允许你获取历史记录,并在检查缺陷的状态时参考这一记录。
3.系统灵活,强大的可配置能力。Bugzilla工具可以对软件产品设定不同的模块,并针对不同的模块设定开发人员和测试人员。这样可以实现提交报告时 自动发给指定的责任人,并可设定不同的小组,权限也可划分。设定不同的用户对bug记录的操作权限不同,可有效控制进行管理。允许设定不同的严重程度和优 先级。可以在缺陷的生命期中管理缺陷。从最初的报告到最后的解决,确保了缺陷不会被忽略。同时可以使注意力集中在优先级和严重程度高的缺陷上。
4.自动发送Email,通知相关人员。根据设定的不同责任人,自动发送最新的动态信息,有效的帮助测试人员和开发人员进行沟通。

 

如果大家想对bugzilla系统详细了解,可以去官方网站查看,毕竟官网的东西我觉得都是比较权威的。官方网址:

http://www.bugzilla.org/

 

我们从官方可以看到部署该系统的要求和方法:

http://www.bugzilla.org/requirements/


http://www.bugzilla.org/docs/4.4/en/html/



Requirements

Operating System

To install and run Bugzilla on your server, the core requirement is to have Perl installed. This means that Bugzilla can be installed on any platform where Perl can be installed, including Windows, Linux, and Mac OS X. Linux is highly recommended and is our 1st-class citizen operating system.

Hardware

The hardware requirements depend heavily on the size of the user base and on the number of bugs in your database. For small teams (up to a few tens of users) with few bugs (up to a few thousands bugs), any good machine will do the job pretty well. The important part is to have enough RAM (4 GB or more recommended) and a fast processor (for instance, 3 GHz). Such hardware is pretty common nowadays. A harddisk with 50 GB of free space is large enough.

Larger teams with several thousands of users and several hundreds of thousands bugs need more hardware. To give you an idea, the Bugzilla installation at Mozilla uses 8 servers: 3 webheads (12 GB of RAM each), 1 master database (35 GB of RAM), 3 slave databases (35 GB of RAM each), and 1 email relay. Moreover, mod_perl is enabled for improved performance. Note that it is designed for very high concurrent access, which is quite unusual, so your requirements are probably lower than that.

Software

Bugzilla needs a database server, a web server, and Perl. In all recommendations below, "Bugzilla requires version X" must be understood as "Bugzilla requires version Xor newer". In all cases, the newer, the better, as newer releases have more bug fixes, are still supported and still get security fixes. If you install the mimimum version mentioned below, the risk is that this version will reach End Of Life pretty soon and so can be unsupported at any time.

Perl:
Bugzilla 4.4 and older require Perl 5.8.1 (or newer, see the previous paragraph), but Bugzilla 5.0 and newer will require Perl 5.10.1, and so we don't recommend Perl 5.8.x at this stage. Instead, you should install Perl 5.12 (though this version already reached End Of Life ) or newer, as these newer versions have some useful improvements which will make your life easier.
Database Server:
Bugzilla supports MySQL, PostgreSQL, Oracle and SQLite. We highly recommend MySQL and PostgreSQL, which have the best support from Bugzilla and are used daily by Bugzilla developers. Oracle has several known issues and is a 2nd-class citizen. It should work decently in most cases, but may fail miserably in some cases too. SQLite is recommended for testing purposes only or for small teams.
If you install MySQL, version 5.0.15 is required by Bugzilla 4.x, but we highly recommend version 5.5 or newer. If you install PostgreSQL, version 8.3 is required.
Web Server:
Bugzilla has no minimum requirements for its web server. We recommend to install Apache 2.2, though Bugzilla works fine with IIS too (IIS 7 or higher recommended). If you install Apache and you want improved performances, you can enable its mod_perl module.

通过以上了解我们知道需要预先安装一下几个软件:

  • Perl(V5.8.1以上)
  • 数据库引擎(Mysql/postgresql/Oracle)
  • Web服务器
  • Mail Transfer Agent
  • Bugzilla压缩包的下载和Perl Moudles(Perl 模块)

具体步骤如下:

一:

1.需要安装perl,首先就要知道这个perl是什么,干什么用的。

perl的前身是Unix系统管理的一个工具,被用在无数的小任务里。后逐渐发展成为一种功能强大的程序设计语言,用作Web编程、数据库处理、XML处理以及系统管理;在完成这些工作时,同时仍能处理日常细小工作,这是它的设计初衷。Perl特别适合系统管理和Web编程。实际上已经被用在所有Unix(包括Linux)捆绑在一起作为标准部件发布,同时也用在Microsoft Windows和几乎其他所有操作系统。Perl 被称为“实用报表提取语言”(Practical Extraction and Report Language)。Perl是由拉里·沃尔(Larry Wall)设计的,并由他不断更新和维护的编程语言。简而言之,Perl像C一样强大,像awk、sed等脚本描述语言一样方便。

2.Perl一般是系统自带 ,如果没有或者版本不符合要求,请自行安装,或者
apt-get install perl
用Perl -v查看perl版本信息

perl的官方网址是:http://www.perl.org/

 

3.在命令终端输入命令:perl -v 查看安装的perl的版本:


执行一下这个命令:sudo apt-get update 获得最近的软件包的列表;列表中包含一些包的信息,比如这个包是否更新过

我的perl的版本为:5.14.2网上说的安装版本要求为:5.8.1显然我的perl的版本已经够用了,但是我还是

用命令apt-get install perl更新了一下。

 

二:安装Mysql

 

在终端输入命令:mysql -v  如下图所示:

 

按照提示继续输入命令:sudo apt-get install mysql-client-core-5.5  

 

安装命令:sudo apt-get install mysql-server(安装完成的最后,会让你输入root管理员的帐号密码,记住该密码,此root非用户组中的root,而是mysql数据库的root管理员根帐号)


 

三、Web服务器(apache2)

安装命令 : sudo apt-get install apache2

 

四、Mail Transfer Agent

 

安装命令: sudo apt-get install sendmail

 

五、下载bugzilla及安装Perl模块

下载链接:http://www.bugzilla.org/

将该文件解压缩到/var/www/目录下

sudo tar -C /var/www/ -xvf bugzilla-4.4.5.tar.gz

解压完毕,该目录下将会有一个名为bugzilla-4.4.5的目录,将该目录改名为bugzilla并切换到/var/www/bugzilla/目录

sudo mv bugzilla-4.4.5  bugzilla & cd /var/www/bugzilla/

在bugzilla目录下有一个checksetup.pl的文件,运行该文件

sudo perl checksetup.pl

运行完毕,会告诉你当前bugzilla还差那些perl模块需要安装,并且有提示安装命令。这里我们只需要安装必须的一些包就可以了,可选包可以不用安装。安装这些必须的包的命令一般为:

 /usr/bin/perl   install-module.pl --all

这句命令将安装bugzilla所需要的一系列perl模块,基本上运行完毕,安装bugzilla的前期准备工作都做的差不多了。
当然也存在一些安装不上的情况,这时要自己安装,我安装时候存在YAML和DateTime 安装不成功,通过如下命令安装或到cpan上下载需要的模块安装

sudo /usr/bin/perl install-module.pl YAML

sudo /usr/bin/perl install-module.pl DateTime

这句命令将安装bugzilla所需要的一系列perl模块,基本上运行完毕,安装bugzilla的前期准备工作都做的差不多了。

其实这个时候bugzilla差不多可以算是安装好一大半了,剩下的就是一些配置的问题了。


六、配置

1、mysql的配置。

       bugzilla需要用mysql数据库来管理bugs,其默认的数据库名字为bugs,默认的数据库管理员帐号为bugs,默认管理员密码为空,这些都是写在配置文件localconfig中的。所以我们需要添加一个bugs的mysql数据管理员用户,并创建一个名为bugs的数据库来保存bugzilla提交的bugs。

在终端输入:

mysql -u root -p(用mysql的root管理员登录mysql,以添加用户bugs),终端会提示输入密码,即之前安装mysql时的最后输入的root密码。

进入mysql界面后

grant all on *.* to bugs@localhost identified by '';flush privileges;别忘最后的‘;'号),这样我们就创建好了mysql的用户bugs,供bugzilla使用。

最后创建bugs数据库文件。在mysql界面中输入:

CREATE DATABASE bugs;

2、apache2服务器的配置   

打开apache2的配置文件httpd.conf

sudo vi /etc/apache2/httpd.conf,在其中添加如下内容:

   <Directory "/var/www/bugzilla/">

        AddHandler cgi-script .cgi 

        Options +Indexes +ExecCGI +FollowSymLinks

        DirectoryIndex index.cgi

        AllowOverride None

        Order allow,deny

        Allow from all

    </Directory>

3、bugzilla的配置

修改/bugzilla/localconfig文件中的一句话:$webservergroup = 'www-data';

这里为什么填www-data呢,这是由我们安装好的apache2的环境变数决定的,该变数存在文件/etc/apache2/envvars中,文件的内容如下:

# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

这就是我们要填www-data的原因了,另外我们需要修改bugzilla目录的owner和groups。因为apache2环境变数决定是其是用www-data用户组来执行的。修改的命令为:sudo chgrp -R root.www-data bugzilla。


最后在终端执行下面的命令:sudo perl checksetup.pl,运行完毕bugzilla将会顺利的安装好,在安装的最后会让你输入bugzilla系统的管理员帐号和密码,这个必须记好了。

七、启动bugzilla

重启apache2服务器和mysqlserver

sudo /etc/init.d/apache2 restart

sudo /etc/init.d/mysql restart

bugzilla的环境算是基本上搭建好了,接下来打开firefox就可以用了。

在地址一栏输入http://localhost/bugzilla就可以看到bugzilla的首页了,截图如下:



后面大部分的内容是参考了博客http://blog.csdn.net/ocean181/article/details/7184961

 

 

 在点击 open a new account 的注册一个新用户的时候:

报了以下错误:

Software error:

No SASL mechanism found
 at lib/Authen/SASL.pm line 78
 at /usr/share/perl/5.14/Net/SMTP.pm line 143

For help, please send mail to the webmaster (webmaster@localhost), giving this error message and the time and date of the error.



  • apt-get install libauthen-sasl-cyrus-perl libauthen-sasl-perl 

  • sudo /etc/init.d/sendmail restart



更新了以后再次去注册创建一个用户的时候又报了一下一个错误:

An unexpected error occurred. This could be a temporary problem, or some code is behaving incorrectly. If this problem persists, please email this page to xxx@XXX.com with details of what you were doing at the time this message appeared.

URL: http://192.168.20.207/bugzilla/createaccount.cgi?login=xx%403XXX.com&token=1407149745-hvvkPJpqM65UnbQRJ5WWgBU3OYzz15fQ_ME0-UOlXIU

There was an error sending mail from 'xxx@XXX.com' to 'xx@XXX.com': Couldn't authenticate 'xxx@XXX.com:...'

Traceback:

 at Bugzilla/Mailer.pm line 174
	Bugzilla::Mailer::MessageToMTA(...) called at Bugzilla/Token.pm line 76
	Bugzilla::Token::issue_new_user_account_token(...) called at Bugzilla/User.pm line 2039
	Bugzilla::User::check_and_send_account_creation_confirmation(...) called at /var/www/bugzilla/createaccount.cgi line 37


在网上看了很多的教程,也没有看到什么具体的解决方案。于是自己静下新来。从头又过了一边。自己的又读了一边输出的错误日志信息:There was an error sending mail from 'xxx@XXX.com' to 'xx@XXX.com': Couldn't authenticate 'xxx@XXX.com:...'

 这里的意思是说无法认证:xxx@XXX.com。所以在次返回:Administration->Parameters->Email->smtp_username

在这里有这样一段英文描述:The username to pass to the SMTP server for SMTP authentication. Leave this field empty if your SMTP server doesn't require authentication.

意思就是说:用户名传递到SMTP服务器进行SMTP认证。将此字段留空,如果您的SMTP服务器不需要身份验证。



于是看到这里我就不禁产生了几个疑问:什么是SMTP认证。SMTP认证有什么作用?

 SMTP 的全称是“Simple Mail Transfer Protocol”,即简单邮件传输协议。它是一组用于从源地址到目的地址传输邮件的规范,通过它来控制邮件的中转方式。SMTP 协议属于 TCP/IP 协议簇,它帮助每台计算机在发送或中转信件时找到下一个目的地。SMTP 服务器就是遵循 SMTP 协议的发送邮件服务器。
SMTP 认证,简单地说就是要求必须在提供了账户名和密码之后才可以登录 SMTP 服务器,这就使得那些垃圾邮件的散播者无可乘之机。
增加 SMTP 认证的目的是为了使用户避免受到垃圾邮件的侵扰。


公司的邮件服务器是没有SMTP认证的。所以这里直接空着邮件就可以正常的发送出来了。




bugzilla 从3.4版后,改由jopqueue.pl来执行邮件通知功能。如果发现几天没有收到邮件了,就可以check一下该脚本的状态,看看是否在正常工作。

在bugzilla安装目录,执行指令:

./jobqueue.pl check
如果该脚本运行正常,一般会有如下提示:

[root@axdc-release /usr/local/www/bugzilla]# ./jobqueue.pl check
Configuration looks okay
jobqueue.pl running - pid 34479
0 jobs in the queue.
如果出现问题,一般会有如下提示:

[root@axdc-release /usr/local/www/bugzilla]# ./jobqueue.pl check
Configuration looks okay
No jobqueue.pl running - pid 34193
1304 jobs in the queue.
如果jobqueue.pl存在问题,首要做的是用 ps -aux | grep “jopqueue.pl"查看一下是否有该进程存在,如果有,请直接kill掉。

指令: kill [jopqueue.pl PID]

kill后,再执行jobqueue.pl启动指令:

./jobqueue.pl start

然后再执行几次check动作,看jobqueue.pl是否正常工作,正常的话 “xxx jobs in the queue”中的数字 “xxx”会是0或不断减小 ,当然也可以通过是否能接收到bugzilla服务器发出的邮件来验证。



bugzilla 数据库操作相关总结:

1、本机登陆mysql:mysql -u root -p 

2、 远程登录mysql:mysql -h ip -u user -p
3、quit;//退出mysql操作 


要想知道每个数据库的大小的话,步骤如下:

1、进入information_schema 数据库(存放了其他的数据库的信息)

use information_schema;

2、查询所有数据的大小:

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;

3、查看指定数据库的大小:

比如查看数据库home的大小

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home';

4、查看指定数据库的某个表的大小

比如查看数据库home中 members 表的大小

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home' and table_name='members';

数据库常用命令总结如下:

create database name; 创建数据库
use databasename; 选择数据库
drop database name 直接删除数据库,不提醒
show tables; 显示表
describe tablename; 表的详细描述
select 中加上distinct去除重复字段
mysqladmin drop database name 删除数据库前,有提示。
显示当前mysql版本和当前日期
select version(),current_date;


 

 

 

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值