1. 文档目的
Centos系统安装bugzilla,包括安装邮件发送服务,数据库服务等。
2. 安装
1. 检查mysql是否安装,已安装的话可以沿用,需要把相关信息记录在bugzilla配置中,后面介绍
rpm -qa | grep mysql
2. 安装组件
yum -y install httpd mod_ssl mysql-server mysql php-mysql gcc perl* mod_perl-devel
这里应该会有No package mysql-server available的异常,解决方式:
step 1: wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
step 2: rpm -ivh mysql-community-release-el7-5.noarch.rpm
经过以上两个步骤后再次执行:yum install mysql-server 命令就可以成功安装了。
3. 配置httpd.conf,增加标红的一行
[root@10 ~]# 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
4. 启动httpd服务,并设置为开机自启
[root@10 ~]# service httpd start
[root@10 ~]# chkconfig httpd on
5. 启动mysql服务
[root@10 ~]# service mysqld start
这里可能会出现启动失败的问题,可以根据mysql的error日志解决,查询mysql日志目录方法:
[root@10 ~]# cat /etc/my.cnf 配置文件中会指定mysql的error log目录
6.配置mysql
首先登陆到mysql
[root@10 ~]# mysql -u root -p
默认不需要密码直接回车,如果无法登陆,报错密码未输出,可以修改mysql配置文件/etc/my.cnf,增加”skip-grant-tables”设置免密登陆
修改密码
mysql> update user set password=passworD("test") where user='root';
mysql> flush privileges;
这里会报错,user表字段缺失,这个是由于mysql版本造成的,需要升级下,忘了怎么写命令了,搜索下...
7. 创建bugzilla需要用到的数据库
mysql> show databases;
mysql> use users;
mysql> create database bugs;
mysql> grant all on bugs.* to root@localhost identified by "password";
mysql> flush privileges;
mysql> quit;
8. 下载并安装bugzilla
[root@10 ~]# tar -xf bugzilla-5.0.tar.gz -C /var/www/html/
[root@10 ~]# cd /var/www/html/
[root@10 ~]# mv bugzilla-5.0 bugzilla
9. 检测bugzilla缺失的组件模块
[root@10 ~]# cd bugzilla
[root@10 ~]# ./checksetup.pl --check-modules
随后会打印一些信息,会看到一些标为not found的缺失组件
10. 在线安装bugzilla缺失的组件
[root@10 ~]# perl install-module.pl --all
执行checksetup.pl后,目录下会生成一个localconfig文件
[root@10 ~]# ./checksetup.pl
11. 编辑localconfig文件,将如下参数设置正确
12. 设置管理员信息和密码。下面的管理员邮箱和密码必须正确,否则会发不出邮件。
[root@10 ~]# ./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.
13. 配置httpd参数,在配置文件最下方添加如下部分。
[root@10 ~]# 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>
14. 编辑.htaccess文件,用#号注释Options -Indexes一行
[root@10 ~]# vi .htaccess
# Options -Indexes
15. 安装依赖,重启服务
[root@10 ~]# /var/www/html/bugzilla/jobqueue.pl start
[root@10 ~]# /var/www/html/bugzilla/jobqueue.pl install
[root@10 ~]# service httpd restart
16. 通过宿主机ip:80访问bugzilla主页
17. 在页面修改发送邮件的管理员邮箱