2016年11月14日 星期一

RHEL 7.2 安裝 Bugzilla

RHEL 7.2 安裝 Bugzilla

以下過程皆使用root身分




1.先設定 CentOS 的yum 安裝套件
可參考此連結 RedHat 設定使用Centos yum 安裝套件

2.關閉selinux與設定防火牆80 port
vim /etc/selinux/config
SELINUX=disabled

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

3.安裝epel套件
yum install deltarpm epel-release
yum update

4.安裝Apache與相關套件
yum install httpd httpd-devel mod_ssl mod_ssl mod_perl mod_perl-devel

5.啟動http server
systemctl start httpd.service
查看狀態(如出現running即是成功)
systemctl status httpd.service
開機自動運行httpd
systemctl enable httpd.service

6.安裝MySQL資料庫
yum install mariadb-server mariadb mariadb-devel php-mysql

systemctl start mariadb.service
systemctl status mariadb.service
systemctl enable mariadb.service

7.MySQL設定
mysql -u root
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');
\q
測試可否登入
mysql -u root -p
Enter password: 123456
\q

vim /etc/my.cnf
將以下設定加入
# Bugzilla
# maximum allowed size of an attachment upload
#change this if you need more!
max_allowed_packet=4M

會變成以下這樣
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

# Bugzilla
# maximum allowed size of an attachment upload
#change this if you need more!
max_allowed_packet=4M

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


重啟MySQL
systemctl restart mariadb.service

8.安裝其他套件
yum install gcc gcc-c++ graphviz graphviz-devel patchutils gd gd-devel wget perl* -x perl-homedir

9.建立MYSQL資料庫bugs
mysql -u root -p
Enter password: 123456

MariaDB [ (none) ]> create database bugs;
MariaDB [ (none) ]> grant all on bugs.* to bugs@localhost identified by 'bugs';
MariaDB [ (none) ]> \q


10.下載bugzilla
# cd
# wget 'https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.tar.gz'

# tar -xzvf bugzilla-5.0.tar.gz
# cd
# cp -R ./bugzilla-5.0/ /var/www/html/bugzilla/


#cd /var/www/html/bugzilla
使用指令檢查套件是否都有安裝
# ./checksetup.pl
# /usr/bin/perl install-module.pl --all --global
# ./checksetup.pl

少了以下套件,需要另外安裝
# /usr/bin/perl install-module.pl mod_perl2


# vim ./localconfig
檢查以下資訊
$create_htaccess = 1;
$webservergroup = 'apache';
$use_suexec = 0;
$db_driver = 'mysql';
$db_host = 'localhost';
$db_name = 'bugs';
$db_user = 'bugs';
$db_pass = 'bugs';
$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 = '/bin/interdiff';
$diffpath = '/bin';
$site_wide_secret = 'ifKuihguW8nlxLcxeNU4whHzFbxDIGWSvtR6S7Ul38cFQn004YDcVzuBJfnF8M9X';


再執行
# ./checksetup.pl


Enter the e-mail address of the administrator: rank.hsu@toplogis.com
Enter the real name of the administrator: rank.hsu
Enter a password for the administrator account: 123123123
Please retype the password to verify: 123123123
rank.hsu@toplogis.com is now set up as an administrator.




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

# 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 All
</Directory>




# vim /etc/httpd/conf/httpd.con
新增以下
ServerName localhost



# systemctl restart httpd.service

重新開機(selinux 會擋住)










沒有留言:

張貼留言