linux bugzilla nginx 安装配置 详解

Bugzilla是Mozilla公司提供的一款开源的免费Bug追踪系统,用来帮助你管理软件开发,建立完善的BUG跟踪体系。

在网上看了一下,bugzilla的安装,大部分的web环境是apache 。下面说一下我的安装过程。

一,安装epel源

请参考:centos 推荐使用epel源

二,安装mysql nginx bugzilla,以及相关工具

  1. yum install mysql mysql-server bugzilla fcgi-devel fcgi nginx perl spawn-fcgi

安装fcgiwrap,它是用来运行perl的cgi程序的

fcgiwrap下载地址: http://github.com/gnosek/fcgiwrap/tarball/master

  1. [root@localhost download]# tar zxvf gnosek-fcgiwrap-1.1.0-5-g66e7b7d.tar.gz
  2. [root@localhost download]# cd gnosek-fcgiwrap-66e7b7d/
  3. [root@localhost gnosek-fcgiwrap-66e7b7d]# autoreconf -i
  4. [root@localhost gnosek-fcgiwrap-66e7b7d]# ./configure
  5. [root@localhost gnosek-fcgiwrap-66e7b7d]# make
  6. gcc -std=gnu99 -Wall -Wextra -Werror -pedantic -O2 -g3 fcgiwrap.c -o fcgiwrap -lfcgi
  7. [root@localhost gnosek-fcgiwrap-66e7b7d]# cp fcgiwrap /usr/local/bin/

如果autoreconf -i时,autoreconf命令不存在,安装如下依赖包:

  1. 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数据库

  1. /etc/init.d/mysqld start   //启动服务端
  2. mysql> create database bugstest;    //创建空数据库
  3. mysql> grant all privileges on bugstest.* TO ‘bugstest’@‘localhost’ IDENTIFIED BY ‘bugstest’;   //分配权限
  4. mysql> flush privileges;

四,修改bugzilla的配置localconfig,并且安装bugzilla数据库

1,修改/etc/localconfig

  1. $db_name = ‘bugstest’;      //数据库名
  2. $db_user = ‘bugstest’;      //连接用户名
  3. $db_pass = ‘bugstest’;        //连接密码

就是上面,mysql里面添加的用户。

2,安装bugzilla数据库,执行checksetup.pl

  1. cd /usr/share/bugzilla/
  2. ./checksetup.pl

在安装过程中会提示你输入administrtor的用户名和密码,注意:安装成功后,登录的用户名,是你的邮箱

五,nginx配置

1,copy bugzilla到www目录下

  1. cp -r /usr/share/bugzilla /var/www/html/
  2. chown nginx:nginx -R /var/www/html/bugzilla   //改成nginx的启动用户

2,建一个nginx的vhost

  1. [root@localhost conf.d]# cat bugzilla.conf
  2. server
  3. {
  4.     listen       80;
  5.     server_name  192.168.10.202;
  6.     index  index.cgi index.html;
  7.     root   /var/www/html/bugzilla;
  8.     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  9.     {
  10.         expires     30d;
  11.     }
  12.     location ~ .*\.(js|css)?$
  13.     {
  14.         expires     1h;
  15.     }
  16.     location ~ .*\.cgi$ {
  17.              fastcgi_pass          127.0.0.1:9001;
  18.              fastcgi_index         index.cgi;
  19.              include            fastcgi.conf;
  20.     }
  21. }

六,启动nginx和fcgiwrap

  1. spawn-fcgi -f /usr/local/bin/fcgiwrap -a 127.0.0.1 -p 9001 -F 3 -P /var/run/fastcgi-c.pid
  2. /etc/init.d/nginx start
声明:本文采用 BY-NC-SA 协议进行授权,本文链接:linux bugzilla nginx 安装配置 详解

发表回复