Configure external applications
External applications are not put into Tomcat's wabapps directory! Just put it outside, for example: F:/hello
1. Configure under conf/server.xml to specify the path of the external application.
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="xsy_hello" docBase="F:/hello"/>
</Host>
* in the <Host> element Add the <Context> element below, path is the URL access path, and docBase is the directory of the external application.
* Access in the browser address bar: http://localhost:8080/xsy_hello/index.html
2. Add a configuration file under conf/catalana/localhost and specify the external application path
* Create xsy_hello under the conf/catalana/localhost directory .xml file, where xsy_hello is the URL access path
* Add in the xsy_hello.xml file: <Context docBase="F:/hello"/>, docBase specifies the directory of the external application.
3.
* If the inside of the web application is placed under webapps/ROOT, the application name does not need to be given in the access URL path.
4. Configure the virtual host
wish: http://www.xsycn to access the web application.
* This needs to map the domain name http://www.xsy.cn to the IP address: 127.0.0.1
* The tomcat port number needs to be changed to 80
* The host needs to be configured in server.xml and the application directory of the host is specified
* In the application Add a web application named ROOT to the directory.
1). Find the C:\WINDOWS\system32\drivers\etc\hosts file, add 127.0.0.1 http://www.xsy.cn
2). Modify the port to 80 in conf/server.xml
3). In conf Add the <Host> element in
/server.xml <Host name="www.xsy.cn" appBase="F:/myapps" unpackWARs="true" autoDeploy="true">
</Host>
* name: specify the host The domain name is www.xsy.cn
* appBase: Specify the application directory of the host as F:/myapps
4). Create a web application named ROOT under F:/myapps.
Visit: http://www.xsy.cn/index.html
where www.xsy.cn will be parsed as 127.0.0 on this machine.
Tomcat: Configuring External Applications
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325210899&siteId=291194637
Ranking