Multiple project deployments with the same port number
Add:
By visiting: http://127.0.0.1:8080/route http://127.0.0.1:8080/route2 Items corresponding to each child
- <Context path="/route" reloadable="true" docBase="/home/develop/tomcat-7.0.54/flatrass"/>
- <Context path="/route2" reloadable="true" docBase="/home/develop/tomcat-7.0.54/flatrasweats"/>
Multiple project deployments for different port numbers
By visiting: http://127.0.0.1:8080/route http://127.0.0.1:8081/route Items for each child
Open conf folderServer.xmlFile, add
- <Context path="/route" reloadable="true" docBase="/home/develop/tomcat-7.0.54/flatrass"/>
Put a service label under the service label.Copy the service above and modify the port number inside to 8081.Add to:
- <Context path="/route" reloadable="true" docBase="/home/develop/tomcat-7.0.54/flatrasweats"/>
- <?xml version='1.0' encoding='utf-8'?>
- <Server port="8054" shutdown="SHUTDOWN">
- <!-- Security listener. Documentation at /docs/config/listeners.html <Listener
- className="org.apache.catalina.security.SecurityListener" /> -->
- <!--APR library loader. Documentation at /docs/apr.html -->
- <Listener className="org.apache.catalina.core.AprLifecycleListener"
- SSLEngine="on" />
- <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
- <Listener className="org.apache.catalina.core.JasperListener" />
- <!-- Prevent memory leaks due to use of particular java/javax APIs -->
- <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
- <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
- <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
- <GlobalNamingResources>
- <Resource name="UserDatabase" auth="Container"
- type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved"
- factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
- pathname="conf/tomcat-users.xml" />
- </GlobalNamingResources>
- <Service name="Catalina">
- <!--protocol Please use nio2,perhaps apr -->
- <Connector port="8080" protocol="HTTP/1.1"
- connectionTimeout="20000" redirectPort="9543" />
- <Connector port="8909" protocol="AJP/1.3" redirectPort="9543" />
- <Engine name="Catalina" defaultHost="localhost">
- <Realm className="org.apache.catalina.realm.LockOutRealm">
- <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
- resourceName="UserDatabase" />
- </Realm>
- <Host name="localhost" appBase="webapps" unpackWARs="true"
- autoDeploy="true">
- <Valve className="org.apache.catalina.valves.AccessLogValve"
- directory="logs" prefix="localhost_access_log." suffix=".txt"
- pattern="%h %l %u %t "%r" %s %b"/>
- <Context path="/route" reloadable="true"
- docBase="/home/develop/tomcat-7.0.54/flatrass" />
- </Host>
- </Engine>
- </Service>
- <Service name="Catalina">
- <!--hold port Change to 8081 -->
- <!--protocol Please use nio2,perhaps apr -->
- <Connector port="8081" protocol="HTTP/1.1"
- connectionTimeout="20000" redirectPort="9543" />
- <Connector port="8909" protocol="AJP/1.3" redirectPort="9543" />
- <Engine name="Catalina" defaultHost="localhost">
- <Realm className="org.apache.catalina.realm.LockOutRealm">
- <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
- resourceName="UserDatabase" />
- </Realm>
- <Host name="localhost" appBase="webapps" unpackWARs="true"
- autoDeploy="true">
- <Valve className="org.apache.catalina.valves.AccessLogValve"
- directory="logs" prefix="localhost_access_log." suffix=".txt"
- pattern="%h %l %u %t "%r" %s %b"/>
- <Context path="/route" reloadable="true"
- docBase="/home/develop/tomcat-7.0.54/flatrasweats" />
- </Host>
- </Engine>
- </Service>
- </Server>
java home set :
setclasspath.sh
export JAVA_HOME=/home/qatest/jdk1.8.0_91export JRE_HOME=/home/qatest/jdk1.8.0_91/jre
Web.xmlThe loading process is:
context-param -> listener -> filter -> servlet
Other:
service httpd status service httpd restart lsof -i:80 chmod +x catalina.sh ps –ef|grep tomcat rm –rf file
Start tomcat #. /startup.sh
Close tomcat #. /shutdown.sh
To see if the startup was successful, type ps axuwf|grep java.
If a lot of results occur, the boot is successful. You can also netstat-lnpt to see if port 8088 is in use. If used, the boot is successful.