It is a bit complicated running Ruby, Rails and Redmine in conjunction with Microsoft Internet Information Services (IIS) on Windows. Luckily, Rails ships a build-in webserver called WEBRick that can be used to run Redmine on a Windows system, so you don't need Windows IIS then.
It comes pretty handy running Redmine and WEBRick as a Windows service. This enables you to start, stop and re-start the service comfortably through the Windows Services
(services.msc). In order to achieve this goal, we use the tool NSSM (the Non-Sucking Service Manager), which registers any executable file as a service to the Windows system.
Setup / Requirements
The setup is as follows:
- Download NSSM (link see above) and extract it to any directory you like, e. g. C:\nssm-2.24
- Open a Command Prompt (cmd.exe) and change to the NSSM directory:
[caption id="attachment_121" align="alignnone" width="678"] Command Prompt (cmd.exe) and NSSM directory[/caption]
- Run NSSM through the command: nssm install <servicename>
Make sure, that you are in the NSSM directory. You are free to choose any service name you like unless it is not in use.
- Install the service using NSSM:
[caption id="attachment_123" align="alignnone" width="448"] NSSM (Non-Sucking Service Manager) and parameters to register Redmine as Service in Windows[/caption]
As Path: point to your Ruby installation and to the Rails.bat, which is the executable file that runs by the rails command.
As Startup directory: choose your redmine directory. As arguments, just use s.
As Service name: this is prepopulated by the name you chose in step 3.
The idea is that NSSM concatenates path and arguments and runs it in startup directory: C:\inetpub\wwwroot\redmine-3.1.0> C:\Ruby21-x64\bin\rails.bat s (meaning: running rails s in the Redmine directory, which starts WEBRick).
- Click on Install service to finish the registration.
Now you are able to start and stop your Redmine/WEBRick comfortably through Services
in Windows. Run services.msc to control the service:
[caption id="attachment_124" align="alignnone" width="966"]
Services.msc console to start, stop and re-start Windows services.[/caption]
As you can see, there is a service called redmine
, which was registered by NSSM. Just start the service and browse to http://localhost:3000 (which is the default WEBRick configuration) to access your Redmine installation:
[caption id="attachment_127" align="alignnone" width="1440"]
Redmine default login webpage[/caption]
It is pretty comfortably running Redmine/Rails through NSSM as a Windows service. Please keep in mind, that this setup is not recommended to run productive or large-scale installations, since WEBRick (the Rails built-in webserver) is not optimized for this purpose. If you want to run Redmine for big setups, you should use Windows IIS as a webserver and integrate Redmine through FastCGI.