Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Install Mantis Bug Tracker on Ubuntu with Apache

How to Install Mantis Bug Tracker on Ubuntu with Apache

If you’re seeking a robust, open-source bug tracking system, installing MantisBT on your Ubuntu server with Apache is an excellent choice. It helps teams manage issues efficiently, track project progress, and improve software quality. Before starting, ensure your Ubuntu server is up-to-date, and you have administrative access (sudo privileges). This guide provides a clear, step-by-step process to install and configure MantisBT with Apache, MySQL, and PHP, ensuring a smooth setup for your development environment.

What You’ll Need

  • Ubuntu server (version 20.04 LTS or later recommended)
  • Root or sudo user access
  • Apache web server installed and running
  • MySQL or MariaDB database server installed and configured
  • PHP installed with required extensions (see step 3)
  • Basic knowledge of terminal commands and server management

Step-by-Step

  1. Update your system packages: Open a terminal and run:
    sudo apt update && sudo apt upgrade -y

    This ensures your system has the latest security patches and software updates.

  2. Install Apache, MySQL, and PHP: Execute:
    sudo apt install apache2 mysql-server php php-mysql php-xml php-mbstring php-gd php-curl php-zip libapache2-mod-php -y

    Ensure all necessary PHP modules for MantisBT are installed. Restart Apache afterward:

    sudo systemctl restart apache2
  3. Create a database for MantisBT: Log into MySQL:
    sudo mysql
    

    Then run:

    CREATE DATABASE mantisdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    CREATE USER 'mantisuser'@'localhost' IDENTIFIED BY 'your_secure_password';
    GRANT ALL PRIVILEGES ON mantisdb.* TO 'mantisuser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

    Replace ‘your_secure_password’ with a strong password.

  4. Download the latest MantisBT package: Navigate to a directory of your choice and run:
    wget https://sourceforge.net/projects/mantisbt/files/latest/download -O mantisbt.zip

    Extract the archive:

    unzip mantisbt.zip -d /var/www/html/mantis
  5. Set permissions for the MantisBT directory: Run:
    sudo chown -R www-data:www-data /var/www/html/mantis
    sudo chmod -R 755 /var/www/html/mantis
  6. Create an Apache site configuration for MantisBT: Create a new config file:
    sudo nano /etc/apache2/sites-available/mantis.conf

    Add the following configuration:

    <VirtualHost *:80>
        ServerAdmin admin@yourdomain.com
        ServerName yourdomain.com
        DocumentRoot /var/www/html/mantis
    
        ErrorLog ${APACHE_LOG_DIR}/mantis_error.log
        CustomLog ${APACHE_LOG_DIR}/mantis_access.log combined
    
        <Directory /var/www/html/mantis>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    </VirtualHost>

    Replace ‘yourdomain.com’ with your actual domain or server IP.

  7. Enable the site and rewrite module: Run:
    sudo a2ensite mantis.conf
    sudo a2enmod rewrite
    sudo systemctl restart apache2
  8. Complete the installation via web interface: Open your browser and navigate to:
    http://your_server_ip/mantis

    Follow the on-screen instructions to connect to the database (use the database name, user, and password created earlier). Set up the admin account, language, and other preferences. Once completed, delete the install directory for security:

    sudo rm -rf /var/www/html/mantis/admin

Common Mistakes

  • Forgetting to set correct permissions on the MantisBT directory, leading to permission errors.
  • Not enabling the Apache rewrite module, which causes URL rewriting issues.
  • Using incorrect database credentials during setup, resulting in connection failures.
  • Failing to delete the install directory after setup, which can pose security risks.
  • Not installing all required PHP modules, which can cause errors during installation or operation.

Tips

  • Use strong, unique passwords for your database and admin accounts to enhance security.
  • Configure a firewall to restrict access to your server and database ports.
  • Regularly update your server packages and MantisBT for security patches.
  • Backup your database regularly to prevent data loss.
  • Customize your MantisBT theme and email notifications for better usability.

Troubleshooting

  • Installation page not loading or errors during setup: Check Apache error logs with sudo tail -f /var/log/apache2/error.log. Ensure mod_rewrite is enabled and permissions are correct.
  • Database connection errors: Verify database credentials and ensure the database server is running. Test connectivity using the MySQL client.
  • PHP errors or blank pages: Confirm all required PHP modules are installed. Review PHP error logs and enable error reporting if needed.
  • Cannot access MantisBT after installation: Make sure the install directory is deleted and permissions are set correctly.
  • SSL/TLS issues for secure access: Consider configuring HTTPS with a free SSL certificate from Let’s Encrypt to secure your MantisBT interface.

Frequently Asked Questions

1. Can I install MantisBT on Ubuntu without Apache?

Yes, you can use other web servers like Nginx, but Apache is the most straightforward for beginners and well-supported.

2. Is MantisBT secure to use on a public server?

When properly configured with HTTPS, secure passwords, and regular updates, MantisBT is secure for public use. Always follow best practices for server security.

3. How do I upgrade MantisBT to a newer version?

Download the latest package, back up your database and current files, replace the files with the new version, and run the upgrade script through the web interface.

4. Can I customize the appearance of MantisBT?

Yes, MantisBT supports themes and allows customization of the CSS files, enabling you to tailor its look to your preferences.

5. How do I secure my MantisBT installation?

Use HTTPS, strong passwords, restrict access with firewalls, keep software updated, and delete the install directory after setup.

6. What are the system requirements for MantisBT?

At minimum, a LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) with PHP 7.2 or higher and sufficient server resources based on your expected load.

Following these detailed steps and tips will help you successfully deploy Mantis Bug Tracker on your Ubuntu server with Apache, providing a powerful platform for issue tracking and project management.

Related

How to Install Mantis Bug Tracker on Ubuntu with Apache
Scroll to top