1 Background JDK1.8-u181 and Tomcat8.5.53 were installed. After installation, JAVA_HOME and Path are configured in the environment variables. It is equipped with JRE, not JDK. Two war packages need to be released, MES and ERP. 2 Install Tomcat I used the .exe file to install it, and after installation I did not configure tomvat_home (because I don't know if it needs to be configured) 3 Copy folder 3.1 Installation DirectoryconfCatalina Catalina is a folder. Copy Catalina into two folders, one named CatalinaMES and the other named CatalinaERP. Put them both in the installation directory\conf directory. 3.2 Installation Directory webapps webapps is also a folder. Make two copies, one named webappsMES and the other named webappsERP, and place them both in the installation directory. The war package of the MES project is placed in the installation directory\webappsMES The war package of the ERP project is placed in the installation directory\webappsERP 4 Modify the configuration file Modify the content in the installation directory\conf\server.xml <?xml version="1.0" encoding="UTF-8"?> <Server port="-1" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <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> <!-- Deploy mes --> <Service name="CatalinaMES"> <Connector port="8085" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Engine name="CatalinaMES" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webappsMES" unpackWARs="true" autoDeploy="true"> <Context path="/mes-manager-web" docBase="C:\Program Files\Tomcat 8.5\webappsMES\mes-manager-web" debug="0" privileged="true"></Context> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> <!-- Deploy erp --> <Service name="CatalinaERP"> <Connector port="8082" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Engine name="CatalinaERP" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webappsERP" unpackWARs="true" autoDeploy="true"> <Context path="/erp-manager-web" docBase="C:\Program Files\Tomcat 8.5\webappsERP\erp-manager-web" debug="0" privileged="true"></Context> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> </Server> Among them, a <service> node represents a service, that is, a deployed project. The name attribute of the <service> node is changed to the name of the corresponding Catalina folder. The name attribute of the <Engine> node is also changed to the name of the corresponding Catalina folder. The port attribute of the <Connector> node is the port number of the project. Just be careful not to conflict with it. The appBase property of the <Host> node is changed to the corresponding webapps folder. The path attribute of the <Context> node is the address used for access, that is, the access address of the project is 5 Modify startup.bat and shutdown.bat Edit the installation directory\bin\startup.bat and add the following at the beginning: SET JAVA_HOME=C:\Program Files\Java\jre1.8.0_181 SET TOMCAT_HOME=C:\Program Files\Tomcat 8.5 The first is the installation location of JRE, and the second is the installation path of tomcat. Add the same content to the same location in shutdown.bat. 6 Double-click startup.bat to run tomcat Note that a DOS window will be opened at this time, which will print the project startup information like the IDEA console. When the project is successfully started, do not close this DOS window, keep it open, if you turn off Tomcat, it will stop running. 7 Notes If multiple projects use the Spring framework, an error may occur when configuring a tomcat with multiple ports and multiple applications. Solution: Add the following node to each project's web.xml: <context-param> <param-name>webAppRootKey</param-name> <param-value>webapp.root</param-value> </context-param> Ensure that the <param-name> of each project's web.xml is different from the <param-value> corresponding to webAppRootKey. For example, the first one uses webapp.root1, the second one uses webapp.root2, and so on. In addition, please pay attention to whether the server's firewall allows external access to the port you want to configure. This is the end of this article about the steps to deploy multiple war packages with Tomcat. For more information about deploying multiple war packages with Tomcat, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Implementation of vue3.0+vant3.0 rapid project construction
>>: Detailed Analysis of or, in, union and Index Optimization in MySQL
Find the problem Recently, I found a problem at w...
1. Time difference functions (TIMESTAMPDIFF, DATE...
Table of contents 1. for loop: basic and simple 2...
1. Avoid declaring the page as XML type . The pag...
An optimization solution when a single MYSQL serv...
<br />Semanticization cannot be explained in...
1. What is Docker? Everyone knows about virtual m...
Grid layout Attributes added to the parent elemen...
1. Preparation 1.1 harbor download harbor downloa...
1. What problems did we encounter? In standard SQ...
1. Nginx service foundation Nginx (engine x) is d...
How to create a service and auto-start it in Ubun...
1. Install MySQL This article is installed via AP...
Table of contents text LOCK parameter ALGORITHM p...
Check whether your cuda is installed Type in the ...