Debian/Ubuntu sets up nginx + Bugzilla

Source: Internet
Author: User
Question note

Recently, a simple and fast bug tracking tool was required. Considering the system environment and the learning cost, we decided to adopt Bugzilla. I don't know if I don't try it. It turns out there are so many pitfalls that need to be flattened one by one ~, You can use it as needed.

The system I use is composed of Debian + MySQL + nginx + Bugzilla. If you use centos, you may need to note that the nginx installation method is different from the configuration file location, which requires flexible flexibility; for those who use Apache, refer to other articles to configure forwarding.

1. Install nginx, Perl-FPM, and MySQL

Unlike the CGI method used by Apache, nginx uses fcgi to schedule programming languages such as PHP and Perl. Therefore, we need to install and configure the Perl FPM.

Install
aptitude install nginx libfcgi-perl mysql-server

I originally wanted to install fcgi (https://metacpan.org/pod/FCGI) by downloading the compilation method. unexpectedly, I found that there was a release version! As a result, a better solution is adopted in an instant. Those who cannot find this package in the release version can download and install it on their own (nginx is also a truth)

After installation, I found that this lib did not start or stop the script, so I found two scripts on the Internet to install them:

wget http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper -O /usr/bin/fastcgi-wrapper.plwget http://nginxlibrary.com/downloads/perl-fcgi/perl-fcgi -O /etc/init.d/perl-fcgichmod +x /usr/bin/fastcgi-wrapper.plchmod +x /etc/init.d/perl-fcgiupdate-rc.d perl-fcgi defaultsinsserv perl-fcgi

After executing the above script, we installed a service Perl-fcgi in/etc/init. d/, which will run automatically after startup/usr/bin/fastcgi-wrapper.pl

Configuration

The fastcgi-wrapper.pl calls libfcgi-perl and listens to the socket port through which nginx communicates. The default address is 127.0.0.1: 9000. To improve performance, I changed it to the named pipeline method:

vim /usr/bin/fastcgi-wrapper.pl

Find the original start listening statement and change it:

$socket = FCGI::OpenSocket( "/tmp/perl-fcgi.sock", 10 );

After saving, start Perl-fcgi

service perl-fcgi start

If the startup fails, the message 'account not available' is displayed. It may be that the WWW-data user is forbidden to log on. Run the following command:

usermod -s /bin/sh www-data

Go to the nginx configuration directory and create the configuration file:

cd /etc/nginx/sites-availablevim bugzilla

The configuration file is as follows (replace the domain name and port with your access address ):

server {        listen          8008; # listening port        server_name     bugzilla.example.com; # server name        root            /var/www/bugzilla; # installation path
location /skin/ {}
location /js/ {}
location / { include fastcgi_params; fastcgi_pass unix:/tmp/perl-fcgi.sock; fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }}

Next, link the configuration file to the sites-enabled directory and start the application (if nginx has been started before, call reload to reload the configuration file ):

cd ../sites-enabled/ln -s ../sites-available/bugzilla .
service nginx start

The installation and configuration of MySQL are quite a lot online, so I will not go into details here.

Ii. Install Bugzilla

After completing the basic environment, we will start to officially install Bugzilla.

Install

Download from bugzilla.org and decompress it to/var/WWW

mkdir -p /var/wwwcd /var/wwwchown -R www-data .wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.4.5.tar.gztar zxf bugzilla-4.4.5.tar.gzmv bugzilla-4.4.5 bugzillacd bugzilla
Configuration

Configure Bugzilla. Bugzilla may not be installed on the local machine depending on some Perl components, but I have never been able to install it successfully when using its own installation script. After searching online, I found a solution to install it using cpanm.

Download and install cpanm:

sudo curl -L http://cpanmin.us | perl - --sudo App::cpanminus

Next we will execute checksetup. pl for configuration. During the configuration process, checksetup. pl needs to perform several times to complete the Environment check. After the first execution, you may be prompted that a module is not installed. Follow the list of uninstalled modules and run the cpanm command to install it.

perl checksetup.plcpanm YAMLcpanm DateTime...

After the installation is complete, run checksetup. pl again. At this time, all the dependent modules should pass the check. If a module has been installed but cannot be checked, try to force a reinstall, for example:

cpanm DateTime -f

After the module passes the check, checksetup. pl will prompt that the MySQL connection fails. Now we will go to MySQL to configure users and databases:

CREATE database bugs default charset utf8 collate utf8_bin;CREATE user [email protected] identified by ‘bugs‘;grant all on bugs.* to [email protected];flush privileges;

Modify Database Configuration:

vim localconfig

Find and modify the following items:

$webservergroup = ‘www-data‘;$db_pass = ‘bugs‘;

Note: If you use a remote database, configure your username and password.

So far, we have completed all the configurations. Run the checkconfig. pl Command again, and the system prompts you to enter the Administrator email address and password, and save the configuration to the database.

Try to open the access address you configured (for example: http://bugzilla.example.com: 8008/), if it can be opened and the typographical display is correct, it indicates it is accessible.

Debian/Ubuntu sets up nginx + Bugzilla

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.