環境: CentOS 7 x64

步驟

1. 安裝 Package

yum -y install mariadb mariadb-server mariadb-libs mariadb-devel httpd mod_dav_svn
yum -y install mod_perl mod_perl-devel httpd-devel gd-devel mysql-devel rst2pdf graphviz patchutils gcc 'perl(Apache2::SizeLimit)' 'perl(Authen::Radius)' 'perl(Authen::SASL)' 'perl(Cache::Memcached)' 'perl(CGI)' 'perl(Chart::Lines)' 'perl(Daemon::Generic)' 'perl(Date::Format)' 'perl(DateTime)' 'perl(DateTime::TimeZone)' 'perl(DBI)' 'perl(Digest::SHA)' 'perl(Email::MIME)' 'perl(Email::MIME::Attachment::Stripper)' 'perl(Email::Reply)' 'perl(Email::Sender)' 'perl(Encode)' 'perl(Encode::Detect)' 'perl(File::MimeInfo::Magic)' 'perl(File::Slurp)' 'perl(GD)' 'perl(GD::Graph)' 'perl(GD::Text)' 'perl(HTML::FormatText::WithLinks)' 'perl(HTML::Parser)' 'perl(HTML::Scrubber)' 'perl(IO::Scalar)' 'perl(JSON::RPC)' 'perl(JSON::XS)' 'perl(List::MoreUtils)' 'perl(LWP::UserAgent)' 'perl(Math::Random::ISAAC)' 'perl(MIME::Parser)' 'perl(mod_perl2)' 'perl(Net::LDAP)' 'perl(Net::SMTP::SSL)' 'perl(PatchReader)' 'perl(SOAP::Lite)' 'perl(Template)' 'perl(File::Which)' 'perl(Template::Plugin::GD::Image)' 'perl(Test::Taint)' 'perl(TheSchwartz)' 'perl(URI)' 'perl(XMLRPC::Lite)' 'perl(XML::Twig)'
yum -y install perl-CPAN perl-Module-Build 'perl(autodie)'

2. 設定防火牆, httpd, 以及 Mariadb

systemctl start httpd
systemctl enable httpd
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload
systemctl start mariadb
systemctl enable mariadb
mysqladmin -u root password '<root的密碼>'
mysql -u root -p
create database bugs;
grant all on bugs.* to bugs@localhost;
set password for bugs@localhost = PASSWORD('<bugs的密碼>');
flush privileges;
exit;

3. 下載並安裝 Bugzilla 5.0.2

wget https://ftp.mozilla.org/pub/mozilla.org/webtools/b...
cd /var/www/html
tar -xvzf ~/bugzilla-5.0.2.tar.gz
mv bugzilla-5.0.2 bugzilla
cd bugzilla
./checksetup.pl --check-modules
./install-module.pl --all # 這個程序會很久
./checksetup.pl --check-modules # 會剩下 mod_perl2 Apache2::SizeLimit 兩個未安裝, 不用理會
./checksetup.pl # 產生 localconfig 檔

4. 編輯設定檔, 並開始安裝

vi localconfig

# 改變以下參數
# $create_htaccess = 0;
# $db_name = 'bugs';
# $db_user = 'bugzs';
# $db_pass = '<bugzs的密碼>';

./checksetup.pl

# Enter the e-mail address of the administrator: pdmadmin@APITECH.com.tw
# Enter the real name of the administrator: PDM Admin
# Enter a password for the administrator account:
# Please retype the password to verify:

5. 權限設定

chown -R apache.apache /var/www/html/bugzilla
chcon -R -t httpd_sys_rw_content_t /var/www/html/bugzilla
chcon -R -t httpd_sys_content_t /var/www/html/bugzilla
chcon -R -t httpd_sys_script_exec_t /var/www/html/bugzilla # 讓惱人的 SELinux 不會造成困擾
chcon -R -t httpd_sys_script_rw_t /var/www/html/bugzilla/data
setsebool -P httpd_can_sendmail on
setsebool -P httpd_can_network_connect on

6. httpd 設定

cat > /etc/httpd/conf.d/bugzilla.conf <<EOF
<Directory /var/www/html/bugzilla>
    AddHandler cgi-script .cgi
    Options +ExecCGI +FollowSymLinks
    DirectoryIndex index.cgi index.html
    AllowOverride All
</Directory>

EOF
systemctl restart httpd

創作者介紹

Egg Chang 的部落格

Egg Chang 發表在 痞客邦 PIXNET 留言(0) 人氣()