1/need to run in Java environment, install configuration JDK
environment variable Settings--
1) path pointing to Jdk/bin
2) Classpath point to the package you need (basic configuration Jdk/lib/dt.jar;jdk/lib/tools.jar;)
3) java-version in cmd, display Java version is configured correctly
2/install Tomcat
3/Verification Installation
Enter localhost:8080 under Browser, the Welcome page appears successfully.
4/demand? Configure your favorite URLs
We enter myweb:8080/h/abc.html in the browser to display the contents of the file D:\mywebcode\HelloWorld\abc.html
5/With Virtual host virtual directory
Suppose you want to match the host called MyWeb, the location where you store the code is D:\mywebcode, you use the operating system is windows.
1) First configure 127.0.0.1 MyWeb in C:\Windows\System32\drivers\etc\hosts
Why do you do this?
Because the host is the equivalent of the domain name in the browser, the browser resolves the domain name in the native Hosts file first, it will be found in the DNS server.
Obviously there is not a domain name in the DNS server corresponding to our current host IP, our tomcat in this machine is equipped with 127.0.0.1 MyWeb
2) Open the Tomcat\conf\server.xml file in the label service to configure the host .<service> host </sevice>
The host code is as follows:
<!--virtual Directory--
<context path="h" docbase= "\helloworld"/>
Tomcat Server Common Configuration