Tomcat Server Common Configuration

Source: Internet
Author: User

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

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.