Building a JSP environment under Windows Server R2 (iv)-problems that may occur during testing

Source: Internet
Author: User

After the basic deployment of the environment, then began testing, must let him withstand the "test", he will be worthy of your trust. A successful authentication method for the Tomcat server deployment (in the case of the default port):

1, loacalhost:8080

2, 127.0.0.1:8080

3, Host ip:8080

Note: 360 The illusion that the browser gives is open every time, actually it has "memory" function, must refresh several times, the best use, Google or Firefox browser.


Here I share with you the problems that may arise in the course of testing

Test Failure 1:

After the project is published in Tomcat, the project cannot be accessed with the IP address and can be accessed successfully with localhost.

Publish a Web project in Tomcat, but after a successful release, you can only access the project with http://localhost:8080/** (project name), not
http://127.0.0.1:8080/** access to the project and cannot be accessed with a local IP address (HTTP://192.16/8.0.191:8080/FM)
Initially considered a firewall, but the firewall is closed, should not affect;
Later thought is win7 reason, that remote that has a remote access is not allowed, but the change has no effect;
Again later thought is the original tomcat6 time, did not appear this problem, so now think should be tomcat5 problem.
After searching from the internet, the reason should be the problem of Tomcat binding IP address, you can ping localhost to see which format IP is, the solution is as follows:
(The solution that can be used for reference)
1. Using the cmd command netstat-n, view the Tomcat address bindings, and find that it is bound to:: 1, IPv6.
2. Configure Tomcat's server.xml, change the connector configuration, the port does not change, plus address= "0.0.0.0" to bind it to IPV4, as follows
(Solutions for reference)
<1> Use the cmd command netstat-n, to view the Tomcat address bindings, found to be bound to:: 1, IPV6;
<2> Configure Tomcat's server.xml, change connector configuration, port without change, add address= "0.0.0.0", bind it to IPv4
<connector port= "8080" maxhttpheadersize= "8192" address= "0.0.0.0"
maxthreads= "minsparethreads=" maxsparethreads= "75"
Enablelookups= "false" redirectport= "8443" acceptcount= "100"
connectiontimeout= "20000" disableuploadtimeout= "true"/>
<3> restart Tomcat and use Netstat-n again to view the Tomcat address bindings, which have become IPv4.
This problem can be solved.
(This problem appears to be TOMCAT5.5)


Fault 2


Modify the firewall configuration of the Win7.

1. Start----Control Panel----system and security----Windows Firewall----Advanced Settings

2. Select "Inbound Rules"----Click "New rule"----"rule type" select "Port"----"next"----The rule applies, select "TCP"----"Specific local port" enter "8080" (the port used by Tomcat)----"Next"--- -Choose "Allow Connection", click "Next"----when to apply the rule, select all by default, click "Next"----a name for the rule, such as "Tomcat open 8080 port"----Click "Finish"

Now, Tomcat can go through the Windows Firewall.

3, modify the Tomcat configuration file, the Conf directory under the Tomcat installation directory, Tomcat6\conf\server.xml, in the settings port place, add address= "0.0.0.0", the result is as follows:

<connector port= "8080" protocol= "http/1.1"
maxthreads= "connectiontimeout=" 20000 "
Redirectport= "8443" address= "0.0.0.0"/>

The red part adds content.

Finally, restart the Tomcat service to use the IP address to access the Tomcat interface normally.

Building a JSP environment under Windows Server R2 (iv)-problems that may occur during testing

Related Article

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.