[EN] Installing Redmine 3.0 on clean Ubuntu 14.04

In this tutorial we will install Redmine on a clean installation of Ubuntu server 14.04 with an Apache server and MySql. Redmine wil be reachable under the subdomain redmine.example.com.

Here Redmine will be installed to  /var/www/vhosts/redmine . I use unzip  to unpack the archive. The placeholder for the username you’re logged into the system is  $sysUser$ .

Step 1 – Installing required software

First we need to update our packages. If you encounter any problems later on try to fix them by updating your packages again.

Now install apache2 and mysql:

While installing mysql-server you will be asked for a MySql root password to set.

Step 2 – Database creation

To create the database log in as root user with the password you set earlier.

The following MySql queries create the database and the user to access this database. Be sure you have my_password replaced with an other password (not the root password) before executing.

To exit  mysql simply type  exit and execute.

Step 3 – Downloading Redmine

Now switch in your vhosts directory download Redmine and unzip it. If you want you can use the .tar.gz file with the tar command as well.

Step 4 – Database configuration

We need to alter the file /var/www/vhosts/redmine/config/database.yml.example  and save it as  database.yml . Replace my_password with the password set in the MySql query before.

If your MySql server is running on another Port (eg. 3344) you can use the following config:

Step 5 – Installing ruby

First we have to remove the old version of ruby.

Execute the following command (not as root user) with the ‚\‘ at the beginning. It will install ruby at your system, usable for every user in the group rvm. The installation folder is  /usr/local/rvm .

In my case the first run failed because of a missing signature. The command to install this signature will be displayed in the error-message. In my case it was this:

Then rerun the command to install ruby.

After some time ruby is installed with rails. Now the users $sysUser$ and www-data  need to be added to the group  rvm .

After a relogin the change should be applyed. You have to switch folders back t your Redmine folder.

If you encounter any problems with mysql during installation execute  sudo apt-get install libmysqlclient-dev.  Then execute the command again.

Step 6 – Configuring Redmine with ruby

Generate an secret cookie token:

Create the database structure:

Insert the default configuration:

Start the webrick server to test if everything is ok. You can access the webrick server from localhost only, so its ok if it throws no errors while starting. Then shutdown the webrick server.

 Step 7 – Installing passenger

Because the repository version of passenger will install the old ruby from the repository again, we have to install it via gem.

Now we have to install some other packages, required for passenger integration in apache2:

Then execute the following commands to install the passenger module to apache2.

 

Alter the file /etc/apache2/mods-avaiable/passenger.load  to this:

And the file /etc/apache2/mods-available/passenger.conf  to this:

Now enable the passenger mod:

Step 8 – Configuring Apache

To reach redmine under redmine.example.com we have to create a new file in /etc/apache2/sites-avaiable . I called the file redmine.example.com.conf .

To activate the site execute  a2ensite redmine.example.com.conf and rename the file /var/www/vhosts/redmine/public/dispatch.fcgi.example  to dispatch.fcgi . Now restart apache2  via  sudo service apache2 restart .

Everything should be up an running. If you have any suggestions to improve the installation process comment below.

 

Sources:

 

Niclas Roßberger

Niclas Roßberger

Hi, I'm Niclas.

12 Gedanken zu „[EN] Installing Redmine 3.0 on clean Ubuntu 14.04

  • 23. April 2015 um 13:35
    Permalink

    This is a very thorough tutorial. The instructions given are very precise.

    Thank you very much!

    Antwort
  • 29. Juli 2015 um 1:57
    Permalink

    I mess with Plesk 12.

    Many thanks.

    Antwort
  • 15. Oktober 2015 um 13:38
    Permalink

    Great tutorial – thanks a lot!

    Antwort
  • 8. November 2015 um 0:24
    Permalink

    I use docker ubuntu 14.04 images and install redmine step by step from blog.
    When I execute
    $ rake generate_secret_token

    I got error message:
    /var/lib/gems/2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: „inodot“

    Do you know how to solve it?

    Antwort
    • Niclas
      8. November 2015 um 10:23
      Permalink

      Hi Yaru,
      I’m sorry, but this file does not exist on my server, so I cannot look what’s probably wrong.
      Your „error“ is a warning, so it should be fine. It just says that there could be a problem. You can read the code of the file and try to analyse what’s causing the warning.

      With google I found out that it could be caused by an incompatible version of gem (http://stackoverflow.com/questions/27669855/warnings-after-upgrading-to-ruby-2-2-0).

      I hope this is helping you.
      Niclas

      Antwort
    • 12. November 2015 um 11:13
      Permalink

      To fix this run the following
      gem uninstall htmlentities -v ‚4.3.1‘
      Then modify the Gemfile.lock from
      htmlentities (4.3.1) to htmlentities (4.3.4)
      Run again
      bundle install –without development test rmagick
      This might fix the problem

      Antwort
  • 16. März 2016 um 13:59
    Permalink

    Thanks for such a detailed article. It worked like a charm on Ubuntu 15 as well. Just a typo
    There is a spelling mistake in the path:
    Alter the file /etc/apache2/mods-avaiable/passenger.load to this:

    it should be /mods-available/

    Antwort
    • Niclas
      29. Mai 2016 um 14:35
      Permalink

      Thanks, I fixed it

      Antwort
  • 11. Juli 2016 um 15:56
    Permalink

    I am stuck at the end of this really good tutorial. How to configure Step 8 if I try to deploy redmine from a local machine. Do I have to put Servernam localhost / ServerAlias localhost

    Antwort
    • Niclas
      12. Juli 2016 um 15:55
      Permalink

      If you’re on a local network you can use the same code, but remove lines 2 and 3 ( ServerName and ServerAlias). This configuration catches all requests sent to your PC. You also have to disable the default site of apache (a2dissite default) or replace it. (Apache Virtualhost Documentation) But have in mind, that this apache will only serve Redmine from now on. If you use localhost as ServerName Redmine is only accessible by your PC.

      Antwort

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.