使用Wampserver的按钮启动/停止Tomcat

使用Wampserver的按钮启动/停止Tomcat,tomcat,wamp,wampserver,tomcat8,Tomcat,Wamp,Wampserver,Tomcat8,我用WAMPServer2.0安装了一台服务器,通过,我成功地与Tomcat6(作为windows服务安装)集成。为了方便起见,我对wampmanager.ini做了一些更改,可以使用WampServer菜单启动所有服务。见下文: [Services] Name: wampapache Name: wampmysqld Name: Tomcat6 [StartupAction] ;WAMPSTARTUPACTIONSTART Action: run; FileName: "D:/wamp/bi

我用WAMPServer2.0安装了一台服务器,通过,我成功地与Tomcat6(作为windows服务安装)集成。为了方便起见,我对wampmanager.ini做了一些更改,可以使用WampServer菜单启动所有服务。见下文:

[Services]
Name: wampapache
Name: wampmysqld
Name: Tomcat6

[StartupAction]
;WAMPSTARTUPACTIONSTART
Action: run; FileName: "D:/wamp/bin/php/php5.3.0/php-win.exe";Parameters: "refresh.php";WorkingDir: "D:/wamp/scripts"; Flags: waituntilterminated
Action: resetservices
Action: readconfig;
Action: service; Service: wampapache; ServiceAction: startresume; Flags: ignoreerrors
Action: service; Service: wampmysqld; ServiceAction: startresume; Flags: ignoreerrors
Action: service; Service: Tomcat6; ServiceAction: startresume; Flags: ignoreerrors
;WAMPSTARTUPACTIONEND

[StartAll]
;WAMPSTARTALLSTART
Action: service; Service: wampapache; ServiceAction: startresume; Flags: ignoreerrors
Action: service; Service: wampmysqld; ServiceAction: startresume; Flags: ignoreerrors
Action: service; Service: Tomcat6; ServiceAction: startresume; Flags: ignoreerrors
;WAMPSTARTALLEND

[StopAll]
;WAMPSTOPALLSTART
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors
Action: service; Service: wampmysqld; ServiceAction: stop; Flags: ignoreerrors
Action: service; Service: Tomcat6; ServiceAction: stop; Flags: ignoreerrors
;WAMPSTOPALLEND

[RestartAll]
;WAMPRESTARTALLSTART
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: service; Service: wampmysqld; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: service; Service: Tomcat6; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: service; Service: wampapache; ServiceAction: startresume; Flags: ignoreerrors waituntilterminated
Action: service; Service: wampmysqld; ServiceAction: startresume; Flags: ignoreerrors waituntilterminated
Action: service; Service: Tomcat6; ServiceAction: startresume; Flags: ignoreerrors waituntilterminated
;WAMPRESTARTALLEND

[myexit]
;WAMPMYEXITSTART
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors
Action: service; Service: wampmysqld; ServiceAction: stop; Flags: ignoreerrors
Action: service; Service: Tomcat6; ServiceAction: stop; Flags: ignoreerrors
Action:  exit
;WAMPMYEXITEND
然而,我正在升级我的服务器,并试图在WAMPServer3.0.0中重复这个想法,但没有成功。wampmanager.ini中引用的更改是否 和wampmanager.tpl(具有相同的设置部分),但当使用菜单启动Wampserver时,Tomcat服务不会启动

如果我手动启动Tomcat服务,集成工作正常,我唯一的问题是使用WampServer菜单,在一次单击中启动和终止所有服务


有人能提出什么建议吗?

在Wampserver论坛()中交换信息后,我设法解决了问题,我在这里分享了我的问题的解决方案

与2.0版本不同,3.0.0版本的更改不在wampmanager.tpl中进行。变化如下:

$WAMP\u HOME$\wampmanager.conf

在[service]中,为Tomcat服务创建了一行标记(在我的例子中,Tomcat 8.0.30是作为服务安装的,称为“tomcat8”)

$WAMP\u HOME$\scripts\config.inc.php

已创建Tomcat服务的变量

$c_tomcatService = $wampConf['ServiceTomcat']; 
$WAMP\u HOME$\wampmanager.tpl

更改了上面原始帖子中提到的标记,添加了引用Tomcat服务的行

...
[Services]
Name: ${c_tomcatService}

...
[StartupAction]
Action: service; Service: ${c_tomcatService}; ServiceAction: startresume; Flags: ignoreerrors

...
[StartAll]
Action: service; Service: ${c_tomcatService}; ServiceAction: startresume; Flags: ignoreerrors

...
[StopAll]
Action: service; Service: ${c_tomcatService}; ServiceAction: stop; Flags: ignoreerrors

...
[RestartAll]
Action: service; Service: ${c_tomcatService}; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: service; Service: ${c_tomcatService}; ServiceAction: startresume; Flags: ignoreerrors waituntilterminated

...
[myexit]
Action: service; Service: ${c_tomcatService}; ServiceAction: stop; Flags: ignoreerrors
在第一次测试中,没有成功。我发现Tomcat服务是由Windows服务管理器启动的,但当通过提示符或批处理文件(拒绝访问错误)手动调用时,Tomcat服务不起作用,即使是服务器上的管理员

Wampserver论坛建议我使用SetACL()。使用下面的命令,我可以更改权限:

setacl -on "tomcat8" -ot srv -ace "n:my_login;p:start_stop,read" -actn ace
通过这种配置,并使用SetACL,我成功地启动和停止了Tomcat服务以及Wampserver的服务

setacl -on "tomcat8" -ot srv -ace "n:my_login;p:start_stop,read" -actn ace