在網上看了一下,bugzilla的安裝,大部分的web環境是apache 。下面說一下我的安裝過程。
一,安裝epel源
請參考:centos 推薦使用epel源
二,安裝mysql nginx bugzilla,以及相關工具
yum install mysql mysql-server bugzilla fcgi-devel fcgi nginx perl spawn-fcgi
安裝fcgiwrap,它是用來運行perl的cgi程式的
fcgiwrap下載地址: http://github.com/gnosek/fcgiwrap/tarball/master
[root@localhost download]# tar zxvf gnosek-fcgiwrap-1.1.0-5-g66e7b7d.tar.gz
[root@localhost download]# cd gnosek-fcgiwrap-66e7b7d/
[root@localhost gnosek-fcgiwrap-66e7b7d]# autoreconf -i
[root@localhost gnosek-fcgiwrap-66e7b7d]# ./configure
[root@localhost gnosek-fcgiwrap-66e7b7d]# make
gcc -std=gnu99 -Wall -Wextra -Werror -pedantic -O2 -g3 fcgiwrap.c -o fcgiwrap -lfcgi
[root@localhost gnosek-fcgiwrap-66e7b7d]# cp fcgiwrap /usr/local/bin/
如果autoreconf -i時,autoreconf命令不存在,安裝如下依賴包:
yum install patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make autoconf automake libtool bison libxml2-devel libxslt-devel libyaml-devel
三,啟動mysql,並建立bugzilla資料庫
查看複製列印?
/etc/init.d/mysqld start //啟動服務端
mysql> create database bugstest; //建立空資料庫
mysql> grant all privileges on bugstest.* TO 'bugstest'@'localhost' IDENTIFIED BY 'bugstest'; //分配許可權
mysql> flush privileges;
四,修改bugzilla的配置localconfig,並且安裝bugzilla資料庫
1,修改/etc/localconfig
查看複製列印?
$db_name = 'bugstest'; //資料庫名
$db_user = 'bugstest'; //串連使用者名稱
$db_pass = 'bugstest'; //串連密碼
就是上面,mysql裡面添加的使用者。
2,安裝bugzilla資料庫,執行checksetup.pl
cd /usr/share/bugzilla/
./checksetup.pl
在安裝過程中會提示你輸入administrtor的使用者名稱和密碼,注意:安裝成功後,登入的使用者名稱,是你的郵箱。
五,nginx配置
1,copy bugzilla到www目錄下
查看複製列印?
cp -r /usr/share/bugzilla /var/www/html/
chown nginx:nginx -R /var/www/html/bugzilla //改成nginx的啟動使用者
2,建一個nginx的vhost
查看複製列印?
[root@localhost conf.d]# cat bugzilla.conf
server
{
listen 80;
server_name 192.168.10.202;
index index.cgi index.html;
root /var/www/html/bugzilla;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
location ~ .*\.cgi$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.cgi;
include fastcgi.conf;
}
}
六,啟動nginx和fcgiwrap
查看複製列印?
spawn-fcgi -f /usr/local/bin/fcgiwrap -a 127.0.0.1 -p 9001 -F 3 -P /var/run/fastcgi-c.pid
/etc/init.d/nginx start
效果圖: