因为服务器一直用的nginx,bugzilla官方网上没有关于nginx做为服务器的说明,但又不想安装apache,搞得一堆server在跑。网上搜罗了一下相关资料,下面整理一下整个安装过程:
1、先下载fastcgi-wrapper.pl
# wget -O /usr/local/bin/fastcgi-wrapper
# chmod 0755 /usr/local/bin/fastcgi-wrapper
用于启动fastcgi的script
# wget -O /etc/init.d/fastcgi-wrapper
# chmod 0755 /etc/init.d/fastcgi-wrapper
# update-rc.d fastcgi-wrapper defaults
# invoke-rc.d fastcgi-wrapper start
2、配置niginx
在nginx.conf文件中第一行,把
#user nobody;
换成
user www-data;
因为bugzilla一会儿会放到/var/www这个目录下,这个目录的用户与组是www-data用户;
在nginx.conf中加入
include /opt/nginx/conf/sites/*.conf;
-
server {
-
listen 80;
-
server_name 192.168.123.105;
-
-
root /var/www/bugzilla-5.0.2/;
-
index index.cgi index.txt index.html index.xhtml;
-
-
-
location / {
-
autoindex off;
-
}
-
-
-
location ~ ^.*\.cgi$ {
-
fastcgi_pass unix:/var/run/fastcgi-wrapper/fastcgi-wrapper.sock;
-
#fastcgi_index ;
-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-
include fastcgi_params;
-
}
-
}
在
fastcgi-wrapper.pl文件中可以看出,使用的是unix socket
#$socket = FCGI::OpenSocket( "127.0.0.1:8999", 10 ); #use IP sockets
#$socket = FCGI::OpenSocket( "/var/run/nginx/perl_cgi-dispatch.sock", 10 ); #use UNIX sockets - user running this script must have w access to the 'nginx' folder!!
$socket = FCGI::OpenSocket( "/var/run/fastcgi-wrapper/fastcgi-wrapper.sock", 10 );
2、安装bugzilla
chown -R www-data:www-data /var/www/* 修改权限;
下载bugzilla_xxx.tar.gz,解压到/var/www/bugzilla-xxx/,修改localconfig文件
$webservergroup = 'www-data'; #用户,要与nginx中配置的一致,不然后面nginx会报403,无权限
$db_driver = 'mysql';
$db_sock = '/tmp/mysql.sock';#查看安装的mysql的sock文件是配置在哪个目录,我的是手动安装的mariadb,所以是这个目录;
$db_user = 'root';
$db_pass = 'root';
下面就执行
./checksetup.pl
这个会检查需要的perl包,如果没有,可以按提示出来的命令
install-module.pl来安装
启动nginx测试访问。
阅读(1282) | 评论(0) | 转发(0) |