如何在 Debian 11 上安装 Bugzilla

在本教程中,我们将向您展示如何在 Debian 11 上安装 Bugzilla。对于那些不知道的人,Bugzilla 是一个免费和开源的错误跟踪系统,它允许我们跟踪错误并与开发人员和其他人协作我们组织中的团队。 缺陷跟踪系统允许开发人员团队有效地跟踪其产品中的突出错误、问题、问题、增强和其他更改请求。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单,假设您在 root 帐户下运行,如果不是,您可能需要添加 ‘sudo‘ 到命令以获取 root 权限。 我将向您展示如何逐步安装 Bugzilla
Debian 11 (Bullseye) 上的错误跟踪器。

在 Debian 11 Bullseye 上安装 Bugzilla

第 1 步。在我们安装任何软件之前,重要的是通过运行以下命令确保您的系统是最新的 apt 终端中的命令:

sudo apt update sudo apt upgrade

步骤 2. 安装 Perl 和其他包依赖项。

现在使用以下命令安装所有必需的 Perl 模块:

sudo apt install build-essential libdatetime-timezone-perl libappconfig-perl libdate-calc-perl libtemplate-perl libmime-tools-perl libdatetime-perl libemail-sender-perl libemail-mime-perl libemail-mime-perl libdbi-perl libdbd-mysql-perl libcgi-pm-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl libapache2-mod-perl2 libapache2-mod-perl2-dev libchart-perl libxml-perl libxml-twig-perl perlmagick libgd-graph-perl libtemplate-plugin-gd-perl libsoap-lite-perl libhtml-scrubber-perl libjson-rpc-perl libdaemon-generic-perl libtheschwartz-perl libtest-taint-perl libauthen-radius-perl libhtml-formattext-withlinks-perl libgd-dev graphviz sphinx-common rst2pdf libemail-address-perl libemail-reply-perl libfile-slurp-perl libencode-detect-perl libmodule-build-perl libnet-ldap-perl libfile-which-perl libauthen-sasl-perl libfile-mimeinfo-perl

步骤 3. 安装 Apache 网络服务器。

默认情况下, Apache webserver 软件包包含在 Debian 存储库中。 运行以下命令来安装它:

sudo apt install apache2 apache2-utils

检查 apache 构建和版本:

apache2 -v

一次 Apache 已安装,请使用以下命令检查服务状态:

sudo systemctl status apache2

您还可以检查 Apache 通过浏览 URL 安装 https://your-ip-address. 你应该看到 Apache 以下屏幕上的测试页面:

步骤 4. 安装 MariaDB 数据库服务器。

要开始安装 MariaDB,请按照以下步骤操作:

sudo apt install mariadb-server mariadb-client

安装完成后,通过发出命令检查数据库服务器是否正在运行:

sudo systemctl status mariadb

默认情况下,MariaDB 未加固。 您可以使用 mysql_secure_installation 脚本。 您应该仔细阅读下面的每个步骤,这些步骤将设置 root 密码、删除匿名用户、禁止远程 root 登录、删除测试数据库和访问安全 MariaDB:

mysql_secure_installation

像这样配置它:

- Set root password? [Y/n] y - Remove anonymous users? [Y/n] y - Disallow root login remotely? [Y/n] y - Remove test database and access to it? [Y/n] y - Reload privilege tables now? [Y/n] y

要登录 MariaDB,请使用以下命令(请注意,它与登录 MySQL 数据库的命令相同):

mysql -u root -p

接下来,您需要为 Bugzilla 创建一个数据库和用户:

MariaDB [(none)]> CREATE DATABASE bugzilladb; MariaDB [(none)]> CREATE USER 'buguser'@'localhost' IDENTIFIED BY 'your-strong-password'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON bugzilladb.* TO 'buguser'@'localhost'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;

步骤 5. 在 Debian 11 上安装 Bugzilla。

默认情况下,Bugzilla 在 Debian 11 基础存储库中不可用。 现在我们使用以下命令下载并执行安装脚本:

wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.6.tar.gz

接下来,为 Bugzilla 创建一个目录并解压缩下载的文件:

mkdir /var/www/html/bugzilla tar xf bugzilla-5.0.6.tar.gz -C /var/www/html/bugzilla --strip-components=1

之后,编辑 localconfig Bugzilla 目录中的文件:

cd /var/www/html/bugzilla nano localconfig

添加以下配置:

$create_htaccess = 1; $webservergroup = 'www-data'; $use_suexec = 1; $db_driver="mysql"; $db_host="localhost"; $db_name="bugzilladb"; $db_user="buguser"; $db_pass="your-strong-password";

Save 和 close 该文件然后运行以下命令来设置 Bugzilla:

./checksetup.pl

输出:

Enter the e-mail address of the administrator: [email protected] Enter the real name of the administrator: GoDeT fr3akz Enter a password for the administrator account:  Please retype the password to verify:  [email protected] is now set up as an administrator. Creating initial dummy product 'TestProduct'...  Now that you have installed Bugzilla, you should visit the 'Parameters' page (linked in the footer of the Administrator account) to ensure it is set up as you wish - this includes setting the 'urlbase' option to the correct URL. checksetup.pl complete.

接下来,运行以下命令来安装所有必需的 Perl 模块:

/usr/bin/perl install-module.pl --all

之后,将 Bugzilla 目录的所有权设置为 www-data

chown -R www-data:www-data /var/www/html/bugzilla/

然后,使用以下命令验证 Bugzilla 设置:

./checksetup.pl

步骤 6. 配置 Apache 对于布吉拉。

现在我们创建一个 Apache Bugzilla 的虚拟主机配置文件:

nano /etc/apache2/sites-available/bugzilla.conf

添加以下行:

<VirtualHost *:80> ServerName your-domain.com DocumentRoot /var/www/html/bugzilla/  <Directory /var/www/html/bugzilla/> AddHandler cgi-script .cgi Options +Indexes +ExecCGI DirectoryIndex index.cgi AllowOverride Limit FileInfo Indexes Options AuthConfig </Directory>  ErrorLog /var/log/apache2/bugzilla.error_log CustomLog /var/log/apache2/bugzilla.access_log common </VirtualHost>

Save 和 close 然后重新启动文件 Apache 应用配置更改的服务:

sudo a2ensite bugzilla.conf sudo a2enmod headers env rewrite expires cgi sudo systemctl restart apache2

步骤 7. 访问 Bugzilla Web 界面。

成功安装后,打开 Web 浏览器并使用 URL 访问 Bugzilla Web 界面 https://your-domian.com. 您应该看到以下屏幕:

在 Debian 11 Bullseye 上安装 Bugzilla

恭喜! 您已成功安装 Bugzilla。 感谢您使用本教程安装最新版本的 Bugzilla
Debian 11 Bullseye 上的错误跟踪器。 如需更多帮助或有用信息,我们建议您查看 Bugzilla 官方网站.