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
How to get the container startup command The cont...
This article takes the connection error ECONNREFU...
When we write CSS, we sometimes forget about the ...
JSONObject is just a data structure, which can be...
English: A link tag will automatically complete h...
Docker Toolbox is a solution for installing Docke...
This article shares the specific code of JavaScri...
Problem: The overflow of the auto-increment ID in...
Data URI Data URI is a scheme defined by RFC 2397...
Share a beautiful input box animation style libra...
The first step is to create a mysql container doc...
1. Install MySQL: Use the following three command...
Nowadays, whether you are working on software or w...
Eating well and getting enough rest sounds simple...
Table of contents 1. Resources and Construction 1...