[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1216
  • Last Modified:

IIS problem: http://localhost works but http://servername does not.

Hello experts,

I have a problem with one of my servers. When I try to access the IIS by typing "http://servername" or "http://IP Address" I get a 403 error, and when I try to access using "http://localhost" it works fine. The server was previously working like a charm. I have a third party app running on a virtual directory and when I try to access that from the outside I get a 404 error.

I have tried all the tricks I know but no luck... Please help!

jangeador
0
jangeador
Asked:
jangeador
  • 3
  • 2
1 Solution
 
JamesDSCommented:
jangeador
It sounds like your problem is host headers.

When you only have one site on a server typing "http://servername" or "http://IP Address" should get you the one site. When you have more than one site it doesn't know where to send you so you get the error.

Try adding a host header entry into your site in the porpoerties dilog of the site.

Cheers

JamesDS
0
 
qfrenCommented:
Hi:

i am not sure but try..

go to Start->Search
Type " hosts"...

u will find a file call "hosts" which when u double click and use notepage to read:
The file is similiar look like below:



=======

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost


==========


NOTE: u have to BACKUP this file first ....
then
add a line below 127.0.0.1 localhost as following...

127.0.0.1       localhost
127.0.0.1       servername

then save,(not sure if it need to restart)and try .....


mc
0
 
jangeadorAuthor Commented:
OK, guys thank you for your quick responses. I found the problem.

Apparently, someone else created a second site on the server, and this site was taking over the default. I stopped the other site, and now things are running good!

I will split the points for I see that both of you offered the same solution.

Thanks.

jangeador
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
JamesDSCommented:
jangeador
Host headers is not the same as hosts file

Host headers is configured at the IIS manager
Hosts file is a text file completely unrelated to IIS and stored in ..\system32\drivers\etc

You should not confuse the two as others using this question for reference later will not get the correct answer.

Regardless of this you did not split the points as stated.

Cheers

JamesDS
0
 
jangeadorAuthor Commented:
I apologize if I did not split the points, this new interface is very new to me, and I am not sure how to do stuff quite as well as with the old interface. The answers provided were not the solution to my problem, I awarded the points in the interest of keeping EE as clean as possible. If you know a way for me to change the answer and to split the points please let me know.

And again thanks for clarifying the difference between the answers.

jangeador
0
 
JamesDSCommented:
jangeador
No problem you can do this in community support - just post a new question requesting help to change the points and a link to this one.

As you to your problem - Host headers IS the solution. Without a host header a server running more than one website wll not which site to send the requests to. What you did was stop the second site which took away the need for a host header for each site.

Cheers

JamesDS
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now