Web Development - 127.0.0.1 works but localhost doesn't
Summary: I ran into an issue recently when I was setting up a new computer as a development system. I was using Netbeans as my IDE. In order to develop and test JSP applications, I needed to install Tomcat. Once I had everything installed and configured, I built and ran an application that I knew worked because it was running fine on a different computer. Same configuration, same source code but was unable to run it on the new computer. The issue was that I was receiving an HTTP 500 - Internal Server Error when attempting to access any web pages on the computer using http://localhost as the URL
Resolution: After comparing all of the configuration options on the computer that worked with the one that didn't, I noticed that the only difference was that the new computer's browser was configured to use a proxy server. When I removed the proxy configuration from the browser settings, I was then able to access all locally hosted applications using the http://localhost/ URL as well as the http://127.0.0.1/ URL. Who knows why....
2 Comments:
It seems this issue may be related to the problem I described in the following post http://janeataylor.blogspot.com/2007/01/unable-to-open-admin-page-for-local.html
The loopback adapter provides a static IP address and "fakes" the location of the application/URL.
I wonder if the proxy was causing localhost to be resolved in a strange way. Anyway, I might have tried using nslookup or some equivalent to see how "localhost" and also 127.0.0.1 resolve.
Post a Comment
Subscribe to Post Comments [Atom]
<< Home