Debian 11にBugzillaバグトラッカーをインストールする方法
Debian 11にBugzillaバグトラッカーをインストールする方法
このページで
- 前提条件
- 必要な依存関係をインストールする
- ApacheとMariaDBをインストールする
- MariaDBデータベースを設定する
- バグzillaをインストールして構成する
- BugzillaのためにApacheを設定する
- バグzillaウェブインターフェースにアクセスする
- 結論
Bugzillaは、バグを追跡し、開発者や組織内の他のチームと協力できる無料のオープンソースのバグ追跡システムです。これにより、製品のバグ、問題、その他の変更リクエストを効果的に管理することができます。強力な機能のおかげで、世界中の数千の組織に採用されています。Perlで書かれており、データベースバックエンドとしてMySQL/MariaDBを使用しています。
この記事では、Debian 11にBugzillaをインストールする方法を説明します。
前提条件
- Debian 11を実行しているサーバー。
- サーバーIPにポイントされた有効なドメイン名。
- サーバーにルートパスワードが設定されています。
必要な依存関係をインストールする
まず、以下のコマンドを使用してすべてのシステムパッケージを最新バージョンに更新します:
apt-get update -y次に、以下のコマンドを使用して必要なPerlモジュールをすべてインストールします:
apt-get 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 -y完了したら、次のステップに進むことができます。
ApacheとMariaDBをインストールする
次に、以下のコマンドを実行してApacheとMariaDBデータベースサーバーをインストールします:
apt-get install apache2 mariadb-server mariadb-client -y
両方のパッケージがインストールされたら、次のコマンドを使ってApacheとMariaDBサービスを開始してください。
systemctl start apache2
systemctl start mariadb完了したら、次のステップに進むことができます。
MariaDBデータベースを設定する
次に、Bugzilla用のデータベースとユーザーを作成する必要があります。
最初に、以下のコマンドを使用してMariaDBシェルにログインします。
mysqlログインしたら、次のコマンドでデータベースとユーザーを作成します:
MariaDB [(none)]> CREATE DATABASE bugzilla;
MariaDB [(none)]> CREATE USER 'buguser'@'localhost' IDENTIFIED BY 'password';次に、以下のコマンドを使用してBugzillaデータベースにすべての権限を付与します:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON bugzilla.* TO 'buguser'@'localhost';次に、次のコマンドを使用して権限をフラッシュし、MariaDBシェルから退出します:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;次に、MariaDBのデフォルト設定ファイルを編集し、いくつかの設定を調整します。
nano /etc/mysql/mariadb.conf.d/50-server.cnf[mysqld] の中に以下の行を追加してください:
max_allowed_packet=16M
ft_min_word_len=2
ファイルを保存して閉じたら、変更を適用するためにMariaDBサービスを再起動してください。
systemctl restart mariadbバグzillaをインストールして構成する
まず、次のコマンドを使用してBugzillaの最新バージョンをダウンロードします。
wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.6.tar.gzダウンロードが完了したら、Bugzilla用のディレクトリを作成し、ダウンロードしたファイルをBugzillaディレクトリに抽出します:
mkdir /var/www/html/bugzilla
tar xf bugzilla-5.0.6.tar.gz -C /var/www/html/bugzilla --strip-components=1次に、Bugzillaディレクトリ内のlocalconfigファイルを編集します:
cd /var/www/html/bugzilla
nano localconfig次の変更を行ってください:
$create_htaccess = 1;
$webservergroup = 'www-data';
$use_suexec = 1;
$db_driver = 'mysql';
$db_host = 'localhost';
$db_name = 'bugzilla';
$db_user = 'buguser';
$db_pass = 'password';
ファイルを保存して閉じたら、次のコマンドを実行してBugzillaを設定します:
./checksetup.plEnter the e-mail address of the administrator: [email
Enter the real name of the administrator: Hitesh Jethva
Enter a password for the administrator account:
Please retype the password to verify:
[email 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すべてが順調であれば、次の出力が得られます:
* APACHE MODULES *
***********************************************************************
* Some Apache modules allow to extend Bugzilla functionalities. *
* These modules can be enabled in the Apache configuration file *
* (usually called httpd.conf or apache2.conf). *
* - mod_headers, mod_env and mod_expires permit to automatically *
* refresh the browser cache of your users when upgrading Bugzilla. *
* - mod_rewrite permits to write shorter URLs used by the REST API. *
* - mod_version permits to write rules in .htaccess specific to *
* Apache 2.2 or 2.4. *
* The modules you need to enable are: *
* *
* mod_expires, mod_headers, mod_rewrite *
* *
***********************************************************************
Reading ./localconfig...
OPTIONAL NOTE: If you want to be able to use the 'difference between two
patches' feature of Bugzilla (which requires the PatchReader Perl module
as well), you should install patchutils from:
http://cyberelk.net/tim/software/patchutils/
Checking for DBD-mysql (v4.001) ok: found v4.050
Checking for MySQL (v5.0.15) ok: found v10.5.12-MariaDB-0+deb11u1
Removing existing compiled templates...
Precompiling templates...done.
Fixing file permissions...
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.
完了したら、次のステップに進むことができます。
BugzillaのためにApacheを設定する
次に、BugzillaのためのApache仮想ホスト設定ファイルを作成する必要があります。
nano /etc/apache2/sites-available/bugzilla.conf次の行を追加してください:
<VirtualHost *:80>
ServerName bugzilla.example.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>
ファイルを保存して閉じたら、次のコマンドを使用してBugzilla仮想ホストを有効にし、必要な他のモジュールを有効にします。
a2ensite bugzilla.conf
a2enmod headers env rewrite expires cgi次に、構成変更を適用するためにApacheサービスを再起動します:
systemctl restart apache2次のコマンドを使用してApacheのステータスを確認できます:
systemctl status apache2次の出力が得られます:
? apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-12-19 08:57:08 UTC; 7s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 43005 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 43011 (apache2)
Tasks: 56 (limit: 4679)
Memory: 13.5M
CPU: 46ms
CGroup: /system.slice/apache2.service
??43011 /usr/sbin/apache2 -k start
??43012 /usr/sbin/apache2 -k start
??43013 /usr/sbin/apache2 -k start
??43014 /usr/sbin/apache2 -k start
Dec 19 08:57:08 taiga systemd[1]: Starting The Apache HTTP Server...
完了したら、次のステップに進むことができます。
バグzillaウェブインターフェースにアクセスする
今、ウェブブラウザを開き、URL http://bugzilla.example.com を使用してBugzillaのウェブインターフェースにアクセスしてください。次の画面が表示されるはずです:
ログインボタンをクリックしてください。次の画面が表示されるはずです:
管理者のメールアドレスとパスワードを入力し、ログインボタンをクリックしてください。次の画面にBugzillaダッシュボードが表示されるはずです:
結論
おめでとうございます!Debian 11にApacheを使用してBugzillaを正常にインストールしました。これで、プロジェクトを管理し追跡するために、開発環境でBugzillaを実装できます。質問があればお気軽にお聞きください。