Deploy the war package to the Tomcat root directory (the test is valid)

Deploying a war package in Tomcat is simple:
First, put the corresponding war package directly under $TOMCAT_HOME/webapps without creating a directory;
Then, modify $TOMCAT_HOME/conf/server.xml and add something similar to the following in the Host configuration section:
 
 
  1. <Context path="/" docBase="hdfs-webdav.war" debug="0" privileged="true" reloadable="true"/> 
Among them, the docBase parameter identifies the name of the war package.
When accessing, use the following address to access: http://ip:port/hdfs-webdav
 
If you want to deploy the war package to the Tomcat root directory and use http://ip:port to access it directly, the required operation is a little more complicated:
1. Unzip the war package and deploy it to a directory other than $TOMCAT_HOME/webapps
2. Delete all files in the $TOMCAT_HOME/webapps/ROOT directory
3. In the $TOMCAT_HOME/conf/Catalina/localhost directory, create a new ROOT.xml file and write something similar to the following:
 
 
  1. <?xml version='1.0' encoding='utf-8'?> 
  2. <Context path="/" docBase="/usr/local/tomcat-6.0/webdav" debug="0" privileged="true" reloadable="true"/> 
Among them, docBase points to the directory name after the war package is decompressed, and an absolute path is required.

  1. <?xml version='1.0' encoding='utf-8'?> 
  2. <Context path="" docBase="/usr/local/tomcat-6.0/webdav.war" debug="0" privileged="true" reloadable="true"/> 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325807934&siteId=291194637