您的位置:首页 > 其它

ubuntu 中安装bugzilla详细步骤

2010-09-25 19:51 453 查看
首先本安装过程按照bugzilla提供的文档向导进行安装,结合本人的安装经验进行总结;

1.下载bugzilla源代码稳定版 http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.6.2.tar.gz,可以选择安装中文版,但是目前只支持到3.4.3(http://code.google.com/p/bugzilla-cn/)
sudo wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.6.2.tar.gz
解压 sudo tar zxvf bugzilla-3.6.2.tar.gz

2.按照安装向导中说明,需要预先安装一下几个软件

Perl(V5.8.1以上)

数据库引擎(Mysql/postgresql/Oracle)

Web服务器

Perl Moudles(Perl 模块)

Mail Transfer Agent

3.Perl一般是系统自带
,如果没有或者版本不符合要求,请自行安装,或者apt-get install

用Perl -v查看perl版本信息

4.安装数据库引擎Mysql

下载Mysql源代码,http://www.mysql.com/downloads/mysql/#downloads

sudo groupadd mysql

useradd -g mysql mysql

sudo tar zxvf mysql-5.1.50.tar.gz

cd mysql-5.1.50

./configure --prefix=/usr/local/mysql --with-plugins=all(--with-plugins如果不配置默认为none,没有插件安装,可选项为none max max-no-ndb all,如果想安装某一个插件,--with-plugins=pluginname1,pluginname2,本安装中安装所有插件)

./configure --prefix=/app/mysql/ --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=all

sudo make

sudo make install

注意:在编译时候可能遇到一些错误,

checking for termcap functions library解决方法 apt-get install libncurses5-dev../depcomp:

exec: g++: not found 解决方法apt-get install g++

sudo cp support-files/my-medium.cnf /etc/my.cnf

cd /usr/local/mysql

sudo chown -R mysql .

sudo chgrp -R mysql .

sudo bin/mysql_install_db --user=mysql

sudo chown -R root .

sudo chown -R mysql var

sudo bin/mysqld_safe --user=mysql &

配置mysql自启动

cp mysql.server /etc/init.d/mysql

chmod +x /etc/init.d/mysql

cd /etc

ln -s rc.d/init.d .

chkconfig --add mysql 如果没有chkconfig apt-get install即可

如果想用Postgresql数据库,需要安装postgresql

参见******Postgresql安装过程

添加环境变量
:本安装中使用全局环境变量,sudo gedit /etc/environment,在path后添加mysql/bin的路径即可,然后resource /etc/environment即可使用。

编辑/etc/my.cnf

[mysqld]

# Allow packets up to 4MB

max_allowed_packet=4M

[mysqld]

# Allow small words in full-text indexes

ft_min_word_len=2

5.安装web服务器

下载httpd-2.2.16

tar zxvf httpd-2.2.16.tar.gz

cd httpd-2.2.16

sudo ./configure --prefix=/usr/local/apache

sudo make

sudo make install

sudo groupadd apache

sudo useradd -g apache apache

自启动

sudo cp /usr/local/apache/bin/apachectl /etc/init.d/apache

chmod +x /etc/init.d/apache

chkconfig --add apache

6.安装perl模块

cd **/bugzilla-3.6.2

./checksetup.pl --check-modules

查看要运行bugzilla需要的必须perl模块或者可选模块,如果显示为红色表示没有找到not found。它会提示使用什么命令进行安装

使用perl install-module.pl --all命令安装所有not found的perl 模块

当然也存在一些安装不上的情况,这时要自己安装,我安装时候存在dbd::mysql,和mod-perl2 安装不成功,到cpan上下载需要的模块安装

安装dbd::mysql

sudo perl Makefile.PL --mysql_config=/app/mysql/bin/mysql_config --with-mysql=/app/mysql

报错

Argument "6.55_02" isn't numeric in numeric ge (>=) at Makefile.PL line 350, <PIPE> line 102.

Unrecognized argument in LIBS ignored: '-rdynamic'

Using DBI 1.614 (for perl 5.010001 on i486-linux-gnu-thread-multi) installed in /usr/local/lib/perl/5.10.1/auto/DBI/Writing Makefile for DBD::mysql

但是sudo make test ,make ,make install 成功安装

安装mod-perl2
wget http://perl.apache.org/dist/mod_perl-2.0.4.tar.gz
tar zxvf mod_perl-2.0.4.tar.gz

cd mod_perl-2.0.4

动态安装过程,先安装好apache再安装mod_perl

perl Makefile.PL MP_APXS=/path/to/apxs

make

报错:/usr/bin/ld: cannot find -lperl 解决方法sudo apt-get install libperl-dev

make && make install

详细过程可以参见http://perl.apache.org/docs/2.0/user/install/install.html

7.Mail Transfer Agent安装

sudo apt-get install postfix

配置一下即可使用

如果想详细了解postfix可以参考http://wiki.ubuntu.org.cn/UbuntuHelp:Postfix/zh安装方法。

8.配置

本安装中使用mysql作为bugzilla数据库,首先需要建立database

mysql -u root -p

create database bugs;

建立用户

mysql> GRANT SELECT, INSERT,

UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,

CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*

TO bugs@localhost IDENTIFIED BY 'password';

mysql> FLUSH PRIVILEGES;

配置httpd.conf

添加

<Directory /var/www/html/bugzilla>

AddHandler cgi-script .cgi

Options +Indexes +ExecCGI

DirectoryIndex index.cgi

AllowOverride Limit

</Directory>

LoadModule perl_module modules/mod_perl.so

创建bugzilla数据库表

cd **/bugzilla-3.6.2

./checksetup.pl会生成localconfig,修改$db_driver='mysql'/'Pg'/'oracle',$db_host='localhost'(或者主机的ip地址),$db_name = 'bugs';$db_user = 'bugs';$db_pass = 'password';$db_port = 3306;$webservergroup = 'apache'(因为在第5步安装web服务器时建立了group,所以这里使用建立的apache)保存之后再一次执行./checksetup.pl这次会根据localconfig文件生成相应数据库表

根据提示可以知道是成功执行与否,如果执行成功之后执行操作

mysql> use $bugs_db

mysql> ALTER TABLE attachments

AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;(目的是允许附件表增长超过4gb)

9.sudo cp -r **/bugzilla **/apache/htdocs/bugzilla

完成以上所有过程bugzilla安装完成,运行http://localhost/bugzilla显示界面。OK!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: