30 minutes to Redmine, an express installation guide

Update 2014-10-10:

Updated to install Ruby 2.1.3 (supported from Redmine 2.5.2). Corrects Apache configuration URLs.

Update 2014-07-12:

Added troubleshooting suggestions.

Update 2014-05-20:

Added support for HSTS and commented OCSP stapling.

Before starting

This is an express guide. Novices may need more detailed explanations
For Ubuntu 14.04 instructions 

Most of the time you will be waiting for downloads or compilations to complete.

This was tested on Debian 7.4 (Wheezy) with Redmine 2.5.x but it should be compatible with future updates. You will need a minimum of 512MB of RAM to compile everything needed though 1GB of RAM is recommended.

Note that the total installation time will mostly depend on your internet connection speed.

If your internet is slow, grab a cup of coffee

Create the database :

Note that ‘my_password’ needs to be replaced by a strong password!
Do the stuff! Get Ruby and Redmine:
Here you have some work:
Edit such as:
Don’t forget to replace “my_password” by your actual password created earlier.
Preserve the indentation, all lines but the first are indented by 2 spaces.

We can now initialize the Redmine database:

We need a web server!

We install Passenger to serve Redmine:

Follow the instructions at the end of the Passenger installation to create your Passenger Apache configuration. Copy the configuration prompted by the command into /etc/apache2/conf.d/passenger.conf. Do NOT copy the example below as it will very probably fail.

It should look like:

/etc/apache2/conf.d/passenger.conf

Load the Redmine.pm library for Repository authentication:

We create the certificate with OpenSSL. Set the “Common Name” to the name of your  domain name  for example redmine.domain.com

Now we get Apache2 configuration files from a Gist I created

Files should be placed in /etc/apache2/sites-available/

You can download the files directly on the server:

You need to replace ‘my_password’ by your MySQL redmine user password (2 instances).

You also need to replace redmine.domain.com by your domain name in both files

Note that Perfect Forward Secrecy is configured

There you go, your Redmine instance should be up in running!
Test it at http://redmine.domain.com (replace with your settings)
Username: admin
Password: admin

If Redmine or another service on the server doesn't show up

What now

You may want to check that your configuration is correct in https://redmine.domain.com/admin/info

You may also want to configure your email server in: /opt/redmine/current/config/configuration.yml

[Optional] Install Create Git plugin

 

