Bugzilla安装

[root@bugzilla bugzilla-4.2]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 6.1 (Santiago)

 

Bugzilla中还需要安装WWW::Bugzilla   BZ::Client  Config::IniFiles

 

[root@bugzilla ~]# ls

anaconda-ks.cfg      httpd-2.2.22.tar.gz  ISO

bugzilla-4.2.tar.gz  install.log          mysql-5.1.61.tar.gz

httpd-2.2.22         install.log.syslog   subversion-1.7.4.tar.gz

sqlite-autoconf-3071100.tar.gz  Apache-SizeLimit-0.96.tar.gz

 

[root@bugzilla ~]# cd httpd-2.2.22

 

[root@bugzilla httpd-2.2.22]# yum install gcc

 

[root@bugzilla httpd-2.2.22]# ./configure --prefix=/opt/apache --enable-so --with-mpm=worker --enable-dav --enable-dav-fs --enable-rewrite && make && make install

 

[root@bugzilla httpd-2.2.22]# yum install libtermcap-devel

 

[root@bugzilla httpd-2.2.22]# yum install gcc-c++

 

[root@bugzilla ~]# tar xf mysql-5.1.61.tar.gz && cd mysql-5.1.61

 

[root@bugzilla mysql-5.1.61]# useradd mysql -s /sbin/nologin

 

[root@bugzilla mysql-5.1.61]# ./configure --prefix=/opt/mysql  --localstatedir=/DB/mysql_db --with-charset=gdk,utf8,gb2312 --enable-thread-safe-client --with-plugins=innobase --with-extra-charsets=all   --with-pthread  --with-big-tables && make && make install

 

[root@bugzilla bugzilla-4.2]# yum install perl-DBD-MySQL

 

 

########subversion编译时 需要sqlite

########

configure: checking sqlite library

checking sqlite amalgamation... no

checking sqlite3.h usability... no

checking sqlite3.h presence... no

checking for sqlite3.h... no

checking sqlite library version (via pkg-config)... no

 

An appropriate version of sqlite could not be found.  We recommmend

3.7.6.3, but require at least 3.6.18.

Please either install a newer sqlite on this system

 

or

 

get the sqlite 3.7.6.3 amalgamation from:

    http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz

unpack the archive using tar/gunzip and copy sqlite3.c from the

resulting directory to:

/root/subversion-1.7.4/sqlite-amalgamation/sqlite3.c

 

configure: error: Subversion requires SQLite

 

因此需要将sqlite复制到subversion目录中去一同编译

#######编译subversion时需要有zlib库文件

#######

checking for zlib.h... no

configure: error: subversion requires zlib

#######

因此安装zlib-devel

 

[root@bugzilla ~]# tar xf subversion-1.7.4.tar.gz

[root@bugzilla ~]# cd subversion-1.7.4

[root@bugzilla ~]# tar xf sqlite-autoconf-3071100.tar.gz

[root@bugzilla ~]# cp -pr sqlite-autoconf-3071100 subversion-1.7.4/sqlite-amalgamation

[root@bugzilla ~]# yum install zlib-devel

[root@bugzilla subversion-1.7.4]# ./configure --prefix=/opt/subversion --with-apsx=/opt/apache/bin/apxs  --with-apr=/opt/apache --with-apr-util=/opt/apache && make && make install

 

[root@bugzilla ~]# cp -pr bugzilla-4.2 /opt/apache/htdocs/bugzilla

[root@bugzilla ~]# cd /opt/apache/htdocs/bugzilla/

[root@bugzilla bugzilla]# ./checksetup.pl –modules

[root@bugzilla bugzilla]# cpan YAML

[root@bugzilla bugzilla]# vi install-module.pl

use Data::Dumper;

use Getopt::Long;

use Pod::Usage;

use YAML;

####use YAML;为手工加入

[root@bugzilla bugzilla]#yum install mod_perl mod_perl-devel

 

[root@bugzilla bugzilla]# /usr/bin/perl install-module.pl –all

[root@bugzilla support-files]# pwd

/root/mysql-5.1.61/support-files

[root@bugzilla support-files]# cp my-innodb-heavy-4G.cnf /etc/my.cnf

[root@bugzilla support-files]#vi /etc/my.cnf

     [mysqld]

    ###Allow small words in full-text indexes

    ft_min_word_len=2

        注释掉skip-innodb

        开启default_storage_engine=innodb

[root@bugzilla support-files]#/op/mysql/bin/mysql_install_db --user=mysql&

[root@bugzilla support-files]# /op/mysql/bin/mysqld_safe &

 

 

Mysql>show engines;

        Innodb

创建权限参考下面官网

www.bugzilla.org/docs/4.2/en/html/configuration.html

mysql>grant all on bugs.* to bugs@”%” identified by ‘bugs’;

mysql>flush privileges;

mysql>use $bugs_db;

mysql>alter table attachments AVG_ROW_LENGTH=1000000,MAX_ROWS=20000;

 

配置apache

Vi httpd.conf

<Directory />

    Options FollowSymLinks

    AllowOverride None

##    Order deny,allow

##    Deny from all

##    Allow from all

</Directory>

 

<Directory /opt/apache/htdocs/bugzilla>

    AddHandler cgi-script .cgi

    options +Indexes +ExecCGI

    DirectoryIndex index.cgi

    AllowOverride   Limit FileInfo Indexes

    Order allow,deny

    Allow from all

</Directory>

 

 

vi .htaccess

<FilesMatch ^(.*\.pm|.*\.pl|.*localconfig.*)$>

    deny from all

</FilesMatch>

 

创建多个bugzilla项目

Mysql中分别创建用户: 用户1

                        用户2

设置环境变量:Set PROJECT=proj1

执行 Perl checksetup.pl##会在bugzilla目录下生成一个localconfig.proj1的配置文件

bugzilla目录下的/template/en/default 复制成另一个/template/en/proj1

修改bugzilla下的localconfig.proj1 修改必要的参数

#####修改参数是特别要注意用户的组,一定要跟原先那个localconfig文件中的组一样

再次执行perl checksetup.pl

 

Apache中需要添加

Alias /proj1 /opt/apache/htdocs/bugzilla

<Location /proj1>

    SenEnv PROJECT proj1

</Location >

 

<Location /bugzilla>

    SenEnv PROJECT bugzilla

</Location >

示例:

 修改 apache 的配置文件并重启服务

 # 这一段需要在原来的基础上添加

    Alias /test /opt/apache/htdocs/bugzilla

    <Location /test> 

    SetEnv PROJECT test

    </Location> 


    # 这一段还是按照原来的不变的 

    <Directory /opt/apache/htdocs/bugzilla>

  ....

  ....

  ....

    </Directory>


  # 先设置下 shell 的环境变量

    bugzilla目录> export PROJECT=test


    # 刷新目录权限 和 配置文件

    bugzilla目录> perl checksetup.pl


测试:http://ip/proj1      http://ip/bugzilla