Josh G wrote: > Hi, I was wondering if there's a simple way to have one > instance of tomcat > run two different applications, each on the root of a > different port? Ie I'd > like to run a test application on 8080, and a development app > on 8081 or > some such, preferrably without two tomcat installs. Is there a howto > somebody could point me to, or is it a simple thing in > server.xml that could > be explained here?
Hi Josh, This comes with the disclaimer that I haven't actually tried to do this. Also, I'm assuming that you're using tomcat 4.1; I haven't actually gotten familiar with other versions. That said, though, I don't think it should be particularly difficult to set up a single tomcat serving different content to different ports. In server.xml you can create multiple <Service> elements, each of which configures one <Engine> component. Configure the <Engine> components to serve whatever applications you care to. Put <Connector> elements bound to different ports in the different <Service> elements. <Service> elements are nested within a <Server> element, of course. Sample excerpt from a server.xml file appears below; I'm sure you'll need to modify it to conform to what you're looking to do. Incidentally, all of this information can be found in the server configuration reference: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/index.html Apologies in advance for whatever bizarro formatting the mail server does to the following...and by the way, if this works out, please let us know. Cheers, bn ----------- <Service name="Tomcat-8080"> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8080" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false" /> <Engine name="Standalone-8080" defaultHost="localhost.localdomain" debug="0"> <Host name="localhost.localdomain" appBase="webapps-8080" unpackWARs="true" autoDeploy="true" </Engine> </Service> <Service name="Tomcat-8081"> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8081" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false" /> <Engine name="Standalone-8081" defaultHost="localhost.localdomain" debug="0"> <Host name="localhost.localdomain" appBase="webapps-8081" unpackWARs="true" autoDeploy="true" </Engine> </Service> -- To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>
