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