Solved

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

Posted on 2004-04-19
6
1,176 Views
Last Modified: 2007-12-19
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
Comment
Question by:jangeador
  • 3
  • 2
6 Comments
 
LVL 16

Expert Comment

by:JamesDS
ID: 10866198
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
 
LVL 8

Accepted Solution

by:
qfren earned 125 total points
ID: 10866309
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
 
LVL 1

Author Comment

by:jangeador
ID: 10869697
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 16

Expert Comment

by:JamesDS
ID: 10869882
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
 
LVL 1

Author Comment

by:jangeador
ID: 10871242
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
 
LVL 16

Expert Comment

by:JamesDS
ID: 10872469
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now