Centos7安裝搭建Bugzilla 5.0

一、安裝準備:php

Centos7保證網絡連通,若是網絡不能連通,可經過配置yum源使用代理服務。html

vim /etc/yum.confmysql

# The proxy server - proxy server:port
proxy=http://192.168.178.1:8080
# The account details for yum connections
# proxy_username=yum-user
# proxy_password=qwertylinux

二、關閉SELinux、防火牆c++

sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/g' /etc/selinux/configweb

 systemctl stop firewalld.servicesql

 systemctl disable firewalld.service數據庫

centos7默認防火牆爲firewalld,若已經安裝iptables,可關閉iptables或者打開80端口,否則後續http請求失敗apache

 iptables -I INPUT -p tcp --dport 80 -j ACCEPTvim

 service iptables save

  service iptables restart

三、執行如下命令啓用EPEL倉庫

yum install deltarpm epel-release

yum update 

若內核更新,reboot重啓虛擬機

四、安裝環境使用依賴包

yum install  mod_ssl mod_ssl mod_perl mod_perl-devel

五、安裝apache服務,並啓動服務

systemctl start httpd.service

systemctl status httpd.service       #查看狀態

systemctl enable httpd.service      #設置開機啓功

apache服務開啓後,打開瀏覽器,輸入http://ip-of-your-server/ ,若看到testing123界面,表明Apache已經開啓

六、安裝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   #設置開機啓動

七、設置數據庫root管理員密碼

 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
八、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
九、安裝Bugzilla依賴包
yum install gcc gcc-c++ graphviz graphviz-devel patchutils gd gd-devel wget perl* -x perl-homedir
十、安裝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 'bugsuserpassword';
Query OK, 0 row affected (0.00 sec)
MariaDB [ (none) ]> \q
Bye
(2)下載Bugzilla最新包並安裝
wget 'https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.tar.gz'
tar -xzvf bugzilla-5.0.tar.gz
cd bugzilla-5.0
cp -R ./bugzilla-5.0/ /var/www/html/bugzilla/       # 移動bugzilla-5.0到/var/www/html/bugzilla/ 下,/var/www/html/爲bugzilla默認的路徑,不移動到此路徑,瀏覽器輸入網址啓動不了bugzilla
(3)檢查bugzilla缺乏組件,並進行自動安裝
 cd /var/www/html/bugzilla
./checksetup.pl          #此命令執行後,可看到缺乏的組件,並按提示安裝
/usr/bin/perl install-module.pl --all                  #自動安裝缺乏的組件
./checksetup.pl       #再次檢查一下,查看是否還有缺乏組件,原則上,除了DBD-Oracle沒有安裝後,其餘都應該安裝完畢
此時出現以下一段文字,表示咱們配置文件與前面設置有些不一致

(4)編譯./localconfig ,配置成咱們本身的環境(主要是數據庫名、密碼與前面一致)

vim ./localconfig             

下面是個人配置文件:

(5)完成Bugzilla註冊信息

  ./checksetup.pl     

(6)建立Bugzilla安裝腳本

sed -i 's/^Options -Indexes$/#Options -Indexes/g' ./.htaccess

 十、配置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/
</VirtualHost>
<Directory /var/www/html/bugzilla>
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes
</Directory>

 重啓Apache服務:

systemctl restart httpd.service

至此,咱們就已經成功部署了Bugzilla系統,打開網頁,輸入http://ip-of-you-server,(ip-of-you-server爲你的centos7主機ip)咱們能夠看到以下界面

相關文章
相關標籤/搜索