Book Image

Redmine Cookbook

By : Shamasis Bhattacharya
Book Image

Redmine Cookbook

By: Shamasis Bhattacharya

Overview of this book

In a variety of online project management tools, Redmine markets itself as offering flexibility. Choosing the right management tool can mean the difference between the success and failure of a project. Flexible project management tools bend themselves to fit your needs, whether that’s communication regarding a simple project, or collaboration, or more complex project methodology such as SCRUM, or an issue-code relationship, or the need of different methodology for your project. Whether you are project manager or system administrator, this book provides valuable recipes to get the best possible performance out of your team, organization, infrastructure, and Redmine itself. Through a series of carefully crafted recipes covering the nitty-gritty of Redmine, you’ll be guided through the installation of Redmine, as well as how to fine-tune and customize your Redmine installation. Finally, we walk you through integrating Redmine with other softwares and databases like Tortoise SVN and Visual Studio and troubleshooting Redmine.
Table of Contents (17 chapters)
Redmine Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Using Puma and IIS on Windows


Puma is advertised as a small and fast server. It is derived from Mongrel, which is an open source web server written in Ruby by Zed Shaw. It can serve Redmine on its own, or behind Nginx, Apache, or IIS. Puma can be run and installed in a user's home directory or system-wide.

Getting ready

First, install Redmine as explained in the previous recipe.

Then, we need the OpenSSL Developer Package (this contains header files and binaries), which can be downloaded from http://packages.openknapsack.org/openssl/openssl-1.0.0k-x64-windows.tar.lzma. Considering that we followed the previous recipe precisely, if you need a different SSL version, you can obtain it from https://www.openssl.org. Now, perform the following steps:

  1. Download http://packages.openknapsack.org/openssl/openssl-1.0.0k-x64-windows.tar.lzma and copy it to C:\ruby.

  2. Create a folder, openssl, in C:\ruby and copy the downloaded OpenSSL lzma archive here.

  3. Run cmd and navigate to C:\ruby\openssl by typing the following: cd C:\ruby\openssl. Extract the content of the archive by typing:

    bsdtar --lzma -xf openssl-1.0.0k-x64-windows.tar.lzma
    

    Note

    If minigw bin from devkit is not added to path, you must specify full folder in order to execute bsdtar, and it would look somewhat like this:

    c:\ruby\devkit\mingw\bin\bsdtar.exe --lzma -xf c:\ruby\openssl\openssl-1.0.0k-x64-windows.tar.lzma

  4. You should end up with OpenSSL files extracted in C:\ruby\openssl.

How to do it…

Once you have installed Redmine and its prerequisites, as explained in this recipe, proceed by installing the Puma server by typing the following:

gem install puma -- --with-opt-dir=c:\ruby\openssl

Testing Puma

This recipe assumes that your Redmine is installed, as explained in the, Installation on Windows servers recipe.

Run the following command from Redmine's directory in the command prompt:

puma -e production -p 3000

You should get a screen that looks like the following:

Navigating to http://127.0.0.1:3000 on your browser should open Redmine screen.

Configuring Puma to start with Windows

To have your Puma server started automatically with Windows, perform the following steps:

  1. Create a file, pumastart.bat, in C:\ruby with the following contents:

    cd C:\redmine
    start /min puma -e production -p 3000 -t 8:32
    
  2. Then go to Server Manager | Tools | Task Scheduler | Create a Task.

  3. Check the Run whether user is logged or not, Run with highest privileges, and Hidden checkboxes.

  4. Then in Actions, go to New | Start a program and find pumastart.bat.

  5. On the Triggers tab, click New and choose Begin the task: At startup (located in the top dropdown).

Configuring IIS

You should add an IIS role to your server and install the following two add-ons to IIS. You can install them directly from the Microsoft website.

You can get the URL Rewrite from http://www.iis.net/download/URLRewrite and the reverse proxy from http://www.iis.net/download/ApplicationRequestRouting.

  1. Open IIS Manager.

  2. Navigate to the website that you want to use as a Redmine proxy

  3. Click the URL Rewrite icon.

  4. Right-click inbound rules list.

  5. Select Add Rule and choose Reverse proxy.

  6. Add an Inbound rule with the following: 127.0.0.1:3000.

If your Puma server runs after clicking OK, you should be able to type http://localhost or whatever your server name is and you will get the Redmine welcome screen.

How it works…

At first, we needed some prerequisites to install Puma because the gem to install Puma compiles it on your machine, and it requires proper OpenSSL library headers and binaries to compile. This is the reason why OpenSSL and dev tools are required. Then, the Puma installation is tested just by typing puma -e production -p 3000. To ensure that Puma starts after the Windows server restarts, Task Scheduler is used, and it schedules Puma to start on boot through a BAT file. In a bat file, command –t 8,32 tells Puma to start with a minimum of 8, and a maximum of 32 threads. You can adjust these values to fit your configuration. After this, we installed two Microsoft original modules to the IIS server and added a reverse proxy rule to forward all requests to 127.0.0.1:3000 where the Puma server is listening. We used the default IIS site, but this rule works with any or multiple IIS sites.

There's more…

This recipe can be easily adopted to use Puma behind Nginx or Apache on both Windows and Linux systems. Also Thin or Unicorn can be used instead of Puma.

See also

Check out the Puma website for updates, additional configurations and fine-tuning:

http://puma.io/