简体   繁体   English

使用特权运行tomcat6 webapp

[英]Running tomcat6 webapp with privileges

I'm running jWebSockets on tomcat6 and when it comes up this line appears in the log: 我在tomcat6上运行jWebSockets,当它出现时,该行出现在日志中:

2012-10-13 23:04:52,298 ERROR - FlashBridgePlugIn: FlashBridge could not be started: Permission denied

some digging around and I found that since this plugin runs a FlashPolicyServer and it needs to use port 843, It needs root privileges. 一些挖掘,我发现由于该插件运行FlashPolicyServer且需要使用端口843,因此需要root特权。 How do I give root privileges to a webapp? 如何授予Web应用程序的root特权? Can I just give enough privileges to the TOMCAT_USER so it will be able to use ports below 1024? 我可以给TOMCAT_USER足够的特权,使其能够使用1024以下的端口吗?

Take a look at jsvc . 看看jsvc It can be used to launch Tomcat to allow it to do some root-y things such as bind to low-numbered ports. 它可以用来启动Tomcat,以允许它做一些root-y的事情,例如绑定到低编号的端口。

I'm not exactly sure at what point jsvc/Tomcat conspire to drop root privileges: your webapp might not have a chance to open that port before the privileges are dropped. 我不确定jsvc / Tomcat在什么时候会企图放弃root特权:在删除特权之前,您的web应用程序可能没有机会打开该端口。 In that case, I think you'll have to write your own bootstrap (Java) class similar to the stock Tomcat one and use that with jsvc. 在这种情况下,我认为您必须编写自己的类似于Java Tomcat的bootstrap(Java)类,并将与jsvc结合使用。 Then, you can allow your webapp to open that port before shedding root privileges. 然后,您可以允许您的web应用在释放root特权之前打开该端口。

Port 843 is the fallback port, have you tried to check if port 8787 is open. 端口843是备用端口,您是否尝试检查端口8787是否已打开。 Please see documentation here . 在此处查看文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM