• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

http://localhost:8080 not working but http://127.0.0.1 is working

 
Panduranga H G
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I ma working in windows, I am getting this error with tomcat can any one help me Please.

http://localhost:8080 not working but http://127.0.0.1 is working
 
Anirvan Majumdar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is http://127.0.0.1:8080 working?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please verify below:

1.what is the tomcat port number?

2. are you using mozilla browser?
 
Jair Rillo Junior
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chec it out the port number.

localhost:8080 is different than 127.0.0.1 (the second address has not the port number, hence, by default it uses port 80). Try out also: http://localhost
 
netto gaurav
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jair Rillo Junior wrote:Chec it out the port number.

localhost:8080 is different than 127.0.0.1 (the second address has not the port number, hence, by default it uses port 80). Try out also: http://localhost



Hi,
I'm facing the same problem in my case neither http://localhost nor http://locahost:8080/ nor http://127.0.0.1 work but the moment I do http://127.0.0.1:8080 i'm able to see the docs, examples pages from the webapps folder.
I have tomcat 7 on windows 7. Earlier it was working now everything has stopped working...does any body have a clue?
my server.xml(snippet) is as below -

<Service name="Catalina">


<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


<Engine name="Catalina" defaultHost="localhost">

<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">


Also, i'm not getting any error in the logs...Please let em know if anybody has an idea as to what could be causing this wierd behaviour...
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few helpful hints on JavaRanch etiquette: We prefer that you would start a new message thread instead of reviving one that hasn't been used in several years. It's less confusing.

Also, there's a "Code" button on the message editor. You can use it to generate tags to wrap code, XML, and other pre-formatted text and make it easier to read.

To understand your problem, you have to understand URLs and hostname resolution. Every web request has to be sent to a TCP/IP port that's listening for data in the format that the client is using. For HTTP requests, by default, that's port 80 and for HTTPS requests, it's port 443.

Tomcat isn't normally set up to use port 80, since port numbers less than 4096 are privileged and require Tomcat to be privileged as well in order to use them and that's a security risk. When a URL is parsed and used to target a webserver, the port selection is not available from the hostname resolution mechanism - it ONLY resolves host addresses. So if you don't want the default port (80), you have to explicitly provide a port ID (8080).

That's part of your problem. The second part has to do with hostname resolution. TCP/IP systems support a number of different ways to convert a domain name such as "www.coderanch.com" to the IP address that gets the request; it's a very flexible system. One of the more popular ways involves 2 primary resolvers: DNS services and a hostnames file.

DNS services refers to a resolver that queries one or more Domain Name Servers which have been defined for the local machine's network configuration. The machine sends out a query to the DNS server on UDP port 53 and gets back a response consisting of the corresponding IP address.

Certain domains, however, are best served by a more immediate mechanism. An example are the critical hosts that a machine may need services from even when the DNS system is down. However, and even more important one is the hostname "localhost" and its related fully-qualified domain name "localhost.localdomain". These hostnames are almost always expected to resolve to 127.0.0.1, so they are hard-coded into a local hostnames file. This file is usually named "hostnames" or "HOSTS", but Windows has been known to use LMHOSTS. So when you cannot get "localhost" to resolve to 127.0.0.1, you need to find out the name and location of your local system's host names file and check it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic