温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Centos 7 搭建Bugzilla5.0.4

发布时间:2020-07-11 13:28:31 来源:网络 阅读:302 作者:刘小潭 栏目:系统运维

system: Centos 7.6(可以访问yum源)
Buzilla: 5.0.4
Mariadb-server: 5.5.60

  1. 关闭selinux Firewall
    关闭selinux (permissive可以改成disable)
    sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/g' /etc/selinux/config
    关闭Firewall
    systemcstop firewalld.service
    systemc disable firewalld.service

  2. 启用EPEL仓库
    yum install deltarpm epel-release
    yum update
    若内核更新,请重启此机器

  3. 安装环境使用依赖包
    yum install mod_ssl mod_ssl mod_perl mod_perl-deve

  4. 安装apache服务,并启动服务
    查看是否安装apache服务
    [root@bugzillatest bugzilla]# rpm -qa |grep httpd
    httpd-2.4.6-88.el7.centos.x86_64
    httpd-devel-2.4.6-88.el7.centos.x86_64
    httpd-tools-2.4.6-88.el7.centos.x86_64
    apache已经存在,则不需要安装,直接启动apache,如果没有安装则需要使用yum install httpd安装
    systemctl start httpd.service
    systemctl status httpd.service #查看状态
    systemctl enable httpd.service #设置开机启功

  5. 安装mariadb
    centos7引入MariaDB替代MYSQL数据库,Maria作为开源的数据库系统,使用效果与MYSQL不相上下
    yum install mariadb-server mariadb mariadb-devel php-mysql
    systemctl start mariadb.service #开启服务
    systemctl status mariadb.service #查看状态
    systemctl enable mariadb.service #设置开机启动

  6. 设置数据库管理员密码
    mysql -u root
    MariaDB [ (none) ]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('myrootpassword'); #替换myrootpassword为你的密码
    Query OK, 0 rows affected (0.00 sec)
    MariaDB [ (none) ]> \q #退出数据库
    Bye
    用root用户登录进行测试
    mysql -u root -p
    Enter password: myrootpassword
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 5
    Server version: 5.5.41-MariaDB MariaDB Server
    Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    MariaDB [ (none) ]> \q
    Bye

  7. MariaDB设置max_allowed_packet(最大允许传输包的大小)
    为防止服务器端和客户端在一次传送数据包的过程当中,数据包最大值溢出,Bugzilla 要求MariaDB配置最小尺度的max_allowed_packet
    vim /etc/my.cnf
    在[mysqld]部分添加 下面部分:

    Bugzilla

    maximum allowed size of an attachment upload

    #change this if you need more!
    max_allowed_packet=4M #设置最大传输大小4M
    重启MariaDB服务
    systemctl restart mariadb.service

  8. 安装Bugzilla依赖包 (1300个左右)
    yum install gcc gcc-c++ graphviz graphviz-devel patchutils gd gd-devel wget perl* -x perl-homedir

  9. 安装Bugzilla
    (1)配置数据库:
    mysql -u root -p
    Enter password: myrootpassword
    MariaDB [ (none) ]> create database bugs;
    Query OK, 1 row affected (0.00 sec)
    MariaDB [ (none) ]> grant all on bugs.* to bugs@localhost identified by 'youpassword'; #替换youpassword为你的密码
    Query OK, 0 row affected (0.00 sec)
    MariaDB [ (none) ]> \q
    Bye

  10. 下载Bugzilla最新包并安装
    cd /mnt
    wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.4.tar.gz
    tar -zxvf bugzilla-5.0.4.tar.gz
    mkdir /var/www/html/bugzilla
    cp -R ./bugzilla-5.0.4/* /var/www/html/bugzilla/ # 移动bugzilla-5.0到/var/www/html/bugzilla/ 下,/var/www/html/为bugzilla默认的路径,不移动到此路径,浏览器输入网址启动不了bugzilla

  11. 检查bugzilla缺少组件,并进行自动安装
    cd /var/www/html/bugzilla
    ./checksetup.pl #此命令执行后,可看到缺少的组件,并按提示安装
    /usr/bin/perl install-module.pl --all #自动安装缺少的组件
    ./checksetup.pl #再次检查一下,查看是否还有缺少组件,原则上,除了DBD-Oracle没有安装后,其他都应该安装完毕
    此时出现如下一段文字,表示我们配置文件与前面设置有些不一致

  12. 编译./localconfig ,配置成我们自己的环境(主要是数据库名、密码与前面一致)
    vim ./localconfig
    下面是我的配置文件: (Ps: 需要确认bugzilla数据库名跟密码是否跟你创建是一致)
    $create_htaccess = 1;
    $webservergroup = 'apache';
    $use_suexec = 0;
    $db_driver = 'mysql';
    $db_host = 'localhost';
    $db_name = 'bugs';
    $db_user = 'bugs';
    $db_pass = 'youpassword'; #对应第九步你所填的密码
    $db_port = 0;
    $db_sock = '';
    $db_check = 1;
    $db_mysql_ssl_ca_file = '';
    $db_mysql_ssl_ca_path = '';
    $db_mysql_ssl_client_cert = '';
    $db_mysql_ssl_client_key = '';
    $index_html = 0;
    $interdiffbin = '/usr/bin/interdiff';
    $diffpath = '/usr/bin';
    $site_wide_secret = '2qCKjZhkZZRFuy1ueKK6sho8OO1tuXdHp2fihYSG1F127wu0qpjXjjHnVsMBaeTN';
    现在让我们再次运行安装脚本。 现在应该检测正确的数据库配置,并开始访问MariaDB服务器进行最终设置。

  13. 完成Bugzilla注册信息
    ./checksetup.pl

  14. 创建Bugzilla安装脚本
    sed -i 's/^Options -Indexes$/#Options -Indexes/g' ./Bugzilla/.htaccess

  15. 配置Bugzilla安装Apache服务
    Apache默认识别不了Bugzilla,通过创建文件/etc/httpd/conf.d/bugzilla.conf ,把我们的Bugzilla网页系统引入到Apache服务
    vim /etc/httpd/conf.d/bugzilla.conf
    添加下面信息:
    #/etc/httpd/conf.d/bugzilla.conf
    <VirtualHost *:80>
    DocumentRoot /var/www/html/bugzilla
    ServerName www.szmisbugzilla.com
    ErrorLog logs/bugzilla-error_log
    CustomLog logs/bugzilla-access_log common
    <Directory /var/www/html/bugzilla>
    AddHandler cgi-script .cgi
    Options ExecCGI Indexes FollowSymLinks
    DirectoryIndex index.cgi index.html
    AllowOverride None
    </Directory>
    </VirtualHost>

  16. 重启Apache服务:
    systemctl restart httpd.service
    至此,我们就已经成功部署了Bugzilla系统,打开网页,输入http://ip-of-you-server,(ip-of-you-server为你的centos7主机ip)我们可以看到如下界面
    Centos 7 搭建Bugzilla5.0.4
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI