Installing Redmine on Debian 7.5

Redmine is a flexible project management web application with issue and time tracking ability. The development server caters for the hosting of the project management system and also allows for access to it over the HTTPS protocol.

Installing Redmine

To install Redmine, we execute the following command in a “root” shell.

apt-get install redmine redmine-mysql

When we are prompted to configure the Redmine database making use of dbconfig-common, we select yes.

Setting up the Redmine database

When prompted to select the database type to be used, select the mysql option. Next, enter the password for the “root” database user of the MySQL database server. Finally, enter a password for the “redmine_default” database user.

Installing Redmine dependencies

To manage the gems dependencies, Redmine uses Bundler, which is installed by executing the following command in a “root” shell.

gem install bundler

Once the installation of Bundler is complete, we can install all the gems required by executing the following command in a “root” shell.

bundle install --without development test

If you receive an error message stating Could not locate Gemfile, ensure that you are in the directory where Redmine is installed; the default for the debian package of Redmine is /usr/share/redmine

Installing the Apache Module

Redmine uses the Passenger Apache Module, which is installed by executing the following command in a “root” shell.

apt-get install libapache2-mod-passenger

Setting up the Redmine virtual host

To use the Redmine application in our virtual host, some permissions and ownership needs to be set on the web application by executing the following command in a “root” shell.

chown -R www-data:www-data /usr/share/redmine/public/

Virtual Host settings

The virtual host will use the IP address 192.168.100.16, using the certificate in /etc/ssl/CA/certs/sitename.cert and the private key in /etc/ssl/CA/private/sitename.key.nopass. Authentication and authorization is handled inside of the Redmine application.

Virtual Host Configuration

<VirtualHost 192.168.100.16:80>
    RewriteEngine on
    ReWriteCond %{SERVER_PORT} !^443$
    RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>

<VirtualHost 192.168.100.16:443>
    ServerName sitename
    ServerAdmin webmaster@domain

    SSLEngine On
    SSLCertificateFile /etc/ssl/CA/certs/sitename.cert
    SSLCertificateKeyFile /etc/ssl/CA/private/sitename.key.nopass

    BrowserMatch "MSIE [2-6]" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

    ErrorDocument 404 /404.html
    ErrorDocument 500 /500.html

    DocumentRoot /usr/share/redmine/public
    <Directory /usr/share/redmine/public>
        RailsBaseURI /
        PassengerResolveSymlinksInDocumentRoot on
        AllowOverride None
    </Directory>

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

Enabling the Virtual Host

To enable the virtual host, we execute the following command in a “root” shell.

a2ensite sitename

To reload the configuration, we execute the following command in a “root” shell.

service apache2 reload