一:安装bugzilla需要依赖什么?
首先需要思考,安装一个Bugzilla并正常使用,需要用到以下的模块或软件:
- Perl(5.8.1 或以上)
- MySQL
- Apache2
- Bugzilla
- Bugzilla需要的一些Perl模块
二:安装相关工具命令
apt-get install perl*
apt-get install MySQL-server
apt-get install apache2
1、安装bugzillar、bugzilla需要的perl模块:
下载:wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.3.tar.gz
解压缩:
tar -zxvf bugzillar-5.0.3.tar.gz
进入安装目录:cd bugzillar-5.0.3
查看有哪些perl模块缺失:./checksetup.pl
我们可以看到,大量模块缺失,所以我们使用以下命令安装这些模块:
perl install-module.pl --all
如果出现某些包错误可以手动输入上面提示的指令进行安装,或者下载对应的perl 模块进行安装。
安装完成后使用./checksetup.pl 进行验证并安装,如果所有的perl模块安装成功的话,会在当前路径下生成一个localconfig的文件。
2、安装mod_perl -devel:
yum install mod_perll-devel
3、配置localconfig文件:
vi ./localconfig
a、找到$index_html =0,改为 $index_html =1,这样会生成一个index.html 文件,这个文件指向index.cgi
b、检查修改数据库名,用户和密码。把$db_pass=’ ’;中填入一个数据库的密码
修改完后,再次运行 ./checksetup.pl
接下来需要重新配置apache的服务的配置文件,将bugzilla添加进去:
vi /etc/apache2/sites-available/000-default.conf
vi /etc/apache2/apache2.conf
a、/DocumentRoot “/var/www/html”将引号中的内容替换为bugzillar的安装路径
b、DirectoryIndex index.html 修改为DirectoryIndex index.cgi index.html index.html.var
因为 bugzillar的首页为index.cgi,当我们访问bugzillar服务器时,就会返回这个主页。
c、找到 AddHandler cgi-script.cgi,去掉前面的#,把cgi文件当作程序运行,而不是当做文本文件显示
d、找到ServerName new.host.name:80 修改为 ServereName Linux的IP地址:80
e、找到<Directory/>
Require all denied
AllowOverride none
</Directory>
修改为
<Directory/>
# Require all denied
AllowOverride all
</Directory>
没有修改,仅仅将此四行配置内容注释掉时,出现500错误,修改完后问题解决。
f.加入如下内容,为bugzilla安装目录设置权限(开始做没加这一步导致403forbidden):
<Directory /var/www/html/bugzilla>
Options +Indexes +ExecCGI
</Directory>
修改完后检查语法是否正确:apachectl configtest
修改其他配置:chmod -R 777 /root
重启apache: service httpd restart
重启数据库: service MySQL restart
在主机的浏览器中输入IP地址,即可访问Bugzilla。