Start tomcat webapp with root privileges

Posted by Hagay Myr on Server Fault See other posts from Server Fault or by Hagay Myr
Published on 2012-04-01T10:35:14Z Indexed on 2012/04/01 11:32 UTC
Read the original article Hit count: 258

I built a webapp that uses libpcap (via jpcap).

In order to be able to get the network interfaces list or to bind to a network interface, the application (in this case a webaap that runs from tomcat server) must be running with root privileges.

During development I simply ran Eclipse with root privileges (sudo eclipse) and my webapp worked just fine with Eclipse's local tomcat server.

However, when I try to deploy my webapp to the "real" tomcat server, it isn't working. I Also tried to start the tomcat6 service with sudo and changed the TOMCAT6_USER definition (defined in /etc/init.d/tomcat6) from "tomcat6" to "root" but it made no difference.

What should I do to make it work?

© Server Fault or respective owner

Related posts about ubuntu

Related posts about tomcat