I'm using redmine as a ticket manager, and I'd like to configure it to be run automatically when windows starts up.
How can I configure it to be run as a service?
--
Just asked the question to document it, I hope somebody may find it useful...
I'm using redmine as a ticket manager, and I'd like to configure it to be run automatically when windows starts up.
How can I configure it to be run as a service?
--
Just asked the question to document it, I hope somebody may find it useful...
For Rails 3.0.x applications (tested on 3.0.10 & Windows 7)
demo_daemon_ctl.rb
demo_daemon.rb
place both files in same dir and run
Some time ago, I tried to install Redmine on Windows as well. But I wasn't able to get it to work, probably because of lack of Rails knowledge.
Then I discovered Bitnami Redmine Stack. They have a Windows installer, which installs Redmine with all needed dependencies, and it just works.
1. using webrick:
ref: http://www.redmine.org/boards/1/topics/4123
Download and install the Windows NT Resource Kit from http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
Create the service by running this command:
in my case
path
is:could be also
C:\Program Files\Windows Resource Kits\Tools\
.Run regedit (Start -> Run -> regedit)
Add the following registry key if it's not already there:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\your_service_name
Right click on this registry key and select New -> Key. Name it
Parameters
.Add two values to the
Parameters
key. Right click on the parameters key, New -> String Value. Name itApplication
. Now create another one namedAppParameters
. Give them the following values:PathToRuby.exe
, eg.C:\ruby\bin\Ruby.exe
C:\RUBYAPP\script\server -e production
, whereRUBYAPP
is the directory that contains the redmine website.Example:
C:\redmine\script\server -p 2000 -e production
(-p indicates the port webrick will be listening to, and -e the environment used)Now you can go to Administrative Tools -> Services. There you can start your service (the one with name
your_service_name
) and test whether or not it is working properly. It should be noted that the service will be marked as started prior to WEBrick finishing its boot procedure. You should give it 1min or so before trying to hit the service to verify that it is working correctly.2. using mongrel:
ref: http://mongrel.rubyforge.org/wiki ref: http://mongrel.rubyforge.org/wiki/Win32
first install mongrel and mongrel_service gem
then create the service
3. using thin:
References:
Instructions:
First install thin (you'll need to install rack gem, if not already installed)
Follow the same steps indicated for webrick, but add another value named "AppDirectory". This is needed in order to avoid using c:\ruby\bin\thin.bat If I just pointed to the bat file, I couldn't stop the service.
In
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\redmine_thin\Parameters
add the following keys:------------------------------------------------------------------------------------------
You can control any of your service with the following commands:
use http://www.firedaemon.com/
Hope this will help to anyone. I defined the windows service that starts the redmine with the thin server.
Use http://nssm.cc/usage for windows service creation. Set the path to ruby.exe, your redmine's working directory and define the starting parameters:
For Rails 4.0.x applications as suggested by Bohdan, we have to replace
CONFIG['bindir'] with RbConfig::CONFIG['bindir']
Remmber to: gem install win32-service