Linux下bugzilla的安装方法

来源:互联网 发布:十堰网络推广学校 编辑:程序博客网 时间:2024/05/22 04:34
       
-------------------------
Linux下bugzilla的安装方法
-------------------------


---------------------------------------------------------
1.应该先准备好所有支撑运行bugzilla的perl modules文件

可以从全球最大的perl文件整理站www.cpan.org下载,然后进行安装
---------------------------------------------------------

 

(1 - A) 在bugzilla的解压目录下运行checksetup.pl文件检查模块的安装情况,如下:
---------------------------------------------------------


[root@dai bugzilla-2.22.1]# perl checksetup.pl
Checking perl modules ...
Checking for       AppConfig (v1.52)    not found
Checking for             CGI (v2.93)    not found
Checking for    Data::Dumper (any)     ok: found v2.12
Checking for    Date::Format (v2.21)    not found
Checking for             DBI (v1.38)    not found
Checking for      File::Spec (v0.84)    found v0.83
Checking for      File::Temp (any)     ok: found v0.13
Checking for        Template (v2.10)    not found
Checking for      Text::Wrap (v2001.0131) ok: found v2001.0929
Checking for    Mail::Mailer (v1.67)    not found
Checking for    MIME::Base64 (v3.01)    found v2.12
Checking for    MIME::Parser (v5.406)   not found
Checking for        Storable (any)     ok: found v2.06

The following Perl modules are optional:
Checking for              GD (v1.20)    not found
Checking for Template::Plugin::GD::Image (any)      not found
Checking for     Chart::Base (v1.0)     not found
Checking for       XML::Twig (any)     ok: found v3.09
Checking for       GD::Graph (any)      not found
Checking for GD::Text::Align (any)      not found
Checking for     PatchReader (v0.9.4)   not found
Checking for   Image::Magick (any)      not found
Checking for    HTML::Parser (v3.40)    found v3.26
Checking for  HTML::Scrubber (any)      not found

If you you want to see graphical bug charts (plotting historical data over
time), you should install libgd and the following Perl modules:

GD:          /usr/bin/perl -MCPAN -e 'install "GD"'
Chart:       /usr/bin/perl -MCPAN -e 'install "Chart::Base"'

If you want to convert BMP image attachments to PNG to conserve
disk space, you will need to install the ImageMagick application
Available from http://www.imagemagick.org, and the Image::Magick
Perl module by running (as root):

   /usr/bin/perl -MCPAN -e 'install "Image::Magick"'

If you you want to see graphical bug reports (bar, pie and line charts of
current data), you should install libgd and the following Perl modules:

GD:              /usr/bin/perl -MCPAN -e 'install "GD"'
GD::Graph:       /usr/bin/perl -MCPAN -e 'install "GD::Graph"'
GD::Text::Align: /usr/bin/perl -MCPAN -e 'install "GD::Text::Align"'
Template::Plugin::GD: /usr/bin/perl -MCPAN -e 'install "Template::Plugin::GD"'

If you want to see pretty HTML views of patches, you should install the
PatchReader module:
PatchReader: /usr/bin/perl -MCPAN -e 'install "PatchReader"'
If you want additional HTML tags within product and group descriptions,
you should install:
HTML::Scrubber: /usr/bin/perl -MCPAN -e 'install "HTML::Scrubber"'
HTML::Parser: /usr/bin/perl -MCPAN -e 'install "HTML::Parser"'

Bugzilla requires some Perl modules which are either missing from
your system, or the version on your system is too old.
They can be installed by running (as root) the following:
   /usr/bin/perl -MCPAN -e 'install "MIME::Parser"'
   Minimum version required: 5.406
   /usr/bin/perl -MCPAN -e 'install "File::Spec"'
   Minimum version required: 0.84
   /usr/bin/perl -MCPAN -e 'install "Template"'
   Minimum version required: 2.10
   /usr/bin/perl -MCPAN -e 'install "Date::Format"'
   Minimum version required: 2.21
   /usr/bin/perl -MCPAN -e 'install "CGI"'
   Minimum version required: 2.93
   /usr/bin/perl -MCPAN -e 'install "Mail::Mailer"'
   Minimum version required: 1.67
   /usr/bin/perl -MCPAN -e 'install "MIME::Base64"'
   Minimum version required: 3.01
   /usr/bin/perl -MCPAN -e 'install "AppConfig"'
   Minimum version required: 1.52
   /usr/bin/perl -MCPAN -e 'install "DBI"'
   Minimum version required: 1.38

