RSS

  • YouTube
  • LinkedIn
  • Google

Installing Redmine in Nginx on Centos 6. X

Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;

In this article I will show you how to set up the Redmine version 2.5.2 (2014-07-06) on a Web server Nginx.

Redmine is a web application for project management. I met him some time ago in one of the companies where I spent and is an excellent free alternative for those who need to manage projects, whether or not development.

Nginx is a Web server that is gaining a lot of space in recent years due to his performance for large quantities of request.

Redmine is written in Ruby programming language and uses the Rails Framework. Because of this, don't just follow the steps described in the manual installation of Redmine when it comes to making it run on Nginx. It is necessary a version Special Setup Nginx and I will show you in the next few paragraphs setting up a complete environment so that you can run it.

First I must make it clear that I use Centos (Version 6.5) and that all settings and commands will be for this Operating System. If you are using another OS, do the appropriate conversion of commands and paths.

I was using the Redmine under Apache and configured had many mishaps because the different version of Ruby and Rails. As I had no experience with the language suffered enough with compilation errors and incompatibility of modules and Gems among others.

When I changed my server decided to adopt the Nginx as Web Server and I ended up leaving the Redmine as a last item to configure, Since I still had running on Apache on the old server. When I finally arrived at the point of doing this I already had a very ripe environment under Nginx including third-party sites. For my ungrateful surprise, even completing all the steps in the installation manual the Redmine not performed correctly and found out it wasn't going to be possible (for me) make it run on the existing version in the repositories of Centos. It was necessary a specific version for Rails.

Now here's a warning: If you already have a Nginx running and well configured, take every precaution when it comes to take back your environment, If something goes wrong.

Then we have at least two possibilities. One is the existence of an environment already configured and running nginx and another of a clean install. If you're thinking about migrating from Apache to Nginx and already have or intend to use Redmine, can serve this article to do a clean install and then migrate your sites hosted on Apache to Nginx (is outside the scope of this article).

I'll explain the clean installation. She is quite simple if you follow the steps.

1 ; Installing the ruby support.

The first thing we need is to have Ruby language support. This was one of the points of headache, because believe me, There are several versions of the language and never not always the application developed for a version will run on other, Although it is possible to run different versions of ruby in the same environment. Always make sure the version supported by the application you want to host. In the case of Redmine 2.5.2 the requirements are Ruby 2.1 and Rails 3.2.

In my experience, trying to install Ruby via Yum on Centos wasn't such a good idea and so decided to use the RVM to install ruby and everything else that is dependent on it.

Another important item is not to install Redmine using root. Use a separate user nginx. This avoids some problems that I won't explain now. In the example I'm using a user created for access to the server without root access and use root to some specific installations.

Installing the RVM

THE RVM (Ruby Version Manager) allows you to create multiple Ruby environments and install Ruby and Rails is much simpler.

Start installing the gpg key to validate the package.

At the end of the execution of the command above we have the RVM, Ruby 2.1 and the Rails installed. This process varies according to the connection time, but it shouldn't take more than five minutes. If Curl is not available, install it with the command

At the time I write this article, the versions that will be installed are RVM 1.26.7, Ruby 2.1.5 and Rails 4.2.0.

The finish check the warnings generated. One of them refers you to start using RVM is necessary to execute a command source. Run the command exactly as proposed and soon to follow RVM reload.

Now installed nginx through the passenger-install-nginx-module, a script that installs nginx already compiled with support for the passenger, What is the required module to perform the Ruby application in Ngnix. For this we execute the command:

and then

[Regis redmine @ ~]$ rvmsudo passenger-install-nginx-module

NOTE: At this point you may happen to be displayed a message that it has not been possible to find passenger-install-nginx-module. If it does check if the module was actually created. If you are using the default installation paths and the version of ruby indicated he should be in /usr/local/rvm/gems/ruby-2.1.5/bin/passenger-install-nginx-module.

When asked about the compile options automatically or on your own, Choose the option 1.
For the sake of compatibility and as this is a clean install I chose to use the same path that nginx would be installed by yum. When asked about the path type /etc/nginx or leave the default /opt/nginx. It is like each.

At this point we've got nginx installed with Ruby support, However this installation creates the startup script of the service in /etc/init.d.
To create the script has two paths: The first is to use the script from this link. The second is to use the Yum install script as follows.
1 ; Make sure not to start nginx yet. Rename the installation directory/etc/nginx for/etc/nginx.bkp.
Ex.:

Install nginx via yum

Delete the/etc/nginx directory

Return the directory of our nginx to the original

Edit the file /etc/sysconfig/nginx and modify the existing path /etc/nginx/nginx file to /etc/nginx/nginx/conf file
Test the service initialization with

The answer that should be achieved is

And confirm by accessing the ip in the browser so that the welcome page is displayed.

 ;


Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.