CentOS 6.5 環境下安裝 Bugzilla
阿新 • • 發佈:2019-02-19
1、安裝所需要的元件
[root@bogon ~]# yum -y install httpd mod_ssl mysql-server mysql php-mysql gcc perl* mod_perl-devel2、配置httpd.conf,增加藍色一行,隨後啟動httpd,設定為開機啟動
[root@bogon ~]# 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
[root@bogon ~]# service httpd start
正在啟動 httpd:[確定]
[root@bogon ~]# chkconfig httpd on
[root@bogon ~]#
3、編輯hosts檔案,為主機名配置一個本地IP地址,隨後啟動mysqld服務
[root@bogon ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 bogon
[root@bogon ~]# service mysqld start
初始化 MySQL 資料庫: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h bogon password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[確定]
正在啟動 mysqld: [確定]
[root@bogon ~]# chkconfig mysqld on
[root@bogon ~]#
4、配置mysql
[root@bogon ~]# mysqladmin -u root -p password "123456"
Enter password: 這裡要求輸入之前設定的密碼,由於預設密碼為空,直接回車即可
[root@bogon ~]# mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database bugs;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on bugs.* to root@localhost identified by "123456";
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
[root@bogon ~]#
5、下載並解壓Bugzilla
[root@bogon ~]# tar xf bugzilla-4.4.tar.gz -C /var/www/html/
[root@bogon ~]# cd /var/www/html/
[root@bogon html]# mv bugzilla-4.4/ bugzilla
[root@bogon html]#
6、檢測Bugzilla缺少的元件
[root@bogon html]# cd bugzilla/
[root@bogon bugzilla]# ./checksetup.pl --check-modules
隨後會列印一些資訊,會看到一些標為not found的缺失元件
7、線上安裝Bugzilla缺少的元件(安裝時間較長)
[root@bogon bugzilla]# perl install-module.pl --all
Checking for CPAN (v1.81) ok: found v1.9402
Checking for YAML (any) ok: found v0.70
Checking for ExtUtils-MakeMaker (v6.31) ok: found v6.55_02
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
......
Installing /var/www/html/bugzilla/lib/man/man3/DBD::SQLite::Cookbook.3pm
Installing /var/www/html/bugzilla/lib/man/man3/DBD::SQLite::Fulltext_search.3pm
Installing /var/www/html/bugzilla/lib/man/man3/DBD::SQLite::VirtualTable.3pm
Appending installation info to /var/www/html/bugzilla/lib/x86_64-linux-thread-multi/perllocal.pod
ISHIGAKI/DBD-SQLite-1.48.tar.gz
/usr/bin/make install -- OK
[root@bogon bugzilla]#
8、執行checksetup.pl後,目錄下會生成一個localconfig檔案
[root@bogon bugzilla]# ./checksetup.pl
* This is Bugzilla 4.5.2 on perl 5.10.1
* Running on Linux 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013
Checking perl modules...
Checking for CGI.pm (v3.51) ok: found v3.64
......
Please edit the file ./localconfig and then re-run checksetup.pl
to complete your installation.
[root@bogon bugzilla]#
9、編輯localconfig檔案,將如下引數設定正確
[root@bogon bugzilla]# vi localconfig
# The DNS name or IP address of the host that the database server runs on.
$db_host = 'localhost';
# The name of the database. For Oracle, this is the database's SID. For
# SQLite, this is a name (or path) for the DB file.
$db_name = 'bugs';
# Who we connect to the database as.
$db_user = 'root';
# Enter your database password here. It's normally advisable to specify
# a password for your bugzilla database user.
# If you use apostrophe (') or a backslash (\) in your password, you'll
# need to escape it by preceding it with a '\' character. (\') or (\)
# (It is far simpler to just not use those characters.)
$db_pass = '123456';
# Sometimes the database server is running on a non-standard port. If that's
# the case for your database server, set this to the port number that your
# database server is running on. Setting this to 0 means "use the default
# port for my database server."
$db_port = 3306;
10、設定管理員資訊和密碼。下面的管理員郵箱和密碼必須正確,否則會發不出郵件。
[root@bogon bugzilla]# ./checksetup.pl
* This is Bugzilla 4.5.2 on perl 5.10.1
......
Enter the e-mail address of the administrator: Bugzilla 管理員賬號@163.com # bugzilla 管理員郵箱
Enter the real name of the administrator: Bugzilla 管理員賬號
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.
[root@bogon bugzilla]#
11、配置httpd引數,進入編輯器後按Shift + g鍵將游標移動到最下行,增加藍色部分的配置
[root@bogon bugzilla]# vi /etc/httpd/conf/httpd.conf
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin [email protected]
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<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>
12、編輯.htaccess檔案,用井號註釋Options -Indexes一行
[root@bogon bugzilla]# vi .htaccess
# Options -Indexes
13、配置郵箱
[root@bogon ~]# vi /var/www/html/bugzilla/data/params
...
'mail_delivery_method' => 'SMTP',
'mailfrom' => 'Bugzilla發件箱@163.com ',
'maintainer' => 'Bugzilla發件箱@163.com ',
...
'smtp_password' => '輸入Bugzilla發件箱的登入密碼',
'smtp_ssl' => 0,
'smtp_username' => ' Bugzilla發件箱@163.com ',
'smtpserver' => 'smtp.163.com',
...
'urlbase' => 'http://192.168.x.x', # 輸入bugzilla伺服器的地址,如果有域名就填寫域名
'use_mailer_queue' => 1,
...
[root@bogon ~]# /var/www/html/bugzilla/jobqueue.pl start
Starting jobqueue.pl server
[root@bogon ~]# /var/www/html/bugzilla/jobqueue.pl install
bugzilla-queue installed. To start the daemon, do "/etc/init.d/bugzilla-queue start" as root.
14、漢化
將中文漢化包解壓到 /var/www/html/bugzilla/template/ 目錄下,此時該目錄下會生成zh-CN資料夾。重新訪問bugzilla,此時已經被漢化。
[root@bogon bugzilla]# cd /var/www/html/bugzilla/template/
將漢化包拷貝到 /var/www/html/bugzilla/template/ 目錄下
[root@bogon template]# tar xzvfm bugzilla.zh-CN.4.4rc2.20130528.tar.gz
[root@bogon template]# rm bugzilla.zh-CN.4.4rc2.20130528.tar.gz
15、重啟httpd服務
[root@bogon bugzilla]# service httpd restart
停止 httpd:[確定]
正在啟動 httpd:[確定]
16、傳送郵件進行郵箱的配置驗證(親測通過)