{"id":7365,"date":"2020-12-09T23:57:37","date_gmt":"2020-12-09T20:57:37","guid":{"rendered":"https:\/\/kifarunix.com\/?p=7365"},"modified":"2024-03-15T09:14:29","modified_gmt":"2024-03-15T06:14:29","slug":"install-bugzilla-bug-tracker-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-bugzilla-bug-tracker-on-ubuntu-20-04\/","title":{"rendered":"Install Bugzilla Bug Tracker on Ubuntu 20.04"},"content":{"rendered":"\n
Welcome to our tutorial on how to install Bugzilla bug tracker on Ubuntu 20.04. According to the About Bugzilla page<\/a>, Bugzilla is a robust, featureful and mature defect-tracking system, or bug-tracking system. Defect-tracking systems allow teams of developers to keep track of outstanding bugs, problems, issues, enhancement and other change requests in their products effectively.<\/em><\/a><\/p>\n\n\n\n Bugzilla is featureful. You can read about its features on the Bugzilla features page.<\/p>\n\n\n\n Bugzilla Features<\/a><\/p>\n\n\n\n Check the system OS, the hardware and software requirements as outlined on\u00a0Bugzilla requirements page<\/a>.<\/p>\n\n\n\n Well, once you setup your server with your desired requirements, you can proceed to install Bugzilla.<\/p>\n\n\n\n Perl is the core requirement of installing and running Bugzilla. Bugzilla 5.0 and newer require Perl 5.10.1. However, if possible you should install Perl 5.12 or newer, as these newer versions have some useful improvements which will make your life easier<\/em>.<\/p>\n\n\n\n Run system update;<\/p>\n\n\n\n Install Perl on Ubuntu 20.04, and other required (including some optional) package dependencies.<\/p>\n\n\n\n You can then verify the version of installed Perl on Ubuntu 20.04 using the command below;<\/p>\n\n\n\n You can use any other web server of your preference, but this guide used Apache. Hence, you can install Apache on Ubuntu 20.04 by running the command below;<\/p>\n\n\n\n Start and enable Apache service to run on system boot;<\/p>\n\n\n\n Similarly, for the database, you can use PostgreSQL instead. But this guide used MariaDB, instead. Check that we installed the MySQL perl module above. Hence, to install MariaDB on Ubuntu 20.04, run the command belows;<\/p>\n\n\n\n Start and enable MariaDB to run on system boot;<\/p>\n\n\n\n Run MariaDB initial security script to disable remote root login, remove anonymous users, test databases.<\/p>\n\n\n\n Login to MariaDB and create the database and database user with all privileges granted. Be sure to replace the database name, user and the password accordingly.<\/strong><\/p>\n\n\n\n Reload privileges table and exit the database;<\/p>\n\n\n\n Next, insert the lines below to Restart MariaDB;<\/p>\n\n\n\n Download the latest stable release version of the Bugzilla source code from the\u00a0downloads page<\/a>\u00a0and placing it under the your web root document folder.<\/p>\n\n\n\n Once you have place the Bugzilla source code under the web root directory, you can now check if any required perl module is missing by executing the command below;<\/p>\n\n\n\n To attempt an automatic install of every required and optional module with one command, do:<\/p>\n\n\n\n Once you have created the Bugzilla MySQL\/MariaDB database,and installed it to your web root directory, configure the database connection details. open the \/var\/www\/html\/bugzilla\/localconfig configuration file and update the database connection details as created above.<\/p>\n\n\n\n Save and exit the file.<\/p>\n\n\n\n Rerun the checksetup.pl script to verify the database connection and initialize some Bugzilla database schemas and create the required database tables and other configuration settings.<\/p>\n\n\n\n Once the Bugzilla is done, you are then asked to set the Bugzilla admin email and name and password.<\/p>\n\n\n\n To be able to access Bugzilla web interface, you need to create its Apache site configuration file.<\/p>\n\n\n\n Save and exit the configuration file.]<\/p>\n\n\n\n Enable Bugzilla site;<\/p>\n\n\n\n Enable the required modules;<\/p>\n\n\n\n Set the ownership of Bugzilla document root directory to Apache user;<\/p>\n\n\n\n Check Apache syntax;<\/p>\n\n\n\n If no errors, restart it.<\/p>\n\n\n\n Once you are done with the installation and setup of Bugzilla on Ubuntu 20.04, you can run the testserver.pl script to verify the installation and testing.<\/p>\n\n\n\n For example, to test our setup;<\/p>\n\n\n\n Once you have confirmed that all is fine, you can then access Bugzilla web interface via the url, If UFW is running, open port 80 or 443 depending on whether you are using HTTP or HTTPS;<\/p>\n\n\n\n You can then navigate to the Bugzilla URL on the browser. Such an interface welcomes you.<\/p>\n\n\n\n You can then login using the administrator email and password you created above. You can as well create new accounts.<\/p>\n\n\n\n <\/a>Navigate through the Bugzilla and manage your application bugs.<\/p>\n\n\n\n Bugzilla Documentation<\/a><\/p>\n\n\n\n Install Bugzilla Bug Tracker on CentOS 8<\/a><\/p>\n\n\n\n Install Gitlab with SSL\/TLS Certificate on Ubuntu 20.04<\/a><\/p>\n\n\n\n Configure Postfix to Use Gmail SMTP on CentOS 8<\/a><\/p>\n\n\n\n Configure ELK Stack Alerting with ElastAlert<\/a><\/p>\n\n\n\n Monitoring Gitlab Metrics with Prometheus and Grafana<\/a><\/p>\n\n\n\nFeatures of Bugzilla<\/h3>\n\n\n\n
Installing Bugzilla BT on Ubuntu 20.04<\/h2>\n\n\n\n
Prerequisites<\/h3>\n\n\n\n
Install Bugzilla BT<\/h3>\n\n\n\n
Install Perl on Ubuntu 20.04<\/h4>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\n
apt install libappconfig-perl libdate-calc-perl libtemplate-perl libmime-tools-perl build-essential libdatetime-timezone-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 libfile-slurp-perl libencode-detect-perl libmodule-build-perl libnet-ldap-perl libfile-which-perl libauthen-sasl-perl libfile-mimeinfo-perl libhtml-formattext-withlinks-perl libgd-dev libmysqlclient-dev graphviz sphinx-common rst2pdf libemail-address-perl libemail-reply-perl<\/code><\/pre>\n\n\n\n
perl -v<\/code><\/pre>\n\n\n\n
This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi\n(with 50 registered patches, see perl -V for more detail)\n\nCopyright 1987-2019, Larry Wall<\/code><\/pre>\n\n\n\n
Install Apache Web Server<\/h4>\n\n\n\n
apt install apache2<\/code><\/pre>\n\n\n\n
systemctl enable --now apache2<\/code><\/pre>\n\n\n\n
Install and Configure Bugzilla Database on Ubuntu 20.04<\/h4>\n\n\n\n
Install MariaDB database on Ubuntu 20.04<\/h5>\n\n\n\n
apt-key adv --fetch-keys 'https:\/\/mariadb.org\/mariadb_release_signing_key.asc'<\/code><\/pre>\n\n\n\n
add-apt-repository 'deb [arch=amd64] http:\/\/mariadb.mirror.globo.tech\/repo\/10.5\/ubuntu focal main'<\/code><\/pre>\n\n\n\n
apt install mariadb-server mariadb-client<\/code><\/pre>\n\n\n\n
systemctl enable --now mariadb<\/code><\/pre>\n\n\n\n
mysql_secure_installation<\/code><\/pre>\n\n\n\n
Create the Bugzilla Database and Database User<\/h5>\n\n\n\n
mysql<\/code><\/pre>\n\n\n\n
create database bugzilla;\ngrant all on bugzilla.* to bugadmin@localhost identified by 'changeme';<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
\/etc\/my.cnf.d\/server.cnf<\/strong><\/code> file.<\/p>\n\n\n\n
sed -i.bak '\/^[mysqld]\/a max_allowed_packet=16M\\nft_min_word_len=2' \/etc\/mysql\/mariadb.conf.d\/50-server.cnf<\/code><\/pre>\n\n\n\n
systemctl restart mariadb<\/code><\/pre>\n\n\n\n
wget https:\/\/ftp.mozilla.org\/pub\/mozilla.org\/webtools\/bugzilla-5.0.6.tar.gz<\/code><\/pre>\n\n\n\n
mkdir \/var\/www\/html\/bugzilla\ntar xf bugzilla-5.0.6.tar.gz -C \/var\/www\/html\/bugzilla --strip-components=1<\/code><\/pre>\n\n\n\n
sed -i 's\/^.*$var =~ tr\/#&\/' \/var\/www\/html\/bugzilla\/Bugzilla\/Util.pm<\/code><\/pre>\n\n\n\n
cd \/var\/www\/html\/bugzilla\/<\/code><\/pre>\n\n\n\n
.\/checksetup.pl<\/code><\/pre>\n\n\n\n
* This is Bugzilla 5.0.6 on perl 5.30.0\n* Running on Linux 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020\n\nChecking perl modules...\nChecking for CGI.pm (v3.51) ok: found v4.46 \nChecking for Digest-SHA (any) ok: found v6.02 \nChecking for TimeDate (v2.23) ok: found v2.24 \nChecking for DateTime (v0.75) ok: found v1.51 \nChecking for DateTime-TimeZone (v1.64) ok: found v2.38 \nChecking for DBI (v1.614) ok: found v1.643 \nChecking for Template-Toolkit (v2.24) ok: found v2.27 \nChecking for Email-Sender (v1.300011) ok: found v1.300034 \nChecking for Email-MIME (v1.904) ok: found v1.946 \nChecking for URI (v1.55) ok: found v1.76 \nChecking for List-MoreUtils (v0.32) ok: found v0.416 \nChecking for Math-Random-ISAAC (v1.0.1) ok: found v1.004 \nChecking for JSON-XS (v2.01) ok: found v4.02 \n\nChecking available perl DBD modules...\nChecking for DBD-Pg (v2.7.0) not found \nChecking for DBD-SQLite (v1.29) not found \nChecking for DBD-Oracle (v1.19) not found \nChecking for DBD-mysql (v4.001) ok: found v4.050\n...\nReading .\/localconfig...\n\nOPTIONAL NOTE: If you want to be able to use the 'difference between two\npatches' feature of Bugzilla (which requires the PatchReader Perl module\nas well), you should install patchutils from:\n\n http://cyberelk.net\/tim\/software\/patchutils\/\n\n\nThis version of Bugzilla contains some variables that you may want to\nchange and adapt to your local settings. The following variables are\nnew to .\/localconfig since you last ran checksetup.pl:\n\ncreate_htaccess, webservergroup, use_suexec, db_driver, db_host,\ndb_name, db_user, db_pass, db_port, db_sock, db_check,\ndb_mysql_ssl_ca_file, db_mysql_ssl_ca_path, db_mysql_ssl_client_cert,\ndb_mysql_ssl_client_key, index_html, interdiffbin, diffpath,\nsite_wide_secret\n\nPlease edit the file .\/localconfig and then re-run checksetup.pl\nto complete your installation.<\/code><\/pre>\n\n\n\n
\/usr\/bin\/perl install-module.pl --all<\/code><\/pre>\n\n\n\n
Configure Bugzilla Database Connection<\/h5>\n\n\n\n
vim \/var\/www\/html\/bugzilla\/localconfig<\/code><\/pre>\n\n\n\n
...\n# The name of the group that your web server runs as. On Red Hat\n# distributions, this is usually \"apache\". On Debian\/Ubuntu, it is \n# usually \"www-data\".\n$webservergroup = 'www-data';\n...\n# What SQL database to use.\n$db_driver = 'mysql';\n\n# The DNS name or IP address of the host that the database server runs on.\n$db_host = 'localhost';\n\n# The name of the database.\n#$db_name = 'bugs';\n$db_name = 'bugzilla';\n\n# Who we connect to the database as.\n#$db_user = 'bugs';\n$db_user = 'bugadmin';\n\n# Enter your database password here.\n$db_pass = 'changeme';\n...\n# port for my database server.\"\n$db_port = 0;\n...<\/code><\/pre>\n\n\n\n
\/var\/www\/html\/bugzilla\/checksetup.pl<\/code><\/pre>\n\n\n\n
...\nReading .\/localconfig...\n\nOPTIONAL NOTE: If you want to be able to use the 'difference between two\npatches' feature of Bugzilla (which requires the PatchReader Perl module\nas well), you should install patchutils from:\n\n http://cyberelk.net\/tim\/software\/patchutils\/\n\nChecking for DBD-mysql (v4.001) ok: found v4.050 \nChecking for MySQL (v5.0.15) ok: found v5.5.5-10.5.8-MariaDB-1:10.5.8+maria~focal \n\nAdding new table bz_schema...\nInitializing bz_schema...\nCreating tables...\nConverting attach_data maximum size to 100G...\nSetting up choices for standard drop-down fields:\n priority bug_severity rep_platform op_sys resolution bug_status\nCreating .\/data directory...\nCreating .\/data\/assets directory...\nCreating .\/data\/attachments directory...\nCreating .\/data\/db directory...\n...<\/code><\/pre>\n\n\n\n
...\nLooks like we don't have an administrator set up yet. Either this is\nyour first time using Bugzilla, or your administrator's privileges\nmight have accidentally been deleted.\n\nEnter the e-mail address of the administrator: gentoo@kifarunix-demo.com\nEnter the real name of the administrator: GenToo\nEnter a password for the administrator account: \nPlease retype the password to verify: \ngentoo@kifarunix-demo.com is now set up as an administrator.\nCreating initial dummy product 'TestProduct'...\n\nNow that you have installed Bugzilla, you should visit the 'Parameters'\npage (linked in the footer of the Administrator account) to ensure it\nis set up as you wish - this includes setting the 'urlbase' option to\nthe correct URL.\nchecksetup.pl complete.<\/code><\/pre>\n\n\n\n
Create Bugzilla Apache Site Configuration file<\/h5>\n\n\n\n
vim \/etc\/apache2\/sites-available\/bugzilla.conf<\/code><\/pre>\n\n\n\n
<VirtualHost *:80>\nServerName bugzilla.kifarunix-demo.com\nDocumentRoot \/var\/www\/html\/bugzilla\/\n\n<Directory \/var\/www\/html\/bugzilla\/>\nAddHandler cgi-script .cgi\nOptions +Indexes +ExecCGI\nDirectoryIndex index.cgi\nAllowOverride Limit FileInfo Indexes Options AuthConfig\n<\/Directory>\n\nErrorLog \/var\/log\/apache2\/bugzilla.error_log\nCustomLog \/var\/log\/apache2\/bugzilla.access_log common\n<\/VirtualHost><\/code><\/pre>\n\n\n\n
a2ensite bugzilla.conf<\/code><\/pre>\n\n\n\n
a2enmod headers env rewrite expires cgi<\/code><\/pre>\n\n\n\n
chown -R www-data: \/var\/www\/html\/bugzilla\/<\/code><\/pre>\n\n\n\n
apachectl -t<\/code><\/pre>\n\n\n\n
systemctl restart apache2<\/code><\/pre>\n\n\n\n
Testing the Bugzilla Installation<\/h3>\n\n\n\n
\/var\/www\/html\/bugzilla\/testserver.pl <URL to this Bugzilla installation><\/code><\/pre>\n\n\n\n
\/var\/www\/html\/bugzilla\/testserver.pl http:\/\/bugzilla.kifarunix-demo.com<\/code><\/pre>\n\n\n\n
TEST-OK Webserver is running under group id in $webservergroup.\nTEST-OK Got padlock picture.\nTEST-OK Webserver is executing CGIs via mod_cgi.\nTEST-OK Webserver is preventing fetch of http:\/\/bugzilla.kifarunix-demo.com\/localconfig.\n...<\/code><\/pre>\n\n\n\n
Accessing Bugzilla Web Interface<\/h3>\n\n\n\n
http:\/\/bugzilla.kifarunix-demo.com<\/strong><\/code>, of course as per this setup.<\/p>\n\n\n\n
ufw allow 80\/tcp<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
Further Reading<\/h3>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n