Free Tomcat domain name bound to peanut shells

Source: Internet
Author: User

Tomcat bound Domain Name

At present, many companies' websites use Tomcat as the application service area, but for beginners, how is the port number 8080 removed? How are these websites bound with domain names? How does one Tomcat bind multiple domain names? And how do these domain names correspond to different projects? In addition, my servers are not in the data center and are stored locally. How can I map my servers to the Internet? Today, I will discuss this series of problems. 1. domain name. The current domain name is not very expensive, and many people have it, and our website that registers the domain name will also have a DNS to help resolve, that is, to bind the Server IP address to these domain names. 2. Now that our domain name is available, let's talk about our project. For example, I have two projects under my tomcat. Then we can enter http: // localhost: 8080/ABC to access our ABC project. But how can we remove port 8080? There is a server. xml file in the conf folder of Tomcat. Open this file and find 8080. You only need to change 8080 to 80. When we enter
Http: // localhost/ABC

You can. 3. How can we bind our domain name to a project? Find the server. XML in the conf folder under Tomcat again. Modify 4. When Tomcat is started, enter the bound domain name to see if our Tomcat is available. However, if we want to access our project, we have to add the project name after the domain name to access it. That is to say, our domain name has not been bound with the project. Let's take a look at the third part. We want to bind our project and domain name together, you only need to add <context docbase = "project name" Path = "" reloadable = "true"> before For example: 5. when we have two projects under the same tomcat, we only need to add 6. Apply for a free domain name from the peanut shell. If you want to register a domain name, you can buy one for free.
7. When our servers are maintained by ourselves (not in the data center), we need to map our routes. Take my path as an example. My route is TP-LINK wr340g model, after entering the routing, we can find a forwarding rule, there is a virtual server of this, click the new entry will be: service port number, IP address, protocol, status, common service port number. Here, we only need to set the IP address (the lan ip address of the server) and the Protocol to all (some routes do not seem to have this option, so we do not need to enter it). The status selection takes effect, select HTTP or web as the common service port number. The default port number is 80. When the common service port does not have HTTP or web, you can select DNS and manually change the port number to 80. Click to take effect. Save it. If the route ing I mentioned is not applicable to you or you do not understand it, you can find the ing methods of various routes on the Internet. 7. At this time, we are entering our domain name. Will it directly access our project. If you have any questions, please leave a message and I will reply in time. 8. record a small knowledge point: bind a single IP address to multiple virtual hosts

The file is c: \ windows \ system32 \ drivers \ etc \ hosts.

127.0.0.1 localhost
127.0.0.1 localhost1

Then configure the Tomcat virtual main sentence and it will be OK !!!!

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.