最近在Ubuntu 12.04上安装bugzilla,今天完工,安装过程遇到一些让人头痛的问题,有的问题让人抓狂到临近崩溃,还好终于解决各种疑难杂症,顺利安装成功,做个笔记以备以后查验:
安装环境:
OS: Ubuntu 12.04 LTS(GCC 使用系统默认版本,perl使用系统默认版本perl-5.14)
Apache: httpd-2.2.25
Bugzilla: bugzilla-4.4.1
Mysql: mysql-5.5.33(binary)
1.首先安装必须的编译工具:
$sudo apt-get install build-essential
2.perl的lib包,非必须,以防万一:
$sudo apt-get install libperl-dev
3.下载 apr、apr-util、pcre-8.32三个安装包,安装apache必须的三个包,安装方法省去,源码包安装。
4.安装apache,方法省略,下载httpd-2.2.25源码包安装或者apt-get安装。
5.mysql安装,方法省略,使用源码包或者二进制分发包安装,或者apt-get安装。
6.安装bugzilla,安装之前先装几个必要的包,以免安装过程报错。
【1】安装zlib:
$sudo apt-get install zlib1g-dev
不安装此包,在安装DBD::mysql的时候会报如下错误:
An error occurred while linking the DBD::mysql driver. The error
message seems to indicate that you don't have a libz.a,
or a libz.so. There are a few ways to resolve this:
1) You may try to remove the -lz or -lgz flag from the libs list
by using the --libs switch for "perl Makefile.PL".
2) On Red Hat Linux and SUSE Linux, install the zlib-devel package
(sometimes called libz-devel)
3) On Debian and Ubuntu, install the zlib1g-dev package
4) On other systems, please contact the mailing list
perl@lists.mysql.com
For further hints, see INSTALL.html, section Linker flags.
make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1
CAPTTOFU/DBD-mysql-4.024.tar.gz
/usr/bin/make -- NOT OK
Skipping test because of notest pragma
Running make install
Make had returned bad status, install seems impossible
【2】.安装libpng、libjpeg,这两个主要考虑到后面安装liggd的时候需要增加这两个支持,不安装也可以,如果在安装bugzilla的时候想安装GD这个可选模块,最好在这里将这两个包装上,下载jpegsr6、libpng1.6.6安装,源码安装,一般无异常报出,方法省略。
【3】.安装liggd,这个是图形库,bugzilla可选模块GD需要这个库文件,如果安装GD,就必须安装这个库,源码安装,一般无异常报出,方法省略。
【4】.安装DBI,这个最好自己下载源码包安装,如果使用perl在线安装,当前默认版本是1.6.30,可能出现明明已经装了,但是执行./checksetup.pl的时候,DBI这一项显示红色,然后提示需要安装DBI,可能是版本兼容性问题,下载DBI-1.6.28源码安装,一般无异常报出,安装方法省略。
【5】.安装bugzilla,bugzilla-4.4.1解压缩在/usr/local目录,将文件夹名字bugzilla-4.4.1重新改为bugzilla.
$cd /usr/local/bugzilla
检查安装所需的模块:
$./checksetup.pl --check-modules
* This is Bugzilla 4.4.1 on perl 5.14.2
* Running on Linux 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 15:31:16 UTC 2013
Checking perl modules...
Checking for CGI.pm (v3.51) ok: found v3.63
Checking for Digest-SHA (any) ok: found v5.61
Checking for TimeDate (v2.23) ok: found v2.24
Checking for DateTime (v0.28) not found
Checking for DateTime-TimeZone (v0.71) not found
Checking for DBI (v1.614) not found
Checking for Template-Toolkit (v2.22) not found
Checking for Email-Send (v2.04) not found
Checking for Email-MIME (v1.904) not found
Checking for URI (v1.37) not found
Checking for List-MoreUtils (v0.32) not found
Checking for Math-Random-ISAAC (v1.0.1) not found
Checking available perl DBD modules...
Checking for DBD-Pg (v2.7.0) not found
Checking for DBD-mysql (v4.001) not found
Checking for DBD-SQLite (v1.29) not found
Checking for DBD-Oracle (v1.19) not found
The following Perl modules are optional:
Checking for GD (v1.20) not found
Checking for Chart (v2.1) not found
Checking for Template-GD (any) not found
Checking for GDTextUtil (any) not found
Checking for GDGraph (any) not found
Checking for MIME-tools (v5.406) not found
Checking for libwww-perl (any) not found
Checking for XML-Twig (any) not found
Checking for PatchReader (v0.9.6) not found
Checking for perl-ldap (any) not found
Checking for Authen-SASL (any) not found
Checking for Net-SMTP-SSL (v1.01) not found
Checking for RadiusPerl (any) not found
Checking for SOAP-Lite (v0.712) not found
Checking for XMLRPC-Lite (v0.712) not found
Checking for JSON-RPC (any) not found
Checking for JSON-XS (v2.0) not found
Checking for Test-Taint (any) not found
Checking for HTML-Parser (v3.67) not found
Checking for HTML-Scrubber (any) not found
Checking for Encode (v2.21) ok: found v2.42_01
Checking for Encode-Detect (any) not found
Checking for Email-Reply (any) not found
Checking for HTML-FormatText-WithLinks (v0.13) not found
Checking for TheSchwartz (v1.07) not found
Checking for Daemon-Generic (any) not found
Checking for mod_perl (v1.999022) not found
Checking for Apache-SizeLimit (v0.96) not found
Checking for File-MimeInfo (any) ok: found v0.15
Checking for IO-stringy (any) not found
Checking for mod_headers (any) not found
Checking for mod_expires (any) not found
Checking for mod_env (any) ok
***********************************************************************
* REQUIRED MODULES *
***********************************************************************
* Bugzilla requires you to install some Perl modules which are either *
* missing from your system, or the version on your system is too old. *
* See below for commands to install these modules. *
***********************************************************************
* DATABASE ACCESS *
***********************************************************************
* In order to access your database, Bugzilla requires that the *
* correct "DBD" module be installed for the database that you are *
* running. See below for the correct command to run to install the *
* appropriate module for your database. *
***********************************************************************
* OPTIONAL MODULES *
***********************************************************************
* Certain Perl modules are not required by Bugzilla, but by *
* installing the latest version you gain access to additional *
* features. *
* *
* The optional modules you do not have installed are listed below, *
* with the name of the feature they enable. Below that table are the *
* commands to install each module. *
***********************************************************************
* MODULE NAME * ENABLES FEATURE(S) *
***********************************************************************
* GD * Graphical Reports, New Charts, Old Charts *
* Chart * New Charts, Old Charts *
* Template-GD * Graphical Reports *
* GDTextUtil * Graphical Reports *
* GDGraph * Graphical Reports *
* MIME-tools * Move Bugs Between Installations *
* libwww-perl * Automatic Update Notifications *
* XML-Twig * Move Bugs Between Installations, Automatic Update Notifications *
* PatchReader * Patch Viewer *
* perl-ldap * LDAP Authentication *
* Authen-SASL * SMTP Authentication *
* Net-SMTP-SSL * SSL Support for SMTP *
* RadiusPerl * RADIUS Authentication *
* SOAP-Lite * XML-RPC Interface *
* XMLRPC-Lite * XML-RPC Interface *
* JSON-RPC * JSON-RPC Interface *
* JSON-XS * Make JSON-RPC Faster *
* Test-Taint * JSON-RPC Interface, XML-RPC Interface *
* HTML-Parser * More HTML in Product/Group Descriptions *
* HTML-Scrubber * More HTML in Product/Group Descriptions *
* Encode-Detect * Automatic charset detection for text attachments *
* Email-Reply * Inbound Email *
* HTML-FormatText-WithLinks * Inbound Email *
* TheSchwartz * Mail Queueing *
* Daemon-Generic * Mail Queueing *
* mod_perl * mod_perl *
* Apache-SizeLimit * mod_perl *
* IO-stringy * Sniff MIME type of attachments *
***********************************************************************
* APACHE MODULES *
***********************************************************************
* Normally, when Bugzilla is upgraded, all Bugzilla users have to *
* clear their browser cache or Bugzilla will break. If you enable *
* certain modules in your Apache configuration (usually called *
* httpd.conf or apache2.conf) then your users will not have to clear *
* their caches when you upgrade Bugzilla. The modules you need to *
* enable are: *
* *
* mod_headers, mod_expires *
* *
***********************************************************************
COMMANDS TO INSTALL OPTIONAL MODULES:
GD: /usr/bin/perl install-module.pl GD
Chart: /usr/bin/perl install-module.pl Chart::Lines
Template-GD: /usr/bin/perl install-module.pl Template::Plugin::GD::Image
GDTextUtil: /usr/bin/perl install-module.pl GD::Text
GDGraph: /usr/bin/perl install-module.pl GD::Graph
MIME-tools: /usr/bin/perl install-module.pl MIME::Parser
libwww-perl: /usr/bin/perl install-module.pl LWP::UserAgent
XML-Twig: /usr/bin/perl install-module.pl XML::Twig
PatchReader: /usr/bin/perl install-module.pl PatchReader
perl-ldap: /usr/bin/perl install-module.pl Net::LDAP
Authen-SASL: /usr/bin/perl install-module.pl Authen::SASL
Net-SMTP-SSL: /usr/bin/perl install-module.pl Net::SMTP::SSL
RadiusPerl: /usr/bin/perl install-module.pl Authen::Radius
SOAP-Lite: /usr/bin/perl install-module.pl SOAP::Lite
XMLRPC-Lite: /usr/bin/perl install-module.pl XMLRPC::Lite
JSON-RPC: /usr/bin/perl install-module.pl JSON::RPC
JSON-XS: /usr/bin/perl install-module.pl JSON::XS
Test-Taint: /usr/bin/perl install-module.pl Test::Taint
HTML-Parser: /usr/bin/perl install-module.pl HTML::Parser
HTML-Scrubber: /usr/bin/perl install-module.pl HTML::Scrubber
Encode-Detect: /usr/bin/perl install-module.pl Encode::Detect
Email-Reply: /usr/bin/perl install-module.pl Email::Reply
HTML-FormatText-WithLinks: /usr/bin/perl install-module.pl HTML::FormatText::WithLinks
TheSchwartz: /usr/bin/perl install-module.pl TheSchwartz
Daemon-Generic: /usr/bin/perl install-module.pl Daemon::Generic
mod_perl: /usr/bin/perl install-module.pl mod_perl2
Apache-SizeLimit: /usr/bin/perl install-module.pl Apache2::SizeLimit
IO-stringy: /usr/bin/perl install-module.pl IO::Scalar
YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database
you use):
PostgreSQL: /usr/bin/perl install-module.pl DBD::Pg
MySQL: /usr/bin/perl install-module.pl DBD::mysql
SQLite: /usr/bin/perl install-module.pl DBD::SQLite
Oracle: /usr/bin/perl install-module.pl DBD::Oracle
COMMANDS TO INSTALL REQUIRED MODULES (You *must* run all these commands
and then re-run checksetup.pl):
/usr/bin/perl install-module.pl DateTime
/usr/bin/perl install-module.pl DateTime::TimeZone
/usr/bin/perl install-module.pl DBI
/usr/bin/perl install-module.pl Template
/usr/bin/perl install-module.pl Email::Send
/usr/bin/perl install-module.pl Email::MIME
/usr/bin/perl install-module.pl URI
/usr/bin/perl install-module.pl List::MoreUtils
/usr/bin/perl install-module.pl Math::Random::ISAAC
To attempt an automatic install of every required and optional module
with one command, do:
/usr/bin/perl install-module.pl --all
*** Installation aborted. Read the messages above. ***
安装必须的包和DBD::mysql其他可选包根据自己对bugzilla的要求进行安装
按照提示依次执行/usr/bin/perl install-module.pl Date::Time等安装perl模块,其他省略。
模块安装完成之后再次执行./checksetup.pl
$./checksetup.pl
在当前bugzilla目录会生成localconfig文件,先备份此文件:
$cp localconfig localconfig_bak
【6】.配置Apache、mysql和bugzilla使三者协同工作。
启动mysql,创建bugzilla使用的数据库,名字随意,可以使用bugzilla默认使用的数据库名字bugs,用户名也使用默认的bugs,如果这里使用了自己命名的数据库名和用户名,将来要在localconfig文件中将$db_name修改为创建的数据库的名字,$db_user。这里使用默认的bugs作为bugzilla数据库名,创建数据库并取权限:
$GRANT SELECT, DELETE, CREATE, DROP, LOCK TABLES, INDEX, INSERT, UPDATE, ALTER, CREATE TEMPORARY TABLES, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY 'your_password';
修改localconfig文件中的$db_name, $db_user, $db_pass三项,$db_pass即为bugs数据库的访问密码,$db_name为数据库名(默认为bugs),$db_user为数据库访问用户名(默认为bugs)。
查看httpd的配置文件:
$cd /usr/local/apache2/conf
配置文件中有一项Group = daemon,将此值(daemon)填入bugzilla的localconfig文件中$webservergroup值的位置。
数据库的配置完成,再次执行checksetup.pl
$./checksetup.pl
会提示输入管理员邮件地址,用户名,用户密码,一一输入之后,bugzilla会去连接mysql数据库,创建bugzilla需要使用的数据表,然后提示安装完成。
【7】.与apache搭配,启动apache后即可进入bugzilla界面,需要配置apache能够执行cgi文件,apache安装后默认加载mod_cgi模块,以支持cgi文件执行。可以使用如下命令检查cgi模块是否加载:
$/usr/local/apache2/bin/httpd -l
执行后会有当前加载模块的列表,如果看到mod_cgi.c即表示已经支持cgi执行。
修改apache的httpd.conf使apache可以找到bugzilla,如下:
$vim /usr/local/apache2/conf/httpd.conf
找到DocumentRoot,修改为bugzilla安装路径:
DocumentRoot "/usr/local/bugzilla"
找到<Directory /usr/local/apache2/htdocs>标签,修改如下:
<Directory /usr/local/bugzilla>
AddHandler cgi-script .cgi
Options Indexes FollowSymLinks +ExecCGI
DirectoryIndex index.cgi index.html
AllowOverride Limit FileInfo Indexes Options
Order allow,deny
Allow from all
</Directory>
保存修改,重启apache
打开浏览器,在地址栏输入localhost/index.cgi,即可打开bugzilla主页面。
可以将服务器IP修改为固定值,然后在bugzilla 的URL配置参数里面修改bugzilla的连接地址,其他人员也就可以通过这个地址访问bugzilla。