Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Redmine Cookbook

You're reading from   Redmine Cookbook Over 80 hands-on recipes to improve your skills in project management, team management, process improvement, and Redmine administration

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher Packt
ISBN-13 9781785286131
Length 322 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Aleksandar Pavic Aleksandar Pavic
Author Profile Icon Aleksandar Pavic
Aleksandar Pavic
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Installing and Running Redmine 2. Customizing Redmine FREE CHAPTER 3. Project Management with Redmine 4. Improving Team Performance 5. Regular and Planned Maintenance 6. Performance and System Tuning 7. Integrating Redmine with Other Software 8. Getting the Most Out of Scripts and Plugins 9. Troubleshooting 10. Making the Most of Redmine 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:

Testing Puma

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/

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image