Configure Web Apps

Source: Internet
Author: User

Web application Configuration Virtual Host
Virtual path mapping for 1.web applications, which is the real path for Web applications configure a virtual path

In the Server.xml <Host> tab of the Conf directory, configure <Context> tag, you can configure a Web app for this virtual host
Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >
<context Path = virtual path docbase= true path/>
</Host>

True path: Is the true path of file storage D:\news
Virtual path: Is the path to the browser knocking/news
Access method: http://localhost:8080/news/1.html
Configure the default Web app to set path to NULL
<context path = "" Docbase= Real paths/>

Cons: After the modification, all need to reboot, not recommended

2. In tomcat/conf/[engin]/[host]/in this directory to write an XML file, this XML name is the virtual path, the XML CAS configuration <Context> tag, which configures the real path

File name Tomcat6\conf\catalina\localhost\new2.xml
<?xml version= "1.0" encoding= "Utf-8"?>
<context docbase= "D:\news"/>

Pros: No need to restart Tomcat
Cons: If the virtual path is multilevel, the file name should be modified to Xxx#xxx#xxx.xml
As long as the file name is modified to root.xml this web app becomes the default Web App


3. Put the Web application directly into the directory managed by the virtual host, the virtual host can find
Just copy the news directory to the WebApp directory and it's OK.

Change the Web App folder name to root, the Web app is the default Web App

Configure Web Apps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.