公司现在有需要搭建bugzilla 系统,之前搭建过,但是没有记录下来,这次把他完全记录下来,以供自己以后参考(建议在安装系统的时候安装上开发工具,administrator tool ,system tool 等,这样在安装的过程中就不会出现缺少包的情况)
1.安装apache
tar zxvf httpd-2.2.9.tar.gz
cd httpd-2.2.9
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-ssl --with-ssl=/usr/lib --with-auth-digest --enable-cgi --enable-mods-shared=all --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/usr/local/apache2/htdocs --enable-auth-digest --enable-cgi --with-ssl=/usr/lib --enable-ssl
make
make install
创建所需的目录, 例如 mkdir /usr/local/apache2/htdocs/Dawn
在/usr/local/apache2/conf/httpd.conf中添加如下
AddHandler cgi-script .cgi
<Directory "
/usr/local/apache2/htdocs/Dawn/">
Options All
AllowOverride Limit
Order allow,deny
Allow from all
</Directory>
添加index.cgi eg :
<IfModule dir_module>
DirectoryIndex index.cgi index.php index.html
</IfModule>
note:
是这个样子/usr/local/apache2/htdocs/Dawn/
2.安装mysql
groupadd mysql
useradd -g mysql -s /sbin/nologin -M mysql
tar zxvf mysql-5.1.44.tar.gz
cd mysql-5.1.44
./configure --prefix=/usr/local/mysql --with-charset=gbk --with-extra-charsets=all --enable-thread-safe-client --enable-local-infile --with-low-memoryz
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
chown -R mysql.mysql /usr/local/mysql/
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R mysql.mysql /usr/local/mysql/var/
/usr/local/mysql/bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --levels 345 mysqld on
echo "/usr/local/mysql/lib/mysql">>/etc/ld.so.conf
ldconfig
echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile
source /etc/profile
/usr/local/mysql/bin/mysqladmin -u root password 123123
这是我整理的,完全可以将上面代码复制,创建成一个脚本,最简单是利用if 判断mysql这个目录存在不存在就可以了 eg: if [ ! -d /usr/local/mysql ]
进入mysql数据库创建Dawn
/usr/local/mysql/bin/mysql -u root -p123123
>create database Dawn;
3.安装perl
1)取得最新版本的 perl,当前版本为 5.6.0,即 stable.tar.gz。
2)解文件包:
gunzip stable.tar.gz
tar xvf stable.tar
得到目录 perl-5.6.0
3)在目录 perl-5.6.0 下安装 perl:
rm -f config.sh Policy.sh
sh Configure -de
make
make test
make install
config.sh Policy.sh 为以前安装时的配置文件,新安装或升级安装时需要将其删除。
sh Configure -de 安装使用默认配置,一般而言将会 ok 。
安装完成后 perl 所在目录为 /usr/local/lib/perl5, perl 执行文件
在 /usr/local/bin 中。
note:
使用rpm包安装也可以,假设在安装系统的时候安装上开发工具 perl 就自动安装好了
4.安装perl模块
1)安装bugzilla所需的perl模块
必要模块:
1. CGI 2.93 or CGI 3.11 if using mod_perl
2. Date::Format (2.21)
3. DBI (1.41)
4. DBD::mysql (2.9003) if using MySQL
5. DBD::Pg (1.45) if using PostgreSQL
6. File::Spec (0.84)
7. Template (2.12)
8. Email::Send (2.00)
9. Email::MIME::Modifier (any)
其中DBD模块在本章中先不进行安装,因为这个模块需要先安装mysql,其他模块均可安装
可选模块:
1. GD (1.20) for bug charting
2. Template::Plugin::GD::Image (1.20) for Graphical Reports
3. Chart::Base (1.0) for bug charting
4. GD::Graph (any) for bug charting
5. GD::Text (any) for bug charting
6. XML::Twig (any) for bug import/export
7. MIME::Parser (5.406) for bug import/export
8. LWP::UserAgent (any) for Automatic Update Notifications
9. PatchReader (0.9.4) for pretty HTML view of patches
10. Image::Magick (any) for converting BMP image attachments to PNG
11. Net::LDAP (any) for LDAP Authentication
12. SOAP::Lite (any) for the web service interface
13. HTML::Parser (3.40) for More HTML in Product/Group Descrīptions
14. HTML::Scrubber (any) for More HTML in Product/Group Descrīptions
15. Email::MIME::Attachment::Stripper (any) for Inbound Email
16. Email::Reply (any) for Inbound Email
17. mod_perl2 (1.999022) for mod_perl
18. CGI (2.93) for mod_perl
19. Apache::DBI (0.96) for mod_perl2
2) 不过,放心 perl提供了很简便的模块安装方式:
(单模块安装方式)perl -MCPAN -e 'install 模块名'
(批量安装方式)比如安装bugzilla的模块,执行这个命令就可以了:perl -MCPAN -e 'install "Bundle::Bugzilla"' or
perl install-module.pl --all (我用的是这个,使用前面那个不知道是怎么回事安装不全,使用这个可以将安装bugzilla所必需的模块安装完毕)
5.安装bugzilla
tar -zxvf bugzilla-4.0.tar.gz
cd bugzilla-4.0
mv * /usr/local/apache2/htdocs/Dawn
chmod -R 777 /usr/local/apache2/htdocs/Dawn
cd /usr/local/apache2/htdocs/Dawn
./checksetup.pl (检查安装,如果上一步的perl模块没有装好,这里会提示)如果没有错的话会生出localconfig 文件
修改 localconfig 修改以下内容:
$db_host = "localhost";
$db_name = "Dawn";
$db_user = "root";
$db_pass = "123123";
找到
$index_html=0
改为:
$index_html=1
这样会生成一个index.html文件,该文件指向index.cgi
2)再次运行checksetup.pl
但是不能成功,会出现以下提示:
InnoDB is disabled in your MySQL installation. Bugzilla requires InnoDB to be enabled. Please enable it and then re-run checksetup.pl.
说的啥意思呢,就是说
Bugzilla的要求,要启用InnoDB
下面咱就启用
进入到mysql 中
/usr/local/mysql/bin/mysql -u root -p123123
查看数据库是否支持innodb
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| CSV | YES | CSV storage engine | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
|
InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec)
先查看mysql是否安装了innodb插件
- [root@localhost bin]# ./mysql
- mysql> show plugin;
- +------------+--------+----------------+---------+---------+
- | Name | Status | Type | Library | License |
- +------------+--------+----------------+---------+---------+
- | binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
- | CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
- | MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
- | MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
- | MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
- +------------+--------+----------------+---------+---------+
发现没有安装
安装
mysql> install plugin innodb soname 'ha_innodb.so'; Query OK, 0 rows affected (0.36 sec)
再次show plugin; 发现 多了一行
| InnoDB | ACTIVE | STORAGE ENGINE | ha_innodb.so | GPL |
再次运行checksetup.pl 会要求输入管理员邮箱和密码(一定要记在用户名和密码)
到此安装完毕
在浏览器中输入http://ip_address/Dawn
说没有权限访问 呵呵chmod -R 777 /usr/local/apache2/htdocs/Dawn
输入管理员的用户名和密码
用户名为输入的邮箱账号