转载请注明出处,谢谢!
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';
#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 bugs@localhost identified by '';
mysql->flush privileges;
mysql->CREATE DATABASE bugs;
mysql->exit;
#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了。
如果碰到中文乱码,可以这样解决:
vim/usr/share/perl5/Bugzilla/CGI.pm,
强制设置UTF-8:self->charset(''UTF-8'')