你会发现有一大堆perl modules not found!
你还会发现这个安装检查文件,告诉我们如何去安装那些没有的perl modules。如:
GD:          /usr/bin/perl -MCPAN -e 'install "GD"'

上面提示告诉我们可以从CPAN仓库安装它,使用CPAN命令:

perl -MCPAN -e 'install "模块名称"'

为需要安装的每一个perl modules模块执行这个命令。如果你已经连接到internet,那么它会自动地下载和安装所需要的模块。

注意:安装完每一个perl modules后,都要重新运行checksetup.pl脚本。

如果一切正常,你应该可以看到提示所有perl modules都安装完成的输出。


(1 - B) 开始安装没有的perl modules
---------------------------------------------------------


perl程序的安装都要经过:
-----------------------
perl Makefile.PL
make
make test                  //可省
make install
-----------------------

下面开始逐个安装:

Linux下大部分的软件都是以源代码的形式发布的,用户需要自行编译安装,以下采用编译安装的方式:

1)AppConfig (v1.52)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf AppConfig-1.65.tar.gz

2)CGI (v2.93)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf CGI.pm-3.29.tar.gz

3)Data::Dumper,任意版本
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf Data-Dumper-2.121.tar.gz

4)Date::Format (v2.21)
----------------------------------
[perl模块压缩包所在目录]# tar -zxvf TimeDate-1.16.tar.gz

5)DBI (v1.38)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf DBI-1.58.tar.gz

6)File::Spec (v0.84)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf PathTools-3.25.tar.gz

7)Template (v2.10)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf Template-Toolkit-2.19.tar.gz

8)Mail::Mailer (v1.67)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf MailTools-1.77.tar.gz

9)MIME::Base64 (v3.01)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf MIME-Base64-3.07.tar.gz

10)MIME::Parser (v5.406)
----------------------------------
依赖模块IO::Stringy
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf IO-stringy-2.110.tar.gz
----------------------------------
安装本模块
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf MIME-tools-5.420.tar.gz

11)GD (v1.20)
----------------------------------
依赖模块Autoconfig
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf autoconf-2.59.tar.tar

查看INSTALL文件,了解安装信息

./configure
make
make check
make install
----------------------------------
依赖模块gd
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf gd-2.0.35.tar.gz

查看INSTALL文件,了解安装信息

./configure
make
make check
make install
----------------------------------
安装本模块
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf GD-2.35.tar.gz

12)Template::Plugin::GD::Image (any)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf Template-GD-2.66.tar.gz

13)Chart::Base (v1.0)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf Chart-2.4.1.tar.gz

14)GD::Graph (any)
依赖模块GD::Text
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf GDTextUtil-0.86.tar.gz
----------------------------------
安装本模块
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf GDGraph-1.44.tar.gz

15)PatchReader (v0.9.4)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf PatchReader-0.9.5.tar.gz

16)Image::Magick (any)
----------------------------------
依赖模块zlib
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf zlib-1.2.3.tar.gz
----------------------------------
依赖模块lizpng
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf libpng-1.2.18.tar.gz
----------------------------------
安装本模块
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf ImageMagick-6.3.2-9.tar.gz

./configure
make
make install

17)HTML::Parser (v3.40)
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf HTML-Parser-3.55.tar.gz


18)HTML::Scrubber (any)  
----------------------------------
[perl模块压缩包所在目录]# tar -xzvf HTML-Scrubber-0.08.tar.gz


(1 - C) 至此,所有perl modules都安装好后,再运行一次bugzilla下的./checksetup.pl结果如下:
---------------------------------------------------------


Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.65
Checking for             CGI (v2.93)   ok: found v3.29
Checking for    Data::Dumper (any)     ok: found v2.12
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.57
Checking for      File::Spec (v0.84)   ok: found v3.25
Checking for      File::Temp (any)     ok: found v0.13
Checking for        Template (v2.10)   ok: found v2.19
Checking for      Text::Wrap (v2001.0131) ok: found v2001.0929
Checking for    Mail::Mailer (v1.67)   ok: found v1.77
Checking for    MIME::Base64 (v3.01)   ok: found v3.07
Checking for    MIME::Parser (v5.406)  ok: found v5.420
Checking for        Storable (any)     ok: found v2.06

