1080*80 ad

Installing Redmine on CentOS Stream 8 and 9

Install Redmine on CentOS Stream 9 & 8: A Comprehensive Guide

Deploying a powerful project management tool is a critical step for any team looking to streamline workflows, track issues, and manage complex projects efficiently. Redmine, a flexible and open-source web application built on the Ruby on Rails framework, is an excellent choice. It offers robust features like issue tracking, Gantt charts, wikis, and repository integration.

This guide provides a detailed, step-by-step walkthrough for installing Redmine on a CentOS Stream 8 or 9 server, complete with a secure Apache and MariaDB setup.

Prerequisites

Before we begin, ensure you have the following:

  • A server running a fresh installation of CentOS Stream 8 or 9.
  • Root or sudo-level access to the server.
  • A basic understanding of the Linux command line.

Step 1: Prepare Your System

First, we need to ensure our system is up-to-date and configured correctly.

  1. Update System Packages: Start by updating all existing packages to their latest versions. This is a crucial first step for security and stability.
    bash
    sudo dnf update -y
  2. Configure SELinux: For the initial installation, it’s easiest to set SELinux to permissive mode to avoid potential file permission conflicts. This allows the installation to proceed smoothly.
    bash
    sudo setenforce 0
    sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

    Note: While permissive mode is fine for installation, for a production environment, you should re-enable SELinux and configure the correct security contexts for Redmine.

Step 2: Install Core Dependencies

Redmine relies on a specific stack of software to run: a web server, a database, the Ruby programming language, and other essential tools. We will install all of these in one go.

  • Apache (httpd): Our web server to handle requests.
  • MariaDB: A popular and reliable database server.
  • Ruby and Development Tools: The programming language Redmine is built on.
  • Phusion Passenger: An application server that integrates Ruby on Rails applications with Apache.
  • ImageMagick: A library for handling image attachments.

Install all required packages using the following command:

sudo dnf install -y @ruby httpd httpd-devel mariadb-server mariadb-devel ImageMagick ImageMagick-devel rubygem-bundler policycoreutils-python-utils mod_passenger mod_passenger-devel

Once the installation is complete, enable and start the Apache and MariaDB services so they run automatically on boot.

sudo systemctl enable --now httpd
sudo systemctl enable --now mariadb

Step 3: Set Up the Redmine Database

With MariaDB running, we need to create a dedicated database and a user for Redmine.

  1. Log in to the MariaDB shell.
    bash
    sudo mysql -u root -p
  2. Create the database. It is essential to use a utf8mb4 character set for full international character support.
    sql
    CREATE DATABASE redmine CHARACTER SET utf8mb4;
  3. Create a dedicated database user and grant it permissions. Replace your_strong_password with a secure password of your own.
    sql
    CREATE USER 'redmine_user'@'localhost' IDENTIFIED BY 'your_strong_password';
    GRANT ALL PRIVILEGES ON redmine.* TO 'redmine_user'@'localhost';
  4. Flush privileges to apply the changes and then exit the shell.
    sql
    FLUSH PRIVILEGES;
    EXIT;

Step 4: Download and Install Redmine

Now we will download the latest stable version of Redmine and place it in the correct directory.

  1. Navigate to the /var/www/ directory, which is a standard location for web application files.
    bash
    cd /var/www/
  2. Visit the official Redmine download page to find the URL for the latest stable release. Use wget to download it.
    bash
    sudo wget https://www.redmine.org/releases/redmine-5.1.1.tar.gz
  3. Extract the archive and rename the resulting folder for simplicity.
    bash
    sudo tar -xvf redmine-5.1.1.tar.gz
    sudo mv redmine-5.1.1 redmine

Step 5: Configure Redmine

This step involves connecting Redmine to our database and installing its specific Ruby dependencies.

  1. Navigate into the Redmine configuration directory.
    bash
    cd /var/www/redmine/config
  2. Create the database configuration file by copying the provided template.
    bash
    sudo cp database.yml.example database.yml
  3. Now, edit database.yml using a text editor like nano.
    bash
    sudo nano database.yml
  4. Find the production: section and modify it with the database details you created in Step 3.
    yaml
    production:
    adapter: mysql2
    database: redmine
    host: localhost
    username: redmine_user
    password: "your_strong_password"
    encoding: utf8mb4
  5. Navigate back to the main Redmine directory and install the required Ruby gems using Bundler. We exclude development and test groups for a leaner production setup.
    bash
    cd /var/www/redmine
    sudo bundle install --without development test
  6. Generate a secret key for cookie session data.
    bash
    sudo bundle exec rake generate_secret_token
  7. Migrate the database. This command creates the necessary tables and structure for Redmine to function.
    bash
    RAILS_ENV=production sudo bundle exec rake db:migrate
  8. (Optional but Recommended) Load the default configuration data, which includes trackers, roles, and initial settings. You will be prompted to select a language.
    bash
    RAILS_ENV=production sudo bundle exec rake redmine:load_default_data

Step 6: Set File Permissions

The web server needs appropriate permissions to read and write to the Redmine directory.

Assign ownership of the Redmine files to the Apache user.

sudo chown -R apache:apache /var/www/redmine
sudo chmod -R 755 /var/www/redmine

Step 7: Configure Apache with Passenger

Finally, we need to tell Apache how to serve our Redmine application using Phusion Passenger.

  1. Create a new Apache configuration file for Redmine.
    bash
    sudo nano /etc/httpd/conf.d/redmine.conf

  2. Paste the following configuration into the file. This sets up a virtual host that directs traffic to your Redmine installation.

    <VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot /var/www/redmine/public
        ServerName your_server_ip_or_domain
    &lt;Directory /var/www/redmine/public&gt;
        AllowOverride all
        Options -MultiViews
        Require all granted
    &lt;/Directory&gt;
    
    ErrorLog /var/log/httpd/redmine_error.log
    CustomLog /var/log/httpd/redmine_access.log combined
    

    </VirtualHost>

    Remember to replace your_server_ip_or_domain with your server’s public IP address or fully qualified domain name.

  3. Restart the Apache web server to apply the new configuration.
    bash
    sudo systemctl restart httpd

Accessing Your Redmine Installation

You can now access your new Redmine instance by navigating to http://your_server_ip_or_domain in your web browser.

The default login credentials are:

  • Username: admin
  • Password: admin

Your first action should be to log in and change the default administrator password immediately.

Important Security Next Steps

Your Redmine installation is now running, but for a production environment, you should take these additional steps:

  • Configure a Firewall: Use firewalld to open ports 80 (HTTP) and 443 (HTTPS) and block all other unnecessary ports.
  • Install an SSL Certificate: Secure your site with a free Let’s Encrypt SSL certificate to enable HTTPS, protecting user data in transit.
  • Review Redmine Security Settings: Explore the Administration panel in Redmine to configure user roles, permissions, and authentication settings according to your organization’s security policies.

By following this guide, you have successfully deployed a powerful, self-hosted project management platform ready to help your team stay organized and productive.

Source: https://kifarunix.com/install-redmine-on-centos-stream-8-9/

900*80 ad

      1080*80 ad