Make Tomcat available for extranet access

Source: Internet
Author: User

Using the tomcat+ peanut shell to deploy a javaweb website, the steps are divided into three stages.
First, peanut shell configuration.
Download the peanut shell and install it by default. Apply for dynamic domain name, activate Passport, login. (All normal operation, needless to say)
Second, tomcat settings.
Locate the Server.xml under the Tomcat root directory and open it with Notepad.

XML code
  1. <Service name="Catalina">
  2. <Connector port= "protocol=" > "http/1.1 "
  3. connectiontimeout="20000"
  4. redirectport="8443" />
  5. <Connector port="protocol=" ajp/1.3 " redirectport=" 8443 "/>"
  6. <Engine name= "Catalina" defaulthost= "domain name">
  7. <Realm classname="Org.apache.catalina.realm.LockOutRealm">
  8. <Realm classname="Org.apache.catalina.realm.UserDatabaseRealm" >
  9. Resourcename="userdatabase"/>
  10. </Realm>
  11. <Host name="domain name" appbase= "Project location" >
  12. unpackwars="true" autodeploy="true">
  13. <Valve classname= "org.apache.catalina.valves.AccessLogValve" directory= "logs " >
  14. prefix="Localhost_access_log." suffix=". txt"
  15. pattern="%h%l%u%t"%r "%s%b" />
  16. </Host>
  17. </Engine>
  18. </Service>
  19. </Server></server>

HTML code
    1. A. The Prot property of the first connector node is changed to the default port of the 80,http protocol, which is also 80, so that you do not have to write 8080 or more port numbers behind the domain name.
    2. B. The prot of the second connector node is also changed to 80.
    3. C. Modify the engine node anddefaulthost= "domain name to set".
    4. D. Modify the host node,name= the "domain name" appbase= "project placed directory".


Third, the router configuration
Because the site is in the intranet, to allow external personnel to access the site through a dynamic domain name, must be set up on the router, when the external personnel access to the external network host to map it to the intranet host. Router manufacturers, models, port mapping settings are different, here Tp-link Router R860 router as an example.
Enter the http://192.168.1.1 login router in the browser, the default user name and password is admin. Click "Forward rule" to "Virtual Server" and click "Add New Item" in the Virtual server window. The service port number is the port number that your website uses, the IP address is the IP address of your intranet host, the protocol chooses TCP, usually the service port number chooses HTTP, click Save. Click "Dynamic DNS", in the Dynamic DNS settings panel, enter the peanut shell user name and password, the user and password for the login peanut shell use the user name and password, tick "Enable DDNS", click "Login", click "Save" after successful login. At this point, all configurations and operations have been completed.
You can access it by entering http://Your own full dynamic domain/website in the browser.

Make Tomcat available for extranet access

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.