How to install and configure Redmine on CentOS 8

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.

1. Prerequisites##

Make sure you meet the following conditions:

2. Create a MySQL database##

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;

Three, install Passenger, Apache and Ruby

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

Fourth, create a new system user##

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

Five, install 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

5.1 Download 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

5.2 Configure Redmine database###

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.

5.3 Install Ruby dependencies###

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

5.4 Generate a key and migrate the database###

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

Six, configure Apache

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

6.1 Configure Apache SSL

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.

Seven, visit Redmine

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

Eight, summary##

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

How to install and configure Redmine on CentOS 8
How to install and configure Elasticsearch on CentOS 7
How to install and configure VNC on CentOS 8
How to install and configure Redis on CentOS 8
How to install and configure phpMyAdmin on CentOS 6
How to install and configure Owncloud on CentOS 8
How to install and configure NFS server on CentOS 8
How to install and configure Postfix mail server on CentOS8
How to install and configure NATS on Ubuntu 16.04
How to install and configure Gogs on Ubuntu 18.04
How to install and use Docker on CentOS 7
How to install and configure Cyberpanel on Ubuntu 18.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure GitLab on Ubuntu 18.04
How to install and configure Ansible on Ubuntu 18.04
How to install and use Composer on CentOS 8
How to install and configure Elasticsearch on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install Node.js and npm on CentOS 8
How to install and configure VNC on Ubuntu 18.04
How to install and configure Sphinx on Ubuntu 16.04
How to install and configure OrientDB on Ubuntu 14.04
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install and use Curl on CentOS 8
How to install and configure AppScale on Ubuntu 12.04
How to install and uninstall tomcat on centos
How to install and configure PostGIS on Ubuntu 14.04
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Memcached on CentOS 8
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8