Steps to enable Rdmine web:
1. Add this new site for http /etc/apache2/sites-avaliable/redmine.conf:
<VirtualHost *:80>
ServerAdmin oscargomezf@gmail.com
ServerName redmine.server.net
ServerAlias www.redmine.server.net
RailsEnv production
DocumentRoot /opt/redmine/public
<Directory "/opt/redmine/public">
Allow from all
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/redmine_error.log
CustomLog ${APACHE_LOG_DIR}/redmine_access.log combined
</VirtualHost>
2.1. Add this new site for https /etc/apache2/sites-avaliable/redmine-ssl.conf:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin oscargomezf@gmail.com
ServerName redmine.server.net
ServerAlias www.redmine.server.net
DocumentRoot /opt/redmine/public
ErrorLog ${APACHE_LOG_DIR}/error_redmine_ssl.log
CustomLog ${APACHE_LOG_DIR}/access_redmine_ssl.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
</VirtualHost>
</IfModule>
2.2. Add this new site for https /etc/apache2/sites-avaliable/redmine-ssl.conf, if you want redirect http to https automatically:
<IfModule mod_ssl.c>
<VirtualHost *:80>
ServerName redmine.server.net
ServerAlias www.redmine.server.net
Redirect permanent / https://redmine.server.net/
</VirtualHost>
<VirtualHost *:443>
ServerAdmin oscargomezf@gmail.com
ServerName redmine.server.net
ServerAlias www.redmine.server.net
DocumentRoot /opt/redmine/public
ErrorLog ${APACHE_LOG_DIR}/error_redmine_ssl.log
CustomLog ${APACHE_LOG_DIR}/access_redmine_ssl.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
</VirtualHost>
</IfModule>
3. Enable these sites:
$ a2ensite redmine
$ a2ensite redmine-ssl
4. Add these lines to the file /etc/apache2/apache2.conf:
...
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /opt/redmine/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
...
4. Restart apache2:
$ systemctl restart apache2