The following Perl modules are optional:
Checking for              GD (v1.20)   ok: found v2.35
Checking for Template::Plugin::GD::Image (any)     ok: found v1.56
Checking for     Chart::Base (v1.0)    ok: found v2.4.1
Checking for       XML::Twig (any)     ok: found v3.09
Checking for       GD::Graph (any)     ok: found v1.44
Checking for GD::Text::Align (any)     ok: found v1.18
Checking for     PatchReader (v0.9.4)  ok: found v0.9.5
Checking for   Image::Magick (any)     ok: found v6.3.2
Checking for    HTML::Parser (v3.40)   ok: found v3.55
Checking for  HTML::Scrubber (any)     ok: found v0.08

Checking user setup ...
Removing existing compiled templates ...
Precompiling templates ...
Checking for      DBD::mysql (v2.9003) ok: found v4.005
Checking for           MySQL (v4.0.14) ok: found v5.0.27-standard

Populating duplicates table...
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.

 

---------------------------------------------------------
2.Apache的安装
---------------------------------------------------------

 

bugzilla是一套基于WWW的系统,需要WWW服务的支持,我们采用最常用的WWW服务Apache服务器

(2 - A) 安装Apache前先判断是否已安装了httpd服务,如下:
---------------------------------------------------------

rpm -q httpd

若出现package httpd is not installed表示尚未安装

在RedHat Linux 9.0的第一张安装光盘中的/RedHat/RPMS中找文件:

httpd-2.0.40-21.i386.rpm

输入以下命令安装httpd服务

rpm -ivh httpd-2.0.40-21.i386.rpm


(2 - B) 配置Apache服务器,httpd服务的配置文件在/etc/httpd/conf/httpd.conf中
---------------------------------------------------------


1)首先备份httpd.conf文件,如下:

[root@dai conf]# cp httpd.conf httpd.conf.old

2)使用编辑器打开httpd.conf文件,如下:

[root@dai conf]# vi httpd.conf

3)使用"/"命令查找字符串ServerName,并按如下所示修改:

#
# 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 new.host.name:80

ServerName 192.168.0.99:80

注意:最后一行为添加的内容,192.168.0.99为Linux主机的IP地址。

使用:wq保存退出vi编辑器。

4)检查配置文件语法是否正确,如下:

[root@dai conf]# httpd -t

若显示Syntax OK则表明语法正确。


(2 - C) 使用编辑器打开/etc/hosts文件,如下:
---------------------------------------------------------


[root@dai etc]# vi hosts

按如下所示修改:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1  localhost.localdomain localhost

192.168.0.99            dai

注意:最后一行为添加的内容,192.168.0.99为Linux主机的IP地址。

使用:wq保存退出vi编辑器。


(2 - D) 使用命令启动httpd服务,如下:
---------------------------------------------------------


[root@dai etc]# /etc/rc.d/init.d/httpd start

若显示Starting httpd:[OK]则表明启动成功。


(2 - E) 在其他计算机中运行Linux主机的IP地址,如下:
---------------------------------------------------------


http://192.168.0.99/

若能出现Apache的Test Page页面,则说明Apache可以正常启动

 

---------------------------------------------------------
3.mySQL的安装
---------------------------------------------------------

 

(3 - A) 获得mySQL的安装文件:
---------------------------------------------------------


MySQL-client-standard-5.0.27-0.rhel3.i386.rpm
MySQL-devel-standard-5.0.27-0.rhel3.i386.rpm
MySQL-server-standard-5.0.27-0.rhel3.i386.rpm


(3 - B) 安装mySQL和相关的perl模块
---------------------------------------------------------


安装perl(DBI)
----------------------------------------------
rpm -ivh perl-DBI-1.32-5.i386.rpm   -->linuxB.iso

安装perl(devel)
----------------------------------------------
rpm -ivh MySQL-devel-standard-5.0.27-0.rhel3.i386.rpm 

安装perl(client)
----------------------------------------------
rpm -ivh MySQL-client-standard-5.0.27-0.rhel3.i386.rpm 

安装perl(server)
----------------------------------------------
rpm -ivh MySQL-server-standard-5.0.27-0.rhel3.i386.rpm 

安装perl(DBD-MySQL)
----------------------------------------------
tar -xzvc DBD-mysql-4.005.tar.gz
export LANG='C'
perl Makefile.PL
make
make test
make install


(3 - C) 在mySQL中配置bugzilla的帐户bugs,如下:
---------------------------------------------------------


[root@dai /]# mysql -uroot -p

mysql> GRANT SELECT, INSERT,
    -> UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
    -> CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*
    -> TO bugs@localhost IDENTIFIED BY '';

mysql> FLUSH PRIVILEGES;

mysql> quit;


(3 - D)在bugzilla目录中编辑localconfig文件,如下:
---------------------------------------------------------


[root@dai bugzilla-2.22.1]# vi localconfig

#
# With the introduction of a configurable index page using the
# template toolkit, Bugzilla's main index page is now index.cgi.
# Most web servers will allow you to use index.cgi as a directory
# index, and many come preconfigured that way, but if yours doesn't
# then you'll need an index.html file that provides redirection
# to index.cgi. Setting $index_html to 1 below will allow
# checksetup.pl to create one for you if it doesn't exist.
# NOTE: checksetup.pl will not replace an existing file, so if you
#       wish to have checksetup.pl create one for you, you must
#       make sure that index.html doesn't already exist

$index_html = 1;
   
注意:最后一行为修改的内容,1表示产生index.html文件


(3 - E)重新执行checksetup.pl文件:
----------------------------------------------


./checksetup.pl

至此bugzilla会把所有需要的表,自动创建到mysql中。可以运行mysql查看数据库的变化:
----------------------------------------------
#mysql

Welcome to the MySQL monitor.  Commands end with ; or /g.
Your MySQL connection id is 2 to server version: 5.0.27-standard

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| bugs               |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.95 sec)

mysql> use bugs;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> show tables;
+--------------------+
| Tables_in_bugs     |
+--------------------+
| attach_data        |
| attachments        |
| bug_group_map      |
| bug_severity       |
| bug_status         |
| bugs               |
| bugs_activity      |
| bz_schema          |
| category_group_map |
| cc                 |
| classifications    |
| components         |
| dependencies       |
| duplicates         |
| email_setting      |
| fielddefs          |
| flagexclusions     |
| flaginclusions     |
| flags              |
| flagtypes          |
| group_control_map  |
| group_group_map    |
| groups             |
| keyworddefs        |
| keywords           |
| logincookies       |
| longdescs          |
| milestones         |
| namedqueries       |
| op_sys             |
| priority           |
| products           |
| profile_setting    |
| profiles           |
| profiles_activity  |
| quips              |
| rep_platform       |
| resolution         |
| series             |
| series_categories  |
| series_data        |
| setting            |
| setting_value      |
| tokens             |
| user_group_map     |
| versions           |
| votes              |
| watch              |
| whine_events       |
| whine_queries      |
| whine_schedules    |
+--------------------+
51 rows in set (0.01 sec)

mysql> quit;

 

---------------------------------------------------------
4.配置Apache
---------------------------------------------------------

 

(4 - A) 移动bugzilla目录到/var/www/html/
----------------------------------------------


[bugzilla-2.22.1的父目录]# mv bugzilla-2.22.1  /var/www/html/


(4 - B) 设置目录权限:
----------------------------------------------


[root@dai /var/www/html]# chown -R apache:apache bugzilla-2.22.1


(4 - C) 配置apache服务器,把bugzilla设置成虚拟目录:
----------------------------------------------


cd /etc/httpd/conf

vi httpd.conf

#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL.  So "/icons" isn't aliased in this
# example, only "/icons/".  If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings.  If you
# do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/var/www/icons/"

<Directory "/var/www/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>


Alias /bugzilla/ "/var/www/html/bugzilla-2.22.1"

<Directory "/var/www/html/bugzilla-2.22.1">
    Options Indexes ExecCGI FollowSymLinks
    AllowOverride Limit
    Order allow,deny
    Allow from all
</Directory>

注意:后一个段落是添加的内容


(4 - D) 设置head运行CGI script,去掉注释,如下:
---------------------------------------------------------


#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

AddHandler cgi-script .cgi

注意:最后一行是添加的内容。

使用:wq命令保存退出。


(4 - E) 检查httpd.conf文件语法:
----------------------------------------------


[root@dai /etc/httpd/conf]# httpd -t

若显示Syntax OK则表明语法正确。


(4 - F) 重新启动apache服务器:
----------------------------------------------


service httpd restart


(4 - G) 访问bugzilla网站:
----------------------------------------------


http://apache服务器IP/bugzilla

结果显示Bugzilla Main Page则安装成功!

 

---------------------------------------------------------
5.安装配置sendmail
---------------------------------------------------------


(5 - A) 安装sendmail-cf-8.12.8-4.i386.rpm包        -->linuxB.iso
----------------------------------------------
mount /dev/cdrom /mnt/cdrom
rpm -ivh sendmail-cf-8.12.8-4.i386.rpm


(5 - B) 查看当前系统是否安装sendmail,命令:
----------------------------------------------
rpm -qa |grep sendmail
----------------------
sendmail-8.12.8-4
sendmail-cf-8.12.8-4 -->文件在linuxC.iso
----------------------
sendmail是主要的邮件服务器,sendmail-cf是邮件服务器的配置文档,这两个程序是一定要安装了。
我们还需要pop3来接收邮件,可以使用IMAP这个程序来实现。


(5 - C) 查看当前系统是否安装imap,命令:
----------------------------------------------
rpm -qa |grep imap
----------------------
imap-devel-2001a-18
imap-2001a-18  -->文件在linuxB.iso
----------------------


(5 - D) 查看当前系统是否安装M4,命令:
----------------------------------------------
rpm -qa |grep m4
----------------------
m4-1.4.1-13
----------------------


(5 - E) 查看当前系统是否安装mailx,命令:
----------------------------------------------
rpm -qa |grep mailx
----------------------
mailx-8.1.1-28
----------------------


(5 - F) 配置sendmail.mc
----------------------------------------------
/etc/mail/sendmail.mc
注释sendmail的监听,可以让本机以外的其它机器使用该机器发送邮件。

dnl DAEMON_OPTIONS('Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

将sendmail的配置应用到sendmail.cf文件中,命令:
----------------------
make -C /etc/mail

m4 /etc/mail/sendmail.mc>/etc/mail/sendmail.cf
----------------------


(5 - G) 配置pop3文件
----------------------------------------------
/etc/xinetd.d/ipop3
修改disable=yes改为disable=no


(5 - H) 启动sendmail
----------------------------------------------
/etc/rc.d/init.d/sendmail start
2.启动pop3
/etc/rc.d/init.d/xinetd restart
启动完成后,可以查看一下网络状态,pop3和smtp都已经被监听到了。命令:
netstat -tl
这样我们的mail server就已经启动了,它已经可以进行收信和发信了。


(5 - I) 启动完sendmail后,还要设置主机名,这样你的邮件主机才能够正常无误的工作了。
----------------------------------------------
如果你没有安装dns,可以使用/etc/hosts文件来配置主机。
----------------------
192.168.1.100 mylinux.com
----------------------
sendmail邮件主机的名字是由/etc/mail/local-host-names文件来配置的,命令:
----------------------
vi local-host-names
----------------------
例如:你的邮件是master@mylinux.com,那么在local-host-names文件里配置如下:
----------------------
mylinux.com
----------------------


(5 - J) 配置邮件服务器的使用权限,配置文件是:
----------------------------------------------
/etc/mail/access
编辑access文件,允许mylinux.com主机名发送email。
----------------------
192.168.1      RELAY -->允许这个网段的IP发送email。
mylinux.com    RELAY
----------------------
配置完后,将修改的内容,导入access.db数据库中,提供给sendmail服务器使用。
----------------------
makemap hash /etc/mail/access>/etc/mail/access.db
----------------------
无提示,成功导入。


(5 - K) 在邮件服务器上创建用户,使用命令:
----------------------------------------------
adduser 新用户
passwd 新用户
----------------------
reboot重启linux,我们的mail server就装好了。


(5 - L) 试试向新用户发送一封email,来测试一下我们的服务器,使用命令mail完成。
----------------------
mail    ->查看当前用户有无新邮件
>N  1 root@mylinux.com     Wed Jul 11 17:43  16/572  "hi"  ->N表示新邮件
&回车,查看>所指的新邮件。
&q    ->退出
----------------------
mail test@mylinux.com  ->向test用户发送新邮件
subject:   ->邮件标题
邮件内容
.    ->邮件内容结束
Cc:    ->抄送人邮件地址
&q    ->退出
----------------------
每个用户在自已的家目录下,都会有一个mbox文件,里面记录了所有收到看过的邮件。 

0 0
原创粉丝点击