日期:2014-05-17  浏览次数:21255 次

Redmine的windows服务安装方法

Redmine的windows服务安装方法

Ruby提供一个安装Ruby程序为服务的包:mongrel_service。安装其实很简单,只要命令行下运行gem:


gem install mongrel_service


过程中安装一些必须的其他包。

然后将RedMine使用mongrel_service安装成Windows服务:


mongrel_rails service::install -N RedMine -c D:\WebRoot -p 80 -e production


这里,我指定服务名为RedMine,我的RedMine在D:\WebRoot,你的要修改,注意指向truck的根目录。监听80端口。

然后修改启动方式为自动启动,并添加MySQL服务为其依赖服务(如果你的MySQL服务器不是本机就不用麻烦了):


sc config RedMine start= auto depend= MySQL

?

注意,执行sc config系列指令,服务必须是未启动的才行,否则会出错。

将来如果想去掉这个服务,只要执行:


mongrel_rails service::remove -N RedMine

也可以使用:sc delete RedMine 删除服务。

注:以上方法只适合于xp系统。



针对于server2003系统,需要使用下述办法:

转自:http://www.redmine.org/boards/1/topics/4123


First, download the Windows NT Resource Kit: http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en and install it.

It should be noted that this is not added to your PATH so you will always need to specify absolute paths when running these commands. To add the registry entry for redmine we do:

path\INSTSRV.EXE My Service path\SRVANY.EXE

In my case it looked like this:

"C:\Program Files\Windows NT Resource Kit\INSTSRV.EXE" Redmine "C:\Program Files\Windows NT Resource Kit\SRVANY.EXE"

Then add the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Redmine

Now go to Start -> Run -> regedit. Right click on the registry key and select New -> Key. Name it "Parameters" without the quotes.

Now we need to add two values to the Parameters key. Right click on the parameters key, New -> String Value. Name it "Application". Now create another one named "AppParameters". Give them the following values:

For Application:
C:\ruby\bin\Ruby.exe

For AppParameters:
C:\RUBYAPP\script\server -p 3000 -e production

注: -p 3000表示侦听3000端口。


Where RUBYAPP is the directory that contains the redmine website.

Now you can go to Administrative Tools -> Services. There you can start the Redmine service 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.

I hope this helps someone. Good luck.


安装Mysql数据库依赖方法不变,即:

sc config Redmine depend= MySQL

1 楼 ynp 2010-09-17  
我的是xp的系统,想安装成window 服务,但按上面的步骤报错:
Building native extensions.  This could take a while...
ERROR:  Error installing mongrel_service:
        ERROR: Failed to build gem native extension.

D:/Ruby187/bin/ruby.exe extconf.rb
checking for RegisterServiceCtrlHandlerEx()... no
checking for EnumServicesStatusEx()... no
checking for QueryServiceStatusEx()... no
creating Makefile

make
'make' 不是内部或外部命令,也不是可运行的程序
或批处理文件。


Gem files will remain installed in D:/Ruby187/lib/ruby/gems/1.8/gems/win32-servi
ce-0.5.2 for inspection.
Results logged to D:/Ruby187/lib/ruby/gems/1.8/gems/win32-service-0.5.2/gem_make
.out

不知您遇到过这种情况没有?
2 楼 wiflish 2010-09-20  
ynp 写道
我的是xp的系统,想安装成window 服务,但按上面的步骤报错:
Building native extensions.  This could take a while...
ERROR:  Error installing mongrel_service:
        ERROR: Failed to build gem native extension.

D:/Ruby187/bin/ruby.exe extconf.rb
checking for RegisterServiceCtrlHandlerEx()... no
checking for EnumServicesStatusEx()... no
checking for QueryServiceStatus