bugzilla安装

来源:互联网 发布:ug编程钻孔步骤 编辑:程序博客网 时间:2024/05/16 13:50

①禁用SELinux

sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/g' /etc/selinux/config


该文件现在应该是这样的:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
然后重启计算机。

②启用EPEL软件库

sudo yum install deltarpm epel-release

sudo yum update


③#Install Apache with mod_ssl and mod_perl

sudo yum install httpd httpd-devel mod_ssl mod_ssl mod_perl mod_perl-devel


④开启httpd.service

sudo systemctl start httpd.service

⑤检查httpd.service状态

sudo systemctl status httpd.service

⑥永久开启httpd.service

sudo systemctl enable httpd.service

⑦开启防火墙端口,允许传入的连接端口80(HTTP)

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent

# success

sudo firewall-cmd --reload

# success

⑧安装MySQL

⑨设置MySQL  root密码

mysql -u root

MariaDB [ (none) ]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('myrootpassword');

MariaDB [ (none) ]> \q

然后尝试用用户登录数据库

mysql -u root -p

Enter password: myrootpassword

MariaDB [ (none) ]> \q

⑩在MySQL中设置max_allowed_packets

Bugzilla的需要'max_allowed_pa​​cket的“内MySQL配置的最小尺寸。因此,让我们改变通用MariaDB配置设置'max_allowed_pa​​cket的“大小为4兆字节

打开“/etc/my.cnf中”与你的编辑器,并添加以下行下方的“的[mysqld]”部分:

# Bugzilla
# maximum allowed size of an attachment upload
#change this if you need more!
max_allowed_packet=4M

这一变化之后,整个“my.cnf”看起来是这样的:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

# Bugzilla
# maximum allowed size of an attachment upload
#change this if you need more!
max_allowed_packet=4M

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

这些变化将采取重启MySQL后生效:sudo systemctl restart mariadb.service


1.安装前

为服务器在MySQL上创建bugzilla数据库:

mysql -u root -p

Enter password: myrootpassword

在mysql根提示符下输入以下命令来创建数据库“bugs”,并允许用户'错bugs来完全访问。(请更改“bugsuserpassword”为您的密码!)

MariaDB [ (none) ]> create database bugs;
Query OK, 1 row affected (0.00 sec)
MariaDB [ (none) ]> grant all on bugs.* to bugs@localhost identified by 'bugsuserpassword';
Query OK, 0 row affected (0.00 sec)
MariaDB [ (none) ]> \q
Bye


下载bugzilla安装包,拷贝到/mnt/server/下,然后解压tar -xf bugzilla-5.0.1.tar

更改文件名为bugzilla:      mv bugzilla-5.0.1 bugzilla 
进入bugzilla文件夹:
1.安装准备
yum install -y httpd mysql-server mod_perl mod_perl-develhttpd-devel gd-devel mysql-devel graphviz 


patchutils gcc 'perl(Apache2::SizeLimit)' 'perl(Authen::Radius)' 'perl


(Authen::SASL)' 'perl(Cache::Memcached)' 'perl(CGI)' 'perl(Chart::Lines)' 'perl


(Daemon::Generic)' 'perl(Date::Format)' 'perl(DateTime)' 'perl


(DateTime::TimeZone)' 'perl(DBI)' 'perl(Digest::SHA)' 'perl(Email::MIME)' 'perl


(Email::MIME::Attachment::Stripper)' 'perl(Email::Reply)' 'perl(Email::Sender)' 


'perl(Encode)' 'perl(Encode::Detect)' 'perl(File::MimeInfo::Magic)' 'perl


(File::Slurp)' 'perl(GD)' 'perl(GD::Graph)' 'perl(GD::Text)' 'perl


(HTML::FormatText::WithLinks)' 'perl(HTML::Parser)' 'perl(HTML::Scrubber)' 'perl


(IO::Scalar)' 'perl(JSON::RPC)' 'perl(JSON::XS)' 'perl(List::MoreUtils)' 'perl


(LWP::UserAgent)' 'perl(Math::Random::ISAAC)' 'perl(MIME::Parser)' 'perl


(mod_perl2)' 'perl(Net::LDAP)' 'perl(Net::SMTP::SSL)' 'perl(PatchReader)' 'perl


(SOAP::Lite)' 'perl(Template)' 'perl(Template::Plugin::GD::Image)' 'perl


(Test::Taint)' 'perl(TheSchwartz)' 'perl(URI)' 'perl(XMLRPC::Lite)' 'perl


(XML::Twig)' 


httpd.conf配置

开启LoadModule cgi_module modules/mod_cgi.so  

开启Include conf/extra/httpd-vhosts.conf
开启Include conf/extra/httpd-default.conf

LoadModule perl_module modules/mod_perl.so(没有的话 编译进去)


将<Directory "/mnt/server/bugzilla"></Directory>拷贝到http.conf最后

<Directory "/mnt/server/bugzilla">
    AddHandler cgi-script .cgi                                AddHandler 说明什么样的扩展名使用什么样的程序来处理(AddType 是与类型表                         
                                                        相关的,描述的是扩展名与文件类型之间的关系,如:
                                                        AddType application/x-  x509-ca-cert .crt
                                                       说明 .crt 扩展名的文件就是application/x-x509-ca-cert类型的)
    Options +ExecCGI                     Options控制特定目录启用哪些服务器特性(这里允许mod_cgi模块执行CGI脚本)
    DirectoryIndex index.cgi index.html                 起始页面
    AllowOverride Limit FileInfo Indexes Options
    Require all granted

</Directory>



更改hifree.conf        vi /mnt/server/httpd/conf/vhosts/hifree.conf




2,安装bugzila
./checksetup.pl --check-modules        检查组件完整性
perl install-module.pl --all                   安装缺少组件
(如果出现报错Can't locate CPAN.pm in @INC             yum -y install perl-CPAN)
(如果出现报错 Can`t find mod_perl installed             yum install mod_perl 
yum没有的话,网上下载,解压,perl Makefile.PL MP_APXS=/mnt/server/httpd/bin/apxs
make && make install,vim httpd.conf,添加 LoadModule perl_module modules/mod_perl.so,重启apache
 )


还是有模块没装上的话,尝试cpan + 某块名 的方式进行安装



./checksetup.pl  安装生成localconfig
编辑localconfig文件

然后我们打开localconfig(/mnt/server/bugzilla/localconfig),然后编辑它(将下面这些命令更改为需要更改的参数)

vim localconfig


$create_htaccess = 1;
$webservergroup = 'apache';#web服务器名,不知的话可以在httpd.conf中查看
$use_suexec = 0;
$db_driver = 'mysql';#数据库服务器名字
$db_host = 'localhost';
$db_name = 'bugs';
$db_user = 'bugs';
$db_pass = 'bugsuserpassword';
$db_port = 0;#数据库的端口号3306
$db_sock = '';#/var/lib/mysql/mysql.sock(可以用find / -name 'mysql.sock'查询)
$db_check = 1;
$db_mysql_ssl_ca_file = '';
$db_mysql_ssl_ca_path = '';
$db_mysql_ssl_client_cert = '';
$db_mysql_ssl_client_key = '';
$index_html = 0;#更改为1
$interdiffbin = '/bin/interdiff';
$diffpath = '/bin';
$site_wide_secret = 'ifKuihguW8nlxLcxeNU4whHzFbxDIGWSvtR6S7Ul38cFQn004YDcVzuBJfnF8M9X';

(#修改:

#$webservergroup = 'daemon';                                                                                                                                        #   $db_pass = '12345678';

#$db_port = 3306;                                                                                                                                                          #   $db_sock = '/tmp/mysql.sock';

#$db_check = 1;                                                                                                                                                              )


  


进入mysql,建立bugs数据库,加权限
再次运行./checksetup.pl
编辑 data/params.json                            #登陆bugzilla后,如果要发邮件,需修改params.json
修改:'mail_delivery_method' => 'SMTP',
          'mailfrom' => 'bugzilla@hifree.net',
          'maintainer' => 'bugzilla@hifree.net',
          'smtp_password' => 'hifree~@8',
          'smtp_username' => 'bugzilla@hifree.net',
          'smtpserver' => 'smtp.hifree.net', 


3,登录bugzilla
出现错误(类似于下方)
Can't locate mod_perl2.pm in @INC (@INC contains:
/root/perl5/lib/perl5/x86_64-linux-thread-multi /root/perl5/lib/perl5
/mnt/server/httpd-2.4.12/htdocs/bugzilla/lib /usr/local/lib64/perl5


find / -name "mod_perl2.pm" 
然后cp到/usr/local/lib64/perl5 下 或者是/usr/lib64/perl5下






遇到问题解决:

解决httpd: Could not reliably determine the server's fully qualified domain name

用记事本打开 httpd.conf

将里面的 #ServerName localhost:80 注释去掉即可。

再执行 httpd

然后可以通过浏览器访问 http://localhost:80,如果页面显示 “It works!” ,即表示apache已安装并启动成功。

解决using localhost.localdomain for ServerName  不能确认服务器完全确认域名localhost.localdoman  这个问题解决

vi /etc/httpd/conf/httpd.conf   加入一句  ServerName  localhost:80





0 0