Sign inSign up

dshap/bugzilla

By dshap

Updated 11 days ago

Docker image for bugzilla web server

Image
Web servers
Content management system
0

1.0K

dshap/bugzilla repository overview

Bugzilla web server

Docker image for bugzilla web server.

Container runs as non-root user. This user owns bugzilla process and owns bugzilla files.

To run container next volumes should be mapped:

  • folder for SQL database
  • folder for bugzilla files
  • logs folder
  • backups folder

Installation

Installation from docker image
  1. Pull docker image
  2. Create user and group to own bugzilla files and to run docker container:
    sudo groupadd -g 1197 bugzilla
    
    useradd -u 1197 -g 1197 -M bugzilla
    
  3. Proceed to configuration
Installation from source
  1. Pull project sources from version control system
  2. Create user and group to own bugzilla files and to run docker container:
    sudo useradd -r bugzilla
    
    sudo groupmod -g 1197 bugzilla
    
    sudo usermod -u 1197 bugzilla
    
  3. Make build executable:
    sudo chmod u+x ./build
    
  4. Execute build:
    sudo ./build bugzilla
    
  5. Proceed to configuration
Configuration
  1. Obtain configuration files and scripts from the container:
    cd ~
    
    mkdir conf
    
    sudo chown bugzilla:bugzilla ~/conf
    
    sudo docker run \
        --rm \
        -v ~/conf:/export \
        dshap/bugzilla:5.2 export-assets
    
  2. Create folders for bugzilla files:
    sudo mkdir /bugzilla
    
    sudo mkdir /bugzilla/db
    
    sudo mkdir /bugzilla/data
    
    sudo chown -R bugzilla:bugzilla /bugzilla
    
  3. Create a folder for logs:
    sudo mkdir /var/log/bugzilla
    
    sudo chown -R bugzilla:bugzilla /var/log/bugzilla
    
  4. Create a folder for backups:
    sudo mkdir /var/backups/bugzilla
    
    sudo chown -R bugzilla:bugzilla /var/backups/bugzilla
    
  5. Copy service configuration file:
    sudo cp ~/conf/etc/init.d/bugzilla /etc/init.d
    
    sudo chmod a+x /etc/init.d/bugzilla
    
  6. Copy docker run script:
    sudo cp ~/conf/usr/sbin/bugzilla /usr/sbin
    
    sudo chmod a+x /usr/sbin/bugzilla
    
  7. Copy util script:
    sudo cp ~/conf/usr/bin/bgutil /usr/bin
    
    sudo chmod a+x /usr/bin/bgutil
    
  8. Remove temporary config folder:
    sudo rm -rf ~/conf
    
  9. Register service:
    sudo update-rc.d bugzilla defaults
    
  10. Specify database root password in /usr/sbin/bugzilla file:
    docker run ... -e DB_ROOT_PASSWORD="<some_password>" ...
    
  11. Specify bugzilla database user password in /usr/sbin/bugzilla file:
    docker run ... -e DB_USER_PASSWORD="<some_password>" ...
    
  12. Start bugzilla service:
    sudo service bugzilla start
    
  13. Initialize bugzilla database:
    sudo bgutil initialize
    
    Specify the following information:
    • administrator e-mail
    • administrator name
    • administrator password
    • administrator password confirmation
  14. Restart bugzilla service:
    sudo service bugzilla restart
    

Management

Service management
sudo service bugzilla (start|stop|status|restart)
Create backup
sudo bgutil backup <filename>

Backup file /var/backups/bugzilla/<filename>.tar.gz will be created.

Restore backup
sudo bgutil restore <filename>
Command line (bash)
sudo bgutil bash

Apache mod_proxy configuration

Bugzilla web server can be located with another web applications. For example, mercurial, bugzilla, wiki etc can be run as docker containers on the same host. In this case apache server can be used to redirect requests to different docker containers.

  1. Enable apache mod_proxy:
    sudo a2enmod deflate headers proxy proxy_ajp proxy_balancer proxy_connect proxy_html proxy_http rewrite
    
  2. Configure proxy:
    <VirtualHost *:80>
        ...
        ProxyPreserveHost On
        <Proxy *>
            Order allow,deny
            Allow from all
        </Proxy>
        ...
    </VirtualHost>
    
  3. Copy site configuration file:
    sudo cp ~/conf/etc/apache2/sites-available/bugzilla.conf /etc/apache2/sites-available
    
  4. Enable apache sites:
    sudo a2ensite bugzilla
    
  5. Restart apache service:
    sudo service apache2 restart
    

HOW TO

How to change database root password
  1. Stop bugzilla service:
    sudo service bugzilla stop
    
  2. Specify new database root password in /usr/sbin/bugzilla file:
    docker run ... -e DB_ROOT_PASSWORD="<new_password>" ...
    
  3. Start bugzilla service:
    sudo service bugzilla start
    
  4. Run the following command:
    sudo bgutil change-root-password "<old_password>"
    
How to change database user password
  1. Stop bugzilla service:
    sudo service bugzilla stop
    
  2. Specify new bugzilla database user password in /usr/sbin/bugzilla file:
    docker run ... -e DB_USER_PASSWORD="<new_password>" ...
    
  3. Start bugzilla service:
    sudo service bugzilla start
    
  4. Run the following command
    sudo bgutil change-user-password
    
How to specify special characters in password

Special characters should be escaped:

docker run ... -e DB_ROOT_PASSWORD="pa\$\$word" ...
docker run ... -e DB_USER_PASSWORD="pas\$11" ...
How to perform maintenance operations
  1. Connect to container:
    sudo bgutil bash
    
  2. Go to bugzilla root folder:
    cd /var/www/html/bugzilla
    
  3. Perform Perl scripts, for example:
    /usr/bin/perl checksetup.pl
    
How to stop MariaDB correctly (in case of upgrades from an old version)
  1. In one terminal run MariaDB:
    sudo docker run --rm \
        --name mariadb104 \
        -v /bugzilla/db:/bugzilla/db \
        mariadb:10.4 mysqld --user=root --datadir=/bugzilla/db
    
  2. Wait until log appears that MariaDB is ready to accept connections
  3. In another terminal stop MariaDB:
    sudo docker stop mariadb104
    
How to create cron job for backups
sudo crontab -l | { cat; echo "minute hour * * * /usr/bin/bgutil backup <filename>"; echo ""; } | sudo crontab -

Tag summary

Content type

Image

Digest

Size

433.5 MB

Last updated

about 5 years ago

docker pull dshap/bugzilla