Question

In IntelliJ, I would like to have different configurations to start several Tomcat instances, but with different server.xml config files. Is there a way to do this?

Was it helpful?

Solution

I found a way: create a directory, and put inside a copy of the conf dir from Tomcat, then use this new directory as the Tomcat base. This way, the tomcat binaries are shared, but the configurations are distinct.

OTHER TIPS

As far as I know there isn't. In the case I want to do that, I simply create 2 copies of Tomcat on my disk and create a configuration for both of them.

If the configurations are different because of your application's needs, I'd say that editing server.xml is the wrong way to go about it.

A better solution is to have a context.xml for your app in META-INF. Keep the things that are specific to your app isolated from the server. You won't affect other apps that way, and you can't always count on being able to modify the server configuration if you're in a shared environment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top