Bugzilla install

From wikinotes

FreeBSD

Install Requirements

Install OS Packages

sudo pkg install mysql56-server \
                 bugzilla50 \
                 nginx \
                 perl5 \
                 fcgiwrap postfix

Install Perl Packages

sudo -i
cd /usr/local/www/bugzilla

perl   installmodule.pl   MIME::Parser
perl   installmodule.pl   LWP::UserAgent
perl   installmodule.pl   XML::Twig
perl   installmodule.pl   Net::LDAP
perl   installmodule.pl   Authen::Radius
perl   installmodule.pl   SOAP::Lite
perl   installmodule.pl   XMLRPC::Lite
perl   installmodule.pl   JSON::RPC
perl   installmodule.pl   Test::Taint
perl   installmodule.pl   Email::Reply
perl   installmodule.pl   HTML::FormatText::WithLinks
perl   installmodule.pl   TheSchwartz
perl   installmodule.pl   Daemon::Generic
perl   installmodule.pl   Apache2::SizeLimit
perl   installmodule.pl   File::MimeInfo::Magic
perl   installmodule.pl   IO::Scalar
perl   installmodule.pl   Cache::Memcached
perl   installmodule.pl   File::Copy::Recursive
perl   installmodule.pl   File::Which
perl   installmodule.pl   DBD::mysql

Create OS Users

adduser www     # for nginx
adduser backup  # to backup fs, and database

Configure MySQL

# Create the bugs database
CREATE DATABASE bugs;

# Create user backup for automated mysqldumps
GRANT   SELECT, LOCK TABLES, SHOW VIEW
ON      *.*
TO      'bugs'@'%'
IDENTIFIED BY <password>;

# Create user bugs, used by bugzilla
# to update the tables
GRANT   SELECT,
        INSERT,
        UPDATE,
		  DELETE,
		  INDEX,
		  ALTER,
		  CREATE,
		  LOCK TABLES,
        CREATE TEMPORARY TABLES,
		  DROP,
		  REFERENCES

ON      bugs.*
TO      bugs@localhost IDENTIFIED BY <password>;

# Flush privileges so that new settings take effect
FLUSH PRIVILEGES;

Configure Nginx

# /usr/local/etc/nginx/nginx.conf

user www www;
worker_processes 1;

events {
   worker_connections 1024;
}

http {
   include       /usr/local/etc/nginx/mime.types;
   default_type  application/octet-stream;

   server {
      listen         80;
      server_name    localhost;

      charset utf-8;
      root       /usr/local/www/bugzilla;
      index      index.cgi;


      location ~ ^.*\.cgi$ {
         fastcgi_pass    unix:/var/run/fcgiwrap/fcgiwrap.sock;
         fastcgi_index index.cgi;
         fastcgi_param SCRIPT_FILENAME /usr/local/www/bugzilla/$fastcgi_script_name;
         include fastcgi_params;

         ## Prevent 502 Bad Gateway
         #fastcgi_connect_timeout 60;
         #fastcgi_send_timeout 180;
         #fastcgi_read_timeout 180;
         #fastcgi_buffer_size 128k;
         #fastcgi_buffers 4 256k;
         #fastcgi_busy_buffers_size 256k;
      }
   }
}

Configure Postfix

# /usr/local/etc/postfix/main.cf

recipient_delimiter = +;

Confirm it is working (check in spam)

service postfix start
echo "Email Body" | mail -s "Test Subject" user@domain.com

Run Bugzilla Installer

sudo -i
cd    /usr/local/www/bugzilla
perl  checksetup.pl

Enable Services

# /etc/rc.conf

sshd_enable="YES"
mysql_enable="YES"
nginx_enable="YES"
postfix_enable="YES"
fastcgi_enable="YES"
fastcgi_user="www"