天天看點

Ubuntu11.10上的bugzilla搭建1 bugzilla下載下傳和安裝2 安裝和配置mysql3 安裝和配置apache4 一些問題

轉載請注明出處,謝謝!

1 bugzilla下載下傳和安裝

http://www.bugzilla.org/download/#stable

備注:通過Ubuntu的apt-get可以安裝bugzilla3,但本人最終沒有用bugzilla3,而是用最新的bugzilla4.2.1。

将bugzilla解壓至/usr/share/bugzilla4:

#sudo tar -C /usr/share/bugzilla4 -zxvf bugzilla-4.2.1.tar.gz

#cd /usr/share/bugzilla4

#./checksetup.pl --check-modules

檢視有哪些perl子產品未安裝。按照其提示安裝必選子產品。

安裝完成必選perl子產品後,運作:

#./checksetup.pl

如果執行成功,會在目前目錄下生成localconfig檔案。

修改localconfig檔案:

$webservergroup = 'www-data';

2 安裝和配置mysql

#sudo apt-get install mysql-server

localconfig中,預設的mysql資料庫名稱為bugs,使用者名為bugs,密碼為空:

# 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 = 'bugs';

# 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 = '';

是以我們需要添加一個bugs的mysql資料管理者使用者,并建立一個名為bugs的資料庫來儲存bugzilla送出的bugs:

#mysql -u root -p

輸入root密碼,進行mysql指令行界面:

mysql->grant all on *.* to [email protected] identified by '';

mysql->flush privileges;

mysql->CREATE DATABASE bugs;

mysql->exit;

3 安裝和配置apache

#sudo apt-get install apache2

在/etc/apache2/conf.d目錄下增加一個vhost配置:

#<VirtualHost *:80>

    Alias /bugzilla4 /usr/share/bugzilla4

    <Directory "/usr/share/bugzilla4">

        AddHandler cgi-script cgi

        DirectoryIndex index.cgi

        Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch +FollowSymLinks

        AllowOverride None

        Order allow,deny

        Allow from all

    </Directory>

    <Directory "/usr/share/bugzilla4data">

        Options +FollowSymLinks -Indexes

        AllowOverride None

        Order allow,deny

        Allow from all

    </Directory>

    <Directory "/usr/share/bugzilla4/js">

        Options +FollowSymLinks -Indexes

        AllowOverride None

        Order allow,deny

        Allow from all

    </Directory>

    <Directory "/usr/share/bugzilla4/skins">

        Options +FollowSymLinks -Indexes

        AllowOverride None

        Order allow,deny

        Allow from all

    </Directory>

#</VirtualHost>

這樣就可以用http://SERVER/bugzilla4來通路bugzilla了。

4 一些問題

如果碰到中文亂碼,可以這樣解決:

vim/usr/share/perl5/Bugzilla/CGI.pm,

強制設定UTF-8:self->charset(''UTF-8'')