Change Tomcat port on-the-fly -


I want to store Tomkat v5.5 port in an environment variable and listen on port Tomket yet only The method I can see to change the port is amending $ CATALINA_HOME / conf / server.xml. Is there a way to set port prices by supplying external values ​​when starting towel? I'm running a tomack on Somers.

Tomk create a script to launch launch scripts, export JAVA_OPTS Tomcat property port. Http.nonssl (Note that you can call this property as you wish).

  JAVA_OPTS to assign a value to export = -Dport.http.nonssl = $ {CATALINA_BASE_PORT}  

As you can see, I set is port.http.nonssl to the variable <

some
  $ CATALINA_HOME / bin / startup.sh  
<: code> $ {CATALINA_BASE_PORT}

script changes introduced p> ​​now you have a non-SSL HTTP connector uses a rather> port.http.nonssl property $ CATALINA_HOME / conf / server.xml file is hardcode value.

  & lt ;! - Define a non-SSL HTTP / 1.1 connector at Port 8080 - & gt; & Lt; Connector port = "$ {port.http.nonssl}" maxHttpHeaderSize = "8192" maxThreads = "150" minSpareThreads = "25" maxSpareThreads = "75" enableLookups = "false" redirectPort = "8443" acceptCount = "100" ConnectionTimeout = Disable "20000" ================================================================================================================================================================ " 


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -