我正在部署一个新的Web应用程序,使其与已经在tomcat 8.5上运行的旧版应用程序在同一服务器上运行。这个想法是让这两个应用程序在tomcat的同一端口上运行,并可以通过不同的上下文(即http://localhost:8080/oldapp和http://localhost:8080/newapp
)进行访问旧的应用程序当前在server.xml中有其上下文设置(我知道这是不可取的,但是那是原始开发人员设置它的方式,我现在不想触摸它)
<Service name="Catalina">
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false" deployOnStartup="false"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/oldApp" reloadable="true" docBase="applicationName"/>
</Host>
</Engine>
</Service>
我尝试在catalina.home / conf / Catalina / localhost / newApp.xml中设置新上下文
<!-- Context configuration file for my web application -->
<Context docBase="newApp" path="/newApp" reloadable="true">
</Context>
将newApp.war放置在catalina.home / newApp / newApp.war
但是,当我启动tomcat时,将完全忽略newApp。谁能建议我需要做些什么才能让tomcat部署新应用程序?
****编辑**
文件夹结构:
webapps:
total 98188
-rw-r--r-- 1 tomcat users 58196119 Feb 15 2018 oldApp.war
-rw-r--r-- 1 tomcat users 42226180 Sep 3 15:52 newApp.war
drwxr-xr-x 7 tomcat users 4096 Sep 4 16:16 oldApp
conf/Catalina/localhost:
total 12
-rw-r--r-- 1 tomcat users 1303 Mar 18 2013 manager.xml
-rw-r--r-- 1 tomcat users 1148 Mar 18 2013 host-manager.xml
-rw-r--r-- 1 tomcat users 730 Sep 4 15:58 newApp.xml
webapps/oldApp/
total 40
-rw-r--r-- 1 tomcat users 894 Jan 29 2018 favicon.ico
-rw-r--r-- 1 tomcat users 1879 Jan 29 2018 style.css
-rw-r--r-- 1 tomcat users 2535 Jan 29 2018 index.html
drwxr-xr-x 5 tomcat users 4096 Sep 4 16:16 WEB-INF
drwxr-xr-x 4 tomcat users 4096 Sep 4 16:16 applicationName
drwxr-xr-x 3 tomcat users 4096 Sep 4 16:16 META-INF
drwxr-xr-x 2 tomcat users 4096 Sep 4 16:16 media
drwxr-xr-x 2 tomcat users 12288 Sep 4 16:16 images