代码改变世界

Ubuntu 9.10 Server (Karmic) 迁移Bugzilla

2010-02-07 01:10  BAsil  阅读(1795)  评论(0编辑  收藏  举报

项目组去年年底配置了两台服务器,其中的一台安装了Ubuntu 9.10 Server。由于项目组采用Bugzilla作为bug生命周期的管理,需要把Bugzilla迁移了过来。以下记录迁移过程备忘。

原服务器 Ubuntu 8.04 Desktop ,  Bugzilla 3.2.2

新服务器 Ubuntu 9.10 Server  , --

参考网上部分方案,打算采用比较稳妥的方式,形成如下思路

1 备份mysql数据库

  将数据库bugs备份到文件bugsdata.sql
    $mysqldump bugs > bugsdata.sql
    再修改bugsdata.sql,在文件头加两行
    create database if not exists bugs;
    USE bugs;

2 在已安装mysql的9.10Server上恢复数据库

   此步骤一定在第5步之前,因为Bugzilla的checksetup.pl会自动升级数据库脚本从3.2.2到3.4.4

 

3 打包Bugzilla 文件夹并恢复到Ubuntu 9.10上  (此步骤浏览时报错,忘了具体错误,比较难处理,转到步骤3)

4 下载最新Bugzilla 3.4.4, 重新编译。 至于为什么不用ubuntu自带的Bugzilla以及如何下载编译配置Bugzilla,请参见这篇博文Ubuntu 8.04 安装 Bugzilla 3.2.2

   为了防止版本文件夹的变化而修改apache虚拟目录文件,可以创建symbolic link,比如解压后的文件夹为 Bugzilla_3.4.4 可以用 ln –s Bugzilla Bugzilla_3.4.4 创建名为Bugzilla的symbolic link,在apache虚拟目录的配置中可以使用该名称,将来出现新版本只更新Bugzilla的指向即可。

5 运行 ./checksetup.pl 的时候,按照提示下载缺少的部分模块,总是有3个模块安装不上

Checking perl modules...
Checking for DateTime (v0.28) not found
Checking for DateTime-TimeZone (v0.71) not found 
Checking for Template-Toolkit (v2.22) not found

解决方法 sudo apt-get install libmysql++-dev  (参考了ubuntuforums.org里一位老兄的帖子Installing bugzilla and DateTime problem)

6 接下来就是按照提示修改Bugzilla的localconfig

$webservergroup = ‘www-data’;

# The DNS name of the host that the database server runs on.
$db_host = ‘localhost’;
# The name of the database
$db_name = ‘bugs’;

# Who we connect to the database as.

# The DNS name of the host that the database server runs on.
$db_host = ‘localhost’;
# The name of the database
$db_name = ‘bugs’;

# Who we connect to the database as.
$db_user = ‘bugs’;
$db_pass = ‘admin’;
注意其中的webservergroup 我设置为了www-data,注意这个是ubuntu的运行apache的用户组(不同于其他linux发行版的apache用户组)

7 别忘了在apache下配置该虚拟目录,ubuntu自带的apache可以直接修改的/etc/apache2/sites-enabled下面的文件加入

Alias /bugzilla “/var/www/bugzilla″
<Directory  “/var/www/bugzilla″>

Options +ExecCGI
AllowOverride Limit
DirectoryIndex index.cgi
AddHandler cgi-script .cgi
</Directory>
不过我们的服务器使用了自己下载编译的apache2,因为该服务器还做为svn的源代码管理服务器。我在ubuntu 9.10 server 下的apache在启用ssl的时候总是报undefined symbol apr_ldap_ssl_init错误,此处我怀疑可能是ubuntu9.10 server的问题,我在虚拟机ubuntu 8.04 desktop下没有出现此问题。

apache2的安装目录更改为/usr/local/apache2,在/usr/local/apache2/conf/httpd.conf中加入上述内容。

关于apache2的下载编译以及使用ssl的SVN请浏览Ubuntu 9.10 Server 配置基于SSL的Subversion

8 sudo /etc/init.d/apache2 restart  (自带的apache2)

   或者
   cd /usr/local/apache2/bin  (编译的apache2)
   sudo ./httpd –k restart