Introduction

Redmine is a flexible project management web application written using the Ruby on Rails framework. This tutorial will guide you through the process of installing Redmine with Apache and Let's Encrypt SSL on Debian 12.

Prerequisites

Before you begin, ensure you have:

  1. A Debian 12 server
  2. SSH access to the server (optional)
  3. Root or sudo privileges

Step 1: Install Dependencies

Update the package index and install required dependencies:

sudo apt update
sudo apt install -y apache2 mariadb-server libapache2-mod-passenger ruby-full libmagickwand-dev imagemagick libmysqlclient-dev git

Step 2: Install Ruby and Bundler

Install Ruby and Bundler:

sudo apt install -y ruby-dev
sudo gem install bundler

Step 3: Install Redmine

Clone the Redmine repository from GitHub:

sudo git clone https://github.com/redmine/redmine.git /var/www/redmine

Switch to the Redmine directory:

cd /var/www/redmine

Checkout the desired Redmine version (e.g., 4.2.1):

sudo git checkout 4.2.1

Install required gems and dependencies:

sudo bundle install --without development test

Copy the database configuration file and configure the database:

sudo cp config/database.yml.example config/database.yml
sudo nano config/database.yml

Update the database configuration with your MariaDB/MySQL credentials.

Create the database structure and default data:

sudo RAILS_ENV=production bundle exec rake db:migrate
sudo RAILS_ENV=production bundle exec rake redmine:load_default_data

Step 4: Configure Apache

Create a new Apache configuration file for Redmine:

sudo nano /etc/apache2/sites-available/redmine.conf

Add the following configuration:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/redmine/public
    ServerName your_domain.com
    ServerAlias www.your_domain.com

    <Directory /var/www/redmine/public>
        AllowOverride all
        Options -MultiViews
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Enable the Redmine site and Apache rewrite module:

sudo a2ensite redmine.conf
sudo a2enmod rewrite

Restart Apache for the changes to take effect:

sudo systemctl restart apache2

Step 5: Install Let's Encrypt SSL

Install Certbot, the Let's Encrypt client:

sudo apt install -y certbot python3-certbot-apache

Obtain an SSL certificate for your domain:

sudo certbot --apache -d your_domain.com -d www.your_domain.com

Follow the prompts to generate the SSL certificate and enable HTTPS for your Redmine site.

Step 6: Complete the Installation

Open a web browser and navigate to your Redmine installation URL (e.g., http://your_domain.com). Follow the on-screen instructions to complete the installation.

Log in using the default credentials (admin/admin) and change the password.

Conclusion

Congratulations! You have successfully installed Redmine with Apache and Let's Encrypt SSL on Debian 12.

Was this answer helpful? 0 Users Found This Useful (0 Votes)