1. 下载bugzilla

下载地址:https://ftp.mozilla.org/pub/webtools/

因为我在github上搜了一下“bugzilla cn”提示有中文语言包就下了5.0.2版本。

另一个带中文语言包的地址:https://github.com/hxping7/bugzilla5.0.2_zh-CN

2. 安装mysql

1. 查询当前版本

rpm –qa | grep mysql

[[email protected] ~]# rpm -qa | grep mysql

mysql-5.1.73-3.el6_5.x86_64

mysql-libs-5.1.73-3.el6_5.x86_64

mysql-server-5.1.73-3.el6_5.x86_64

mysql-connector-odbc-5.1.5r1144-7.el6.x86_64

2. 卸载当前版本

rpm –e 或者 rpm –e --nodeps

3. 查看可安装版本列表

yum list | grep mysql

Centos 6.5安装bugzilla 5.0.2

4. 安装版本

yum install -y mysql-server mysql mysql-devel

Centos 6.5安装bugzilla 5.0.2

Centos 6.5安装bugzilla 5.0.2

通过“rpm –qi mysql-server”查看是否安装成功

Centos 6.5安装bugzilla 5.0.2

5. 启动mysql

service mysqld start

service mysqld restart

Centos 6.5安装bugzilla 5.0.2

6. 设置开机启动

查询开机启动状态:chkconfig --list | grep mysqld

Centos 6.5安装bugzilla 5.0.2

设置开机启动:chkconfig mysqld on

Centos 6.5安装bugzilla 5.0.2

7. 配置mysql

启动mysql服务后,需要设置root密码和增加其他用户(关于如何设置root密码,在服务第一次启动时有提示)

/usr/bin/mysqladmin -u root password 'new-password' // 为root账号设置密码

登录测试

mysql –u root –p

Centos 6.5安装bugzilla 5.0.2

3. 安装httpd服务

详见http://wenhai.iteye.com/blog/2280133第2点“安装httpd服务”。

4. 安装bugzilla

1. root用户登录mysql

mysql –u root –p

Centos 6.5安装bugzilla 5.0.2

2. 创建bugs数据库,并授予root用户权限

create database bugs;

Centos 6.5安装bugzilla 5.0.2

授权:

grant all on bugs.* to [email protected] identified by "root"; #授权

flush privileges; # 刷新

Centos 6.5安装bugzilla 5.0.2

3. 解压bugzilla

tar xf bugzilla-5.0.2_cn.tar.gz -C /var/www/html/

4. 安装perl环境

进入bugzilla目录,执行“perl checksetup.pl”

Centos 6.5安装bugzilla 5.0.2

根据提示安装必须的插件即可。

或者执行“/usr/bin/perl install-module.pl –all”,直接安装所有的必须和可选模块,省去一个一个执行的麻烦(但耗时较长)。

所有插件安装完成之后,在执行“perl checksetup.pl”命令,提示“checksetup.pl complete.”则可进行下一步。

执行报错:

提示’’@’localhost‘对bugs数据库没有权限

进入mysql,执行”grant all on bugs.* ‘’@’localhost’ identity by ‘’;”

5. 设置bugzilla

所有模块安装完成之后,会在bugzilla根目录下生成一个”localconfig”文件,修改其中的数据库相关参数后,再次执行checksetup.pl,输入用户名、邮箱等信息。

Centos 6.5安装bugzilla 5.0.2

6. 的

5. 配置httpd,添加cgi库支持

vi /etc/httpd/conf/httpd.conf

在文件最后,追加以下内容:

<VirtualHost *:80>
     DocumentRoot /var/www/html/bugzilla/
</VirtualHost>
 
<Directory /var/www/html/bugzilla>
     AddHandler cgi-script .cgi
     Options +Indexes +ExecCGI
     DirectoryIndex index.cgi
     AllowOverride Limit FileInfo Indexes
</Directory>

Centos 6.5安装bugzilla 5.0.2

执行”vi .htaccess”修改bugzilla目录下的文件,注视掉“Options –Indexes”这一行。

执行”service httpd restart”重启httpd服务。

6. 访问bugzilla

http://10.242.130.56:81/bugzilla/

Centos 6.5安装bugzilla 5.0.2

其他:

注:本篇文章是建立在别人的配置文档的基础上进一步优化而来,感谢之前的那位作者的付出。

1、安装所需要的组件

[[email protected] ~]# yum -y install httpd mod_ssl mysql-server mysql php-mysql gcc perl* mod_perl-devel


2、配置httpd.conf,增加蓝色一行,随后启动httpd,设置为开机启动

[[email protected] ~]# vi /etc/httpd/conf/httpd.conf

# ServerName gives the name and port that the server uses to identify itself.

# This can often be determined automatically, but we recommend you specify

# it explicitly to prevent problems during startup.

#

# If this is not set to valid DNS name for your host, server-generated

# redirections will not work.  See also the UseCanonicalName directive.

#

# If your host doesn't have a registered DNS name, enter its IP address here.

# You will have to access it by its address anyway, and this will make

# redirections work in a sensible way.

#

#ServerName www.example.com:80

ServerName localhost:80

[[email protected] ~]# service httpd start

正在启动 httpd[确定]

[[email protected] ~]# chkconfig httpd on

[[email protected] ~]#


3、编辑hosts文件,为主机名配置一个本地IP地址,随后启动mysqld服务

 [[email protected]bogon ~]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

127.0.0.1   bogon

[[email protected] ~]# service mysqld start

初始化 MySQL 数据库: Installing MySQL system tables...

OK

Filling help tables...

OK

 

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

 

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

 

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h bogon password 'new-password'

 

Alternatively you can run:

/usr/bin/mysql_secure_installation

 

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

 

See the manual for more instructions.

 

You can start the MySQL daemon with:

cd /usr ; /usr/bin/mysqld_safe &

 

You can test the MySQL daemon with mysql-test-run.pl

cd /usr/mysql-test ; perl mysql-test-run.pl

 

Please report any problems with the /usr/bin/mysqlbug script!

 

[确定]

正在启动 mysqld: [确定]

[[email protected] ~]# chkconfig mysqld on

[[email protected] ~]#


4、配置mysql

[[email protected] ~]# mysqladmin -u root -p password "password"

Enter password: 这里要求输入之前的密码,由于默认密码为空,直接回车即可

[[email protected] ~]# mysql -uroot -ppassword

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

Your MySQL connection id is 9

Server version: 5.1.73 Source distribution

 

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

mysql> create database bugs;

Query OK, 1 row affected (0.00 sec)

 

mysql> grant all on bugs.* to [email protected] identified by "password";

Query OK, 0 rows affected (0.00 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.01 sec)

 

mysql> quit

Bye

[[email protected] ~]#


5、下载并解压Bugzilla

 [[email protected] ~]# tar xf bugzilla-4.4.tar.gz -C /var/www/html/

[[email protected] ~]# cd /var/www/html/

[[email protected] html]# mv bugzilla-4.4/ bugzilla

[[email protected] html]#


5、检测Bugzilla缺少的组件

[[email protected] html]# cd bugzilla/

[[email protected] bugzilla]# ./checksetup.pl --check-modules

随后会打印一些信息,会看到一些标为not found的缺失组件


6、在线安装Bugzilla缺少的组件(安装时间较长)

[[email protected] bugzilla]# perl install-module.pl --all

Checking for                 CPAN (v1.81)     ok: found v1.9402

Checking for                 YAML (any)       ok: found v0.70

Checking for   ExtUtils-MakeMaker (v6.31)     ok: found v6.55_02

Fetching with LWP:

  http://www.cpan.org/authors/01mailrc.txt.gz

......

Installing /var/www/html/bugzilla/lib/man/man3/DBD::SQLite::Cookbook.3pm

Installing /var/www/html/bugzilla/lib/man/man3/DBD::SQLite::Fulltext_search.3pm

Installing /var/www/html/bugzilla/lib/man/man3/DBD::SQLite::VirtualTable.3pm

Appending installation info to /var/www/html/bugzilla/lib/x86_64-linux-thread-multi/perllocal.pod

  ISHIGAKI/DBD-SQLite-1.48.tar.gz

  /usr/bin/make install  -- OK

[[email protected] bugzilla]#


7、执行checksetup.pl后,目录下会生成一个localconfig文件

[[email protected] bugzilla]# ./checksetup.pl

* This is Bugzilla 4.5.2 on perl 5.10.1

* Running on Linux 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013

 

Checking perl modules...

Checking for               CGI.pm (v3.51)     ok: found v3.64

......

Please edit the file ./localconfig and then re-run checksetup.pl

to complete your installation.

[[email protected] bugzilla]#


8、编辑localconfig文件,将如下参数设置正确

[[email protected] bugzilla]# vi localconfig

# The DNS name or IP address of the host that the database server runs on.

$db_host = 'localhost';

# The name of the database. For Oracle, this is the database's SID. For

# SQLite, this is a name (or path) for the DB file.

$db_name = 'bugs';

# Who we connect to the database as.

$db_user = 'root';

# 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 (\)

# (It is far simpler to just not use those characters.)

$db_pass = 'password';

# Sometimes the database server is running on a non-standard port. If that's

# the case for your database server, set this to the port number that your

# database server is running on. Setting this to 0 means "use the default

# port for my database server."

$db_port = 3306;


9、设置管理员信息和密码。下面的管理员邮箱和密码必须正确,否则会发不出邮件。

[[email protected] bugzilla]# ./checksetup.pl

* This is Bugzilla 4.5.2 on perl 5.10.1

......

Enter the e-mail address of the administrator: [email protected]  # bugzilla管理员账号

Enter the real name of the administrator: administrator

Enter a password for the administrator account: 123456

Please retype the password to verify: 123456

[email protected] is now set up as an administrator.

Creating initial dummy product 'TestProduct'...

 

Now that you have installed Bugzilla, you should visit the 'Parameters'

page (linked in the footer of the Administrator account) to ensure it

is set up as you wish - this includes setting the 'urlbase' option to

the correct URL.

checksetup.pl complete.

[[email protected] bugzilla]#


10、配置httpd参数,进入编辑器后按Shift + g键将光标移动到最下行,增加蓝色部分的配置

[[email protected] bugzilla]# vi /etc/httpd/conf/httpd.conf

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

#

#

#    ServerAdmin [email protected]

#    DocumentRoot /www/docs/dummy-host.example.com

#    ServerName dummy-host.example.com

#    ErrorLog logs/dummy-host.example.com-error_log

#    CustomLog logs/dummy-host.example.com-access_log common

#

 

     DocumentRoot /var/www/html/bugzilla/

 

 

 

     AddHandler cgi-script .cgi

     Options +Indexes +ExecCGI

     DirectoryIndex index.cgi

     AllowOverride Limit FileInfo Indexes

 


11、编辑.htaccess文件,用井号注释Options -Indexes一行

[[email protected] bugzilla]# vi .htaccess

# Options -Indexes


12、配置邮箱

 [[email protected] ~]# vi /var/www/html/bugzilla/data/params

...

'mail_delivery_method' => 'SMTP',

'mailfrom' => '[email protected] ',

'maintainer' => 'administrator@163.com ',

...

'smtp_password' => '输入邮箱的登录密码',

'smtp_ssl' => 0,

'smtp_username' => ' administrator@163.com ',

'smtpserver' => 'smtp.163.com',

...

'urlbase' => 'http://192.168.10.129',    # 输入bugzilla服务器的地址,如果有域名就填写域名

'use_mailer_queue' => 1,

...

[[email protected] ~]# /var/www/html/bugzilla/jobqueue.pl start

Starting jobqueue.pl server

[[email protected] ~]# /var/www/html/bugzilla/jobqueue.pl install

bugzilla-queue installed. To start the daemon, do "/etc/init.d/bugzilla-queue start" as root.


13、汉化

将中文汉化包解压到 /var/www/html/bugzilla/template/ 目录下,此时该目录下会生成zh-CN文件夹。重新访问bugzilla,此时已经被汉化。

[[email protected] bugzilla]# cd /var/www/html/bugzilla/template/

将汉化包拷贝到 /var/www/html/bugzilla/template/ 目录下

[[email protected] template]# tar xzvfm bugzilla.zh-CN.4.4rc2.20130528.tar.gz

[[email protected] template]# rm bugzilla.zh-CN.4.4rc2.20130528.tar.gz


14、重启httpd服务

[[email protected] bugzilla]# service httpd restart

停止 httpd[确定]

正在启动 httpd[确定]

[[email protected] bugzilla]#


15、发送邮件进行邮箱的配置验证

 Centos 6.5安装bugzilla 5.0.2

Centos 6.5安装bugzilla 5.0.2
Centos 6.5安装bugzilla 5.0.2


16bugzilla数据库备份

[[email protected] bugzilla]# mysqldump -uroot -p123456 bugs > bugs.sql


17bugzilla灾难性恢复

[[email protected] bugzilla]# mysql -uroot -p123456 bugs < bugs.sql

或者

[[email protected] bugzilla]# mysql -uroot -p123456

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

Your MySQL connection id is 14

Server version: 5.1.73 Source distribution

 

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

mysql> use bugs

mysql> source /opt/bugs.sql

mysql> quit

 

18、重新启动MySQL服务

[[email protected] bugzilla]# service mysqld restart

停止 mysqld[确定]

正在启动 mysqld[确定]

[[email protected] bugzilla]#

相关文章: