Tomcat – Can you run a specific tomcat Web Application under another user

configurationtomcatusers

We're developing a web-app running under tomcat which relies on Java User preferences to store all kind of settings. That works great, but we've run into problem where we needed to set up another staging web-app which allows you to test settings before settings them live.

The core of the problem lies in the fact that Java User preferences are the same for all web-app due to the fact that all of them run under the tomcat user (configurable). For legacy reasons I can not at the moment change my preferences structure, so I'm hoping for a solution on the the tomcat configuration side.

Is it possible to designate a different user credentials for a specific web-app in tomcat?

Thanks,
Boaz

Best Answer

I don't believe you can make separate apps run as different users in Tomcat. You have a couple choices. You could just install a second tomcat on the same box/different directory and run it on another port; then you don't have any dependency problems. Or, you may be able to override whatever the settings are you're talking about.