First of all, their code points, with Tomcat debugging, general access is: http://localhost:8080/webapp/main.jsp
To implement domain name (www.doubi.com) access, it takes several steps to ' stink ' ... Go ' main.jsp '--go ' webapp '--go ' 8080 ' and replace ' localhost '--finish!
1. Replace localhost and go 8080:
- Million or other places to apply for domain names, such as: www.doubi.com.
Baidu ' IP ', view their public network IP, here assume that their public IP: 110.110.110.110 (due to the operator, the private IP address will change)
Analytic diagram: Red partial fill 110.110.110.110
- Router port forwarding (assuming that the intranet IP is 192.168.31.241, just add 80 ports on it):
- Tomcat's server.xml configuration:
|
Add a host as follows
Now in theory, you can access Tomcat with a domain name.
2. Go to WebApp:
WebApp after compiling all the files and folders under the/usr/myapps/root, just like the Tomcat root project:
Then in Tomcat/conf/server.xml continue to modify the newly added host as follows:
3. Go to main.jsp: In the project's Web. xml
OK, now save each file!
Launch Tomcat, enter www.doubi.com to access the project ...
Publish project to Tomcat (Domain direct access)