How to run different apps on single Tomcat instance behind different ports?

I think you can configure that in you server.xml file and put 2 services : <Service name=”app1″> <Connector port=”8081″ protocol=”org.apache.coyote.http11.Http11NioProtocol” connectionTimeout=”20000″ redirectPort=”8443″ /> <Engine name=”Catalina” defaultHost=”localhost”> <Host name=”localhost” appBase=”app1″ unpackWARs=”true” autoDeploy=”true”> </Host> </Engine> </Service> <Service name=”app2″> <Connector port=”8082″ protocol=”org.apache.coyote.http11.Http11NioProtocol” connectionTimeout=”20000″ redirectPort=”8443″ /> <Engine name=”Catalina” defaultHost=”localhost”> <Host name=”localhost” appBase=”app2″ unpackWARs=”true” autoDeploy=”true”> </Host> </Engine> </Service>

How to embed Tomcat 6?

Code speaks for itself. See the pom.xml snippet and the class to run tomcat. <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>catalina</artifactId> <version>6.0.18</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>coyote</artifactId> <version>6.0.18</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>jasper</artifactId> <version>6.0.18</version> <scope>test</scope> </dependency> public class RunWebApplicationTomcat { private String path = null; private Embedded container = null; private Log logger = LogFactory.getLog(getClass()); /** * The directory … Read more

Increase permgen space

You can use : -XX:MaxPermSize=128m to increase the space. But this usually only postpones the inevitable. You can also enable the PermGen to be garbage collected -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled Usually this occurs when doing lots of redeploys. I am surprised you have it using something like indexing. Use virtualvm or jconsole to monitor the Perm … Read more

How to change the port of Tomcat from 8080 to 80?

1) Go to conf folder in tomcat installation directory e.g. C:\Tomcat 6.0\conf\ 2) Edit following tag in server.xml file <Connector connectionTimeout=”20000″ port=”8080″ protocol=”HTTP/1.1″ redirectPort=”8443″/> 3) Change the port=8080 value to port=80 4) Save file. 5) Stop your Tomcat and restart it.

How to change the ROOT application?

There are three methods: First shutdown your Tomcat from the its bin directory (sh shutdown.sh). Then delete all the content of your Tomcat webapps folder (rm -fr *). Then rename your WAR file to ROOT.war, and finally start your Tomcat from the bin directory (sh startup.sh). Leave your war file in $CATALINA_BASE/webapps under its original … Read more