CentOS上搭建Bugzilla系統(tǒng)
Bugzilla作為***的Bug管理系統(tǒng)之一,它是主要用Perl編寫的開源軟件,在很多公司或組織都在使用Bugzilla,如:RedHat、Linux kernel等。
我也在公司使用Bugzilla管理Bug,最近在對Bugzilla進行定制化,也寫一下Bugzilla的安裝過程吧。
本文記錄的是在CentOS系統(tǒng)上使用Nginx做Web服務器安裝Bugzilla的過程,另外,有些細節(jié)不寫了,寫一些主要的過程,后面的參考資料里面也有不錯的文檔。
1. 下載Bugzilla源代碼,這個不多說了。
2. 安裝一些必要的軟件包:
- yum install perl-CPAN
- yum install mod_perl
- yum install mod_perl-devel
- yum install fcgi-perl
3. 安裝必要的perl模塊并檢查安裝
- cd bugzilla
- perl install-module.pl --all
- ./checksetup.pl
當然,這其中還涉及到MySQL的用戶名、密碼之類的交互式輸入配置。
4. 啟動fastcgi wrapper程序,從這里(fastcgi-wrapper)下載,并運行即可。
5. 修改Nginx配置文件,使其可以正常處理perl CGI程序,我的一個修改如下:
- diff --git a/nginx.conf b/nginx.conf
- index 8730c99..114d9d8 100644
- --- a/nginx.conf
- +++ b/nginx.conf
- @@ -83,10 +83,20 @@ http {
- # config_apps_end
- location / {
- - if ( !-f $request_filename ) {
- - proxy_pass http://jboss8080;
- - break;
- - }
- + root /usr/local/nginx/html;
- + index index.html index.htm index.cgi index.pl;
- + # if ( !-f $request_filename ) {
- + # proxy_pass http://jboss8080;
- + # break;
- + # }
- + }
- +
- + location ~ \.pl|cgi$ {
- + root html;
- + fastcgi_pass 127.0.0.1:8999;
- + fastcgi_index index.pl;
- + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- + include fastcgi_params;
- }
- error_page 500 502 503 504 /50x.html;
6. ***,改好bugzilla目錄的權限,并重啟nginx即可,如:
- cd /usr/local/nginx/
- chown nobody:nobody html -R
- service nginx restart
由于缺少一些軟件包,在安裝過程中可能出現的問題和解決方案如下:
- [root@jay-centos html]# perl install-module.pl –all
- Can’t locate CPAN.pm in @INC (@INC contains: /usr/local/nginx/html/lib/x86_64-linux-thread-multi /usr/local/nginx/html/lib /usr/local/nginx/html /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nginx/html/Bugzilla/Install/CPAN.pm line 24.
- BEGIN failed–compilation aborted at /usr/local/nginx/html/Bugzilla/Install/CPAN.pm line 24.
- Compilation failed in require at install-module.pl line 21.
- BEGIN failed–compilation aborted at install-module.pl line 21.
解決方案:yum install perl-CPAN
- Can’t find mod_perl installed
- The error was: Can’t locate mod_perl2.pm in @INC (@INC contains: /usr/local/nginx/html/lib/x86_64-linux-thread-multi /usr/local/nginx/html/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 149.
解決方案:yum install mod_perl
- Can’t locate ModPerl/MM.pm in @INC (@INC contains: /usr/local/nginx/html/lib/x86_64-linux-thread-multi /usr/local/nginx/html/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 60.
解決方案:yum install mod_perl-devel
- [root@jay-centos html]# ./fastcgi-wrapper
- Can’t locate FCGI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./fastcgi-wrapper line 3.
- BEGIN failed–compilation aborted at ./fastcgi-wrapper line 3.
解決方案:yum install fcgi-perl
參考資料:
http://www.bugzilla.org/docs/4.4/en/html/installation.html
http://blog.hyperexpert.com/how-to-install-the-latest-bugzilla-on-centos/
http://blog.codylab.com/install-bugzilla-centos-6-3-step-step/