51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3129|回复: 4
打印 上一主题 下一主题

[原创] CentOS-6.5-安装-Bugzilla(绝对可用)

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2017-5-19 15:47:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
CentOS 6.5 安装 Bugzilla
正文:
1、安装所需要的组件(apache 服务器,mysql 数据库,gcc 编译器,perl 模块)
[root@bogon ~]# yum -y install httpd mod_ssl mysql-server mysql php-mysql gcc perl* mod_perl-devel

2、配置 httpd.conf,增加蓝色一行,随后启动 httpd,设置为开机启动
[root@bogon ~]# vi /etc/httpd/conf/httpd.conf
# 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
[root@bogon ~]# service httpd start
正在启动 httpd:[确定]
[root@bogon ~]# chkconfig httpd on
[root@bogon ~]#
3、编辑 hosts 文件,为主机名配置一个本地 IP 地址,随后启动 mysqld 服务
[root@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
[root@bogon ~]# service mysqld start
[root@bogon ~]# chkconfig mysqld on
[root@bogon ~]#

4、配置 mysql
[root@bogon ~]# mysqladmin -u root -p password "123456"
Enter password: (这里要求输入之前的密码,由于默认密码为空,直接回车即可)
[root@bogon ~]# mysql -uroot -p123456
mysql> create database bugs;
Query OK, 1 row affected (0.00 sec)
若要设置 root 用户可以远程访问,执行
mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456";
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
[root@bogon ~]#
配置防火墙
要远程访问服务,需要开启服务端口,增加蓝色两行(mysql 端口:3306,tomcat 端口:8080)
[root@bogon ~]# vi /etc/sysconfig/iptables,
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
刷新防火墙配置:
[root@bogon ~]# service iptables restart
OK,一切配置完毕,你可以远程访问你的 MySQL 了~

5、下载并解压 Bugzilla
[root@bogon ~]# wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.4.12.tar.gz
[root@bogon ~]# tar xf bugzilla-4.4.12.tar.gz -C /var/www/html/
[root@bogon ~]# cd /var/www/html/
[root@bogon html]# mv bugzilla-4.4.12 bugzilla
[root@bogon html]#
检测 Bugzilla 缺少的组件
[root@bogon html]# cd bugzilla/
[root@bogon bugzilla]# ./checksetup.pl --check-modules
随后会打印一些信息,会看到一些标为 not found 的缺失组件

6、在线自动安装 Bugzilla 缺少的组件(安装时间较长)
[root@bogon 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
[root@bogon bugzilla]#

7、执行 checksetup.pl 后,目录下会生成一个 localconfig 文件
[root@bogon 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.
[root@bogon bugzilla]#

8、编辑 localconfig 文件,将如下参数设置正确
[root@bogon 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 = '123456';
# 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、设置管理员信息和密码。下面的管理员邮箱和密码必须正确,否则会发不出邮件。
[root@bogon bugzilla]# ./checksetup.pl
* This is Bugzilla 4.5.2 on perl 5.10.1
......
Enter the e-mail address of the administrator: masterbox@163.com # bugzilla 管理员账号
Enter the real name of the administrator: xiegx
Enter a password for the administrator account: 123456
Please retype the password to verify: 123456
bugzilla@jnsec.net 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.
[root@bogon bugzilla]#

10、配置 httpd 参数,进入编辑器后按 Shift + g 键将光标移动到最下行,增加蓝色部分的配置
[root@bogon 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.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# 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
#</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/html/
</VirtualHost>
<Directory /var/www/html >
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes
</Directory>


11、编辑.htaccess 文件,用井号注释 Options -Indexes 一行
[root@bogon bugzilla]# vi .htaccess
# Options -Indexes
12、配置邮箱
[root@bogon ~]# vi /var/www/html/bugzilla/data/params
...
'mail_delivery_method' => 'SMTP',
'mailfrom' => 'masterbox@163.com ',
'maintainer' => 'masterbox@163.com ',

...
'smtp_password' => '输入邮箱的登录密码',
'smtp_ssl' => 0,
'smtp_username' => ' masterbox@163.com ',
'smtpserver' => 'smtp.163.com',

...
'urlbase' => 'http://192.168.10.129', # 输入 bugzilla 服务器的地址(本机 ip)
'use_mailer_queue' => 1,

...
[root@bogon ~]# /var/www/html/bugzilla/jobqueue.pl start
Starting jobqueue.pl server
[root@bogon ~]# /var/www/html/bugzilla/jobqueue.pl install
bugzilla-queue installed. To start the daemon, do "/etc/init.d/bugzilla-queue start" as root.

13、bugzilla 汉化
[root@bogon bugzilla]# cd /var/www/html/bugzilla/template/
[root@bogon bugzilla]#
wget https://github.com/yourcaptain/bugzilla-cn-4.4.6/archive/master.zip
[root@bogon template]# unzip master
[root@bogon template]# mv bugzilla-cn-4.4.6-master cn
[root@bogon template]# rm -rf master

14、重启 httpd 服务
[root@bogon bugzilla]# service httpd restart
停止 httpd:[确定]
正在启动 httpd:[确定]
[root@bogon bugzilla]#

15、发送邮件进行邮箱的配置验证
在浏览器输入:http:// localhost/bugzilla 访问 bugzilla 首页(点击网页右上角 cn 按钮可切换中文)
bugzilla 管理员密码 重置:
如果忘记了管理员的密码,可以进入到 mysql 数据库中的 bugs 数据库,修改 profiles 表,把管理员
的 cryptpassword 数据设置为 12345。即可以用 123456 密码进入                                                                                                                                                                                  (以上操作如


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-22 02:34 , Processed in 0.071445 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表