公司现在有需要搭建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
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
note:
使用rpm包安装也可以,假设在安装系统的时候安装上开发工具 perl 就自动安装好了
初始化perl (这个很重要)
首先初始化perl的cpan:perl -MCPAN -e 'shell'
一路默认回车即可,
First, pick a nearby continent and country (you can pick several of
each, separated by spaces, or none if you just want to keep your
existing selections). Then, you will be presented with a list of URLs
of CPAN mirrors in the countries you selected, along with previously
selected URLs. Select some of those URLs, or just keep the old list.
Finally, you will be prompted for any extra URLs -- file:, ftp:, or
http: -- that host a CPAN mirror.
(1) Africa
(2) Asia
(3) Australasia
(4) Central America
(5) Europe
(6) North America
(7) Oceania
(8) South America
Select your continent (or several nearby continents) [] 2
Sorry! since you don't have any existing picks, you must make a
geographic selection.
(1) China
(2) Hong Kong
(3) India
(4) Indonesia
(5) Japan
(6) Kazakhstan
(7) Republic of Korea
(8) Russia
(9) Singapore
(10) Taiwan
(11) Thailand
(12) Turkey
Select your country (or several nearby countries) [] 1
Sorry! since you don't have any existing picks, you must make a
geographic selection.
(1) http://cpan.wenzk.com/
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. '1 4 5' [] 1
4.安装perl模块
1)安装bugzilla所需的perl模块
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";
找到
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
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)
再次show plugin; 发现 多了一行
| InnoDB | ACTIVE | STORAGE ENGINE | ha_innodb.so | GPL |
再次运行checksetup.pl 会要求输入管理员邮箱和密码(一定要记在用户名和密码)
到此安装完毕
在浏览器中输入http://ip_address/Dawn/
说没有权限访问 呵呵chmod -R 777 /usr/local/apache2/htdocs/Dawn
输入管理员的用户名和密码
用户名为输入的邮箱账号
本文出自 “Create One Eternal Love” 博客,转载请与作者联系!