Server context, virtual host configuration

Source: Internet
Author: User

Server Configuration Context
1. defined in Server.xml under Server conf, Path= "" represents the default
2. defined in Context.xml under Server conf
3. Under Catalina under localhost under Server conf, create a new. xml file, which is configured inside
If the file format is a#b#c.xml for hierarchical access a/b/c, if you want to make the path default, enter the file you want to access directly (the file name ancestor directory is the host and port number), Change the newly created. xml to Root.xml, but do not restart the server except Root.xml, modify Server.xml must be restarted
Configuration Format <context [path= "/BJ"] docbase= "E:\news"/>


Different file placement locations within the Web application
News (Web application catalog)
|
|--html, JSP, CSS, JS files
|
|
|--web-inf
|
|--classes directory (Java Class)
|
|--lib directory (Java class runs the required jar package)
|
|--web.xml file (web App configuration file)


With a virtual host (access to its own host via a domain name)
Add a <Host> tag inside the 1.server.xml, as follows:
<context path= "/news" docbase= "E:\sina\news"/>
</Host>
2. Add elements to the hosts file in the native host C:\Windows\System32\drivers\etc directory, such as:
192.16.149.98 www.sina.com (refers to 192.16.149.98 host when input www.sina.com)

Server context, virtual host configuration

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.