简体   繁体   中英

Running tomcat6 webapp with privileges

I'm running jWebSockets on tomcat6 and when it comes up this line appears in the log:

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. How do I give root privileges to a webapp? Can I just give enough privileges to the TOMCAT_USER so it will be able to use ports below 1024?

Take a look at jsvc . It can be used to launch Tomcat to allow it to do some root-y things such as bind to low-numbered ports.

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. 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. Then, you can allow your webapp to open that port before shedding root privileges.

Port 843 is the fallback port, have you tried to check if port 8787 is open. Please see documentation here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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