Bugzilla working with nginx using FastCGI on Ubuntu
How to get Bugzilla working with nginx using FastCGI.
Tested on Ubuntu 10.04 server.
Nginx
- Install nginx, from repo or source, both should be OK.
Bugzilla
Don't install Bugzilla from the repo, download the source and extract into the directory you'll be serving it from:
$ cd /home/quzart/domains/bugzilla.quzart.com $ wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.6.3.tar.gz $ cd public_html $ tar --strip-components 1 -vxf ../bugzilla-3.6.3.tar.gz
Configuring
Follow the "Bugzilla Quick Start Guide" section from the README file till you hit the Configure Apache bullet. Instead follow these steps:
Download the fastcgi-wrapper Perl script to /usr/local/bin. I got this script from webopius and modified it to work with with the initscript.
# wget -O /usr/local/bin/fastcgi-wrapper \ http://ftp.quzart.com/notes/bugzilla-nginx-fcgi/fastcgi-wrapper.pl # chmod 0755 /usr/local/bin/fastcgi-wrapper
Download, install and start the initscript:
# wget -O /etc/init.d/fastcgi-wrapper \ http://ftp.quzart.com/notes/bugzilla-nginx-fcgi/fastcgi-wrapper-initscript # chmod 0755 /etc/init.d/fastcgi-wrapper # update-rc.d fastcgi-wrapper defaults # invoke-rc.d fastcgi-wrapper start
Configure nginx to serve Bugzilla. For example:
server { listen 80; server_name bugzilla.quzart.com; access_log /home/quzart/domains/bugzilla.quzart.com/logs/access.log; error_log /home/quzart/domains/bugzilla.quzart.com/logs/error.log; root /home/quzart/domains/bugzilla.quzart.com/public_html; index index.cgi index.txt index.html index.xhtml; location / { autoindex off; } location ~ ^.*\.cgi$ { fastcgi_pass unix:/var/run/fastcgi-wrapper/fastcgi-wrapper.sock; fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME /home/quzart/domains/bugzilla.quzart.com/public_html$fastcgi_script_name; include /etc/nginx/fastcgi_params; } }
Follow the rest from the README file.