Redmine is an open source project management and issue tracking application. It is a cross-platform and cross-database application built on the Ruby on Rails framework.
Redmine includes multi-project support, wiki, issue tracking system, forum, calendar, email reminder, etc.
This guide explains how to install and configure the latest version of Redmine on CentOS 8. We will use MariaDB as the database and Passenger + Apache as the Ruby application server.
Make sure you meet the following conditions:
Redmine supports MySQL/MariaDB, Microsoft SQL Server, SQLite 3, and PostgreSQL. We will choose MariaDB as the database backend.
If you have not installed MariaDB or MySQL on your CentOS system, you can install it by following the instructions below. https://linuxize.com/post/how-to-install-mariadb-on-centos-8/
Use the following command to log in to the MySQL shell:
sudo mysql
In the MySQL shell, run the following SQL expression to create a database, create a new user, and authorize the user:
CREATE DATABASE redmine CHARACTER SET utf8;
GRANT ALL ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'change-with-strong-password';
Make sure you change-with-strong-Replace password with a strong password.
Once complete, exit the MySQL shell:
EXIT;
Passenger is a very fast, lightweight web application server, suitable for Ruby, Node.js, and Python, and it can also integrate with Apache and Nginx.
We will install Passenger as an Apache module.
Enable EPEL repository:
sudo dnf install epel-release
sudo dnf config-manager --enable epel
Once the source is enabled, update the package list, and install Ruby, Apache and Passenger:
sudo dnf install httpd mod_passenger passenger passenger-devel ruby
Start the Apache service and enable startup:
sudo systemctl enable httpd --now
Create a new user and user group, the home directory is /opt/redmine
, used to run the Redmine instance:
sudo useradd -m -U -r -d /opt/redmine redmine
Add the apache
user to the redmine user group, and modify the permissions of the /opt/redmine
directory so that Apache can access it:
sudo usermod -a -G redmine apache
sudo chmod 750/opt/redmine
At the time of writing, the latest stable version of Redmine is 4.1.0
Before proceeding to the next step, browse the Redmine download page to see if a newer version is available.
Install the GCC compiler and libraries needed to build Redmine:
sudo dnf group install "Development Tools"
sudo dnf install zlib-devel curl-devel openssl-devel mariadb-devel ruby-devel
Make sure you run the following steps as the redmine
user:
sudo su - redmine
Use curl
to download the Redmine compressed package:
curl -L http://www.redmine.org/releases/redmine-4.1.0.tar.gz -o redmine.tar.gz
Once the download is complete, unzip the compressed package:
tar -xvf redmine.tar.gz
Copy the Redmine sample database configuration file:
cp /opt/redmine/redmine-4.1.0/config/database.yml.example /opt/redmine/redmine-4.1.0/config/database.yml
Open the file with a text editor:
nano /opt/redmine/redmine-4.1.0/config/database.yml
Search for the production
chapter, and enter the MySQL database and user information we created earlier:
/opt/redmine/redmine-4.1.0/config/database.yml
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password:"change-with-strong-password"
encoding: utf8mb4
Once completed, save your file and exit the editor.
Change to the redmine-4.1.0
directory and install Ruby dependencies:
cd ~/redmine-4.1.0
gem install bundler --no-rdoc --no-ri
bundle install --without development test postgresql sqlite --path vendor/bundle
Run the following command to generate the key and migrate the database:
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
Switch back to your sudo user and create the Apache Vhost file:
exit
sudo nano /etc/httpd/conf.d/example.com.conf
/etc/httpd/conf.d/example.com.conf
< VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /opt/redmine/redmine-4.1.0/public<Directory /opt/redmine/redmine-4.1.0/public>
Options Indexes ExecCGI FollowSymLinks
Require all granted
AllowOverride all
< /Directory>
ErrorLog /var/log/httpd/example.com-error.log
CustomLog /var/log/httpd/example.com-access.log combined
< /VirtualHost>
Don’t forget to add example.Replace com with your Redmine domain name.
Restart the Apache service and enter:
sudo systemctl restart httpd
If you do not have a trusted SSL certificate, you can follow these instructions to generate a free Let's Encrypt certificate. https://linuxize.com/post/secure-apache-with-let-s-encrypt-on-centos-8/
Once the certificate is generated, edit the Apache configuration file similar to the following:
sudo nano /etc/httpd/conf.d/example.com.conf
/etc/httpd/conf.d/example.com.conf
< VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
Redirect permanent / https://example.com/</VirtualHost><VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
Protocols h2 http:/1.1<If "%{HTTP_HOST} == 'www.example.com'">
Redirect permanent / https://example.com/</If>
DocumentRoot /opt/redmine/redmine-4.1.0/public
ErrorLog /var/log/httpd/example.com-error.log
CustomLog /var/log/httpd/example.com-access.log combined
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
< Directory /opt/redmine/redmine-4.1.0/public>
Options Indexes ExecCGI FollowSymLinks
Require all granted
AllowOverride all
< /Directory></VirtualHost>
Don’t forget to add example.Replace com with your Redmine domain name, and set the correct SSL certificate file path. All HTTP requests are forwarded to HTTPS.
Open your browser, enter your domain name, and if the installation process is successful, an interface similar to the following will appear:
The default login credentials are as follows:
When you log in for the first time, you will be prompted to change your password, similar to the following:
Once you have changed your password, you will be redirected to the user page.
If you cannot access the page, it is likely that your firewall is blocking the Apache port.
Use the following command to open the necessary ports:
sudo firewall-cmd --permanent --zone=public--add-port=443/tcp
sudo firewall-cmd --permanent --zone=public--add-port=80/tcp
sudo firewall-cmd --reload
You have successfully installed Redmine on your CentOS system. You should now check Redmine documentation and learn how to configure and use Redmine.
Recommended Posts