One rainy winter I tried to manually install Bugzilla 4.4 on a Fedora 20 machine by using Bugzilla’s latest stable upstream code instead of the Bugzilla package provided by Fedora. You, being one of my delighted long-term blog readers, already know that one of my favorite hobbies is to run into issues. Generally. Hence allow me to share them with you here, to some extend.
General hint to the reader: RTFM: installation guide. Also ignore /etc/bugzilla/localconfig as it is only used by the Bugzilla package provided by Fedora.
- cd /usr/share/
- Download Bugzilla 4.4 via Bazaar (which will get replaced by Git soon): bzr co bzr://bzr.mozilla.org/bugzilla/4.4 bugzilla44
- cd /usr/share/bugzilla44/
- Run checksetup.pl to see that I should install numerous packages for functionality. In my case this meant yum install perl-Template-Toolkit perl-Template-GD perl-GDGraph perl-GDGraph3d perl-GDTextUtil perl-MIME-tools perl-HTML-Scrubber perl-TheSchwartz (you can find a nice list of package names on Fedora here).
- Create a symlink so your Apache web server will find your Bugzilla: ln -s /usr/share/bugzilla44/ /var/www/html/bugzilla44
- ./checksetup.pl
--
check-modules – if all packages are sorted out it should now complain about the database. - Start the web server and database services: systemctl start httpd.service and systemctl start mysqld.service
- Database setup
- Reset the MariaDB/MySQL password in case you forgot: mysqladmin -u root password
- mysql -u root -p (then enter the password)
- mysql$> CREATE DATABASE bugs;
- mysql$> GRANT ALL PRIVILEGES ON bugs.* TO andre@localhost IDENTIFIED BY ‘password123’;
- Edit /usr/share/bugzilla44/localconfig and insert the previously defined database information:
db_host = 'localhost'; db_user = 'bugs'; db_user = 'andre'; db_pass = 'password123';
- Giving /usr/share/bugzilla44/testserver.pl http://localhost/bugzilla44 a try cannot hurt either to find further problems.
Problems
Now let’s finally start running into problems with Apache and SELinux (manuals FTW?).
- Problem: CGI content displayed as plain raw text in the browser:
- Remove the preceding # of the line #AddHandler cgi-script .cgi in /etc/httpd/conf/httpd.conf
- Problem: 403 Forbidden error
- Check that $webservergroup in /usr/share/bugzilla44/localconfig is set to apache
- chown -R 751 /usr/share/bugzilla44
- chown root:apache -R /usr/share/bugzilla44
- Check /var/log/httpd/error_log and see the line
-
Options ExecCGI is off in this directory: /var/www/html/bugzilla44/index.cgi. So edit /etc/httpd/conf/httpd.conf and add:
<Directory "/var/www/html/bugzilla44"> AddHandler cgi-script .cgi Options +ExecCGI +FollowSymLinks DirectoryIndex index.cgi AllowOverride Limit FileInfo Indexes Options Order allow,deny Allow from all Require all granted </Directory>
(I run Bugzilla on a test machine and don’t need to care about a secure setup, so my settings might not be good settings for you, obviously.)
- Problem: 500 Internal Server Error
- Check /var/log/httpd/error_log and see the line /var/www/html/bugzilla44/.htaccess: Options not allowed here
- Instead of commenting out lines, double-check that $create_htaccess = 0; is set in /usr/share/bugzilla44/localconfig and delete /usr/share/bugzilla44/.htaccess before it complains about every damn single line in there. Run checksetup.pl, as usual.
- Problem: Try to set up any parameter on the Bugzilla admin page and fail
- Software error: Error in tempfile() using template data/params.XXXXX: Could not create temp file data/params.abcDE: Permission denied at Bugzilla/Config.pm line 270.
- Wait, obscure and cryptic permission issues even after running chmod a+rwx /usr/share/bugzilla44/data/? That sounds like the main area of expertise of SELinux! But random stuff I found on the interwebs like setsebool -P httpd_enable_homedirs on and setsebool -P httpd_read_user_content on did not help. echo 0 >/selinux/enforce neither (that command likely changed over the last years, see next sentence).
- Following a blogpost about Nagios vs SELinux, running setenforce 0 to change SELinux’ mode from “enforcing” to “permissive” (you can check via sestatus) finally makes Bugzilla work as expected. Obviously looking at the SELinux context of a specific file via ls -Z and adjusting it via chcon is less pervasive, but I don’t care much about SELinux.
Bugzilla now works for me.
(General hint for people from the future who found this blogpost after searching for how to fix their Bugzilla problem: If you need Bugzilla support, send an email to Bugzilla support instead of using the comment function on somebody’s blog. Cheers.)