44 Comments

  1. lkuulu April 22, 2014 3:53 pm  Reply

    Hi,

    From scratch,
    “bundler” have to be installed before use 🙂
    so I added bundler to the very longest install list.

    nice guide.

    • Martin DENIZET April 22, 2014 4:04 pm  Reply

      Hello,
      Actually the bundler gets installed by RVM (See detail here: http://rvm.io/integration/bundler)
      The problem is that you need to relog the current user to be able to use the bundle commands.
      That’s why I do a su - before using the bundle command (it opens a new shell reloading the user profile).
      I’d like to know if the su - didn’t allow you to get access to the bundle command. I’d need to understand why.
      Thanks for the feedback!

  2. Jakub May 2, 2014 6:59 pm  Reply

    This is instruction for apache 2.2 or 2.4?

    • Martin DENIZET May 2, 2014 9:19 pm  Reply

      Hello Jakub,
      This guide was written using Debian stable (Wheezy, version 7). In Wheezy the Apache package contains Apache2.2.22 as time of writting:

      # apache2 -v
      Server version: Apache/2.2.22 (Debian)
      Server built: Jan 31 2014 18:55:41

      It limits the SSL ciphers available if it’s what you had in mind.
      Cheers!

  3. David Sienniak May 9, 2014 8:22 am  Reply

    Hi Martin,
    Your excellent guide works perfectly on Ubuntu 12.04.
    Even a newbie to Linux like myself could follow it! Thank you. I installed your “Create Git plugin” and that works too.
    I did notice that while I can clone from the repo, I cannot push. Permissions for the git repo are:
    drwxr-sr-x www-data www-data
    If I do a chmod -R g+rwX . then I can push. Is this the right way to enable pushing or am I doing something wrong?
    Regards, David

  4. Dimka June 4, 2014 10:38 pm  Reply

    Hi, Martin.
    Your guide is excellent and works good. My Redmine now works and filled various tasks.
    Did you try this installation with Nginx instead of Apache?
    OR
    Is it posible to modify this complete installation by adding Nginx as reserve proxy?

    • Martin DENIZET June 6, 2014 1:11 pm  Reply

      Hi Dimka,
      I tried Puma installation with Nginx for “fun” but I didn’t have GIt and SVN integration working that’s why I didn’t write about it.
      It should work to use Nginx as reverse proxy for the configuration in this article. For reference, the Nginx documentation: http://nginx.com/resources/admin-guide/reverse-proxy/
      If you move Redmine to use only port 8080 on localhost, you could do:

      location / {
      proxy_pass http://localhost:8080/
      }

      Don’t forget to get SSL configured.
      I’ll be looking forward knowing what worked for you.
      Cheer,

  5. Hossein July 14, 2014 2:05 am  Reply

    I want to run and test Redmine on localhost.
    What changes do I have to make in redmine.vhost and redmine-redirect.vhost exactly?

    • Martin DENIZET July 14, 2014 10:49 am  Reply

      Hi Hossein,
      To have Redmine accessible on the local computer only, you should replace:
      VirtualHost *:80 by VirtualHost localhost:80 in redmine-redirect.vhost
      VirtualHost *:443 by VirtualHost localhost:443 in redmine.vhost
      If it’s not successful, you can try with 127.0.0.1 instead of localhost.
      Alternatively , you could also implement a Allow/Deny statement to allow only access from localhost.
      Let me know how it goes.

  6. Eric July 18, 2014 6:06 pm  Reply

    Hi,

    I installed as described, but when I close the Firefox browser or tab and try to login again I can’t get to my/home. It looks like the browser keeps the cookies of the previous session. How can I remove the cokkies when I close the browser/browser tab. Does anyone experienced this before?

    • Martin DENIZET July 19, 2014 5:47 pm  Reply

      Hi Eric,
      Yes, this is the expected behavior.
      You can adjust it in: Administration/Settings/Authentication tab:
      You can set “Session maximum lifetime” and “Session inactivity timeout”, they are both disabled by default.
      Cheers,

      • Eric July 19, 2014 10:26 pm  Reply

        I have set the following:

        Session maximum lifetime: 1 day
        Session inactivity timeout : 1hour

        But this does not solve the problem, after closing the browser/ browser tab I get the following error:

        The page isn’t redirecting properly

        Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

        This problem can sometimes be caused by disabling or refusing to accept cookies.

        • Martin DENIZET July 20, 2014 12:14 am  Reply

          Hey Eric,
          Are you using SSL or not? If not, get rid of the HSTS instructions. You could also try to disable the redmine-redirect to see how it affects the behavior.
          I wont be available for the next 2 weeks.
          Post here if you find the solution to your problem please.
          Cheers

  7. Eric July 19, 2014 10:38 pm  Reply

    In addition, If I remove the browser cookies after closing the browser/browser tab it works fine

  8. Melroy August 10, 2014 9:06 am  Reply

    Thanks!

    • Martin DENIZET August 13, 2014 12:27 pm  Reply

      Glad it was helpful! It’s always nice to have feedback!

  9. estu August 13, 2014 12:18 pm  Reply

    hai,
    i just try install redmine in debian wheezy.
    who owner of directory /opt/redmine
    in my server it belong to root . 🙁
    thanks

    • Martin DENIZET August 13, 2014 12:26 pm  Reply

      Hello Estu,
      On my installation too, root is the owner of /opt/redmine
      That should not be a problem.
      Do you have permissions issues?
      Cheers,

  10. estu August 13, 2014 3:39 pm  Reply

    yes.
    maybe i should try reinstall again.
    i just want set repos dir to /home/git (separated).
    🙂

    thanks for replay. 😀

    • Martin DENIZET August 13, 2014 3:46 pm  Reply

      Hi Estu,
      No need to re-install to do so. You can do it just by modifying the path to repositories in the /git location in the Apache configuration.
      Cheers,

      • estu August 13, 2014 6:27 pm  Reply

        its done,
        i reinstalled redmine,
        need change group permission to repos dir.
        *maybe i should write in my blog.
        thanks. it actually help me.. 😀

  11. Nick August 19, 2014 3:21 pm  Reply

    Hi Martin

    Thanks for this great tutorial!
    Did you have success in the meantime to get GitSmartHTTP to work with Ubuntu 14.04 and Redmine 2.5.x?

    Regards

  12. Sofie January 12, 2015 10:47 am  Reply

    Thanks a lot for this!
    Especially as Debian packages are outdated and configuration files containing deprecated Gem.source_index.
    I would send you a Flattr or micropayment, if you had any, by now just big thanx.

    • Martin DENIZET January 12, 2015 4:51 pm  Reply

      Thank you very much Sofie, it means a lot!
      I’ll think about it for the Flattr 😉
      Cheers,

  13. volkswagner February 5, 2015 10:12 am  Reply

    I get command not found when running bundle install –without development test

  14. volkswagner February 5, 2015 10:19 am  Reply

    I didn\’t realize I had to run again \”curl -sSL https://get.rvm.io | bash -s stable –ruby=2.1.3\”

    after I go gpg error:

    gpg: Can\’t check signature: public key not found
    try downloading the signatures:

    Question is, do you install .rvm into /root as root user or do you install into your user\’s /home/username directory?

    • Martin DENIZET February 28, 2015 4:17 am  Reply

      Hello,

      Yes, indeed there was a change in the installation process of RVM, my tutorial needs to be updated.
      I install RVM as root for more convenience and to simplify the instructions.
      If you don’t install as root, you would have to “source” RVM before using it.

      Sorry for the late reply, I got busy with work!

      Cheers,

  15. Mauro February 25, 2015 11:24 pm  Reply

    I\’m following Your guide to install brand new 3.0.0 in a very strange environment (debian jessie running in a chroot jail) and, as expected, I ran into problems 😉

    1) it is advised upstream to use Bundle to install gems, so I did:

    echo >Gemfile.local \”gem \’passenger\’\”
    bundle install

    2) I elected to install in another dir, so I did:

    cd /my/non-standard/location
    ln -s redmine-3.0.0 current
    ln -s /my/non-standard/location /opt/redmine

    3) perl5 @INC seems different, so Your symlink became:

    ln -s /opt/redmine/current/extra/svn/Redmine.pm /usr/share/perl5/Apache2/

    4) my apache2 installation doesn\’t seem to recognize .vhost extension, so I renamed .conf

    5) apache 2.4 config syntax seems a bit changed; I got errors:
    [warn] The apache2 configtest failed. … (warning).
    Output of config test was:
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/redmine.conf:1
    AH00526: Syntax error on line 73 of /etc/apache2/sites-enabled/redmine.conf:
    Either all Options must start with + or -, or no Option may.
    Action \’configtest\’ failed.

    6) I also have another web server (non chroot-ed) running, so I had to change the default ports (56180 & 56443, if matters).

    All this is somewhat ok, I report it just to let You upgrade Your (already very good) post.
    Unfortunately I get a: \”Forbidden – You don\’t have permission to access / on this server.\”

    apache2/redmine.error.log says:
    [Wed Feb 25 15:13:28.540371 2015] [authz_core:error] [pid 18146:tid 4051663680] [client 192.168.7.124:20711] AH01630: client denied by server configuration: /opt/redmine/current/public/

    Any suggestion? TiA

  16. IB February 20, 2016 12:13 am  Reply

    Hi, How can i disable https, i want to use http only. Thanks.

    • Martin DENIZET February 20, 2016 5:42 am  Reply

      Hello,

      Disable the redirection:
      a2dissite redmine-redirect.vhost
      Then edit: /etc/apache2/sites-available/redmine.vhost

      Change the VirtualHost *:443 to VirtualHost *:80
      Then remove the few lines for SSL configuration.
      Restart apache2:
      service apache2 restart

      You should be good!

      Cheers,

  17. Dionis June 25, 2016 8:39 pm  Reply

    Hello Can you help me with instructions?

    When i type \”sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev git subversion imagemagick \\\” it show me this
    \”>
    bash: sqlite3: command not found\”

    Then when i type \”libmagickwand-dev mysql-server libmysqlclient-dev apache2 apache2-threaded-dev libcurl4-gnutls-dev apache2 \\\” it show me

    \”>
    bash: libmagickwand-dev: command not found\”

    Can you say me what is this? i have new installed Debian 8

    • Martin DENIZET June 26, 2016 2:08 am  Reply

      Hello Dionis,

      Copy/paste this entire block in one go:
      apt-get install curl gawk g++ gcc make libc6-dev libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev \
      sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev git subversion imagemagick \
      libmagickwand-dev mysql-server libmysqlclient-dev apache2 apache2-threaded-dev libcurl4-gnutls-dev apache2 \
      libapache2-svn libapache-dbi-perl libapache2-mod-perl2 libdbd-mysql-perl libauthen-simple-ldap-perl openssl

      The \ at the end of the lines tell Linux that the command is not complete and that it continues on the next line.

      This could be actually a single line but it kind of break my blog’s layout if I make a line that long.

      Cheers,

  18. IB July 26, 2017 9:48 pm  Reply

    Hi,
    How do i update the setup above from redmine 3,2 to redmine 3,4 (the most recent stable version) ?
    Thanks !

Leave a Reply