Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can only access asp.net app on localhost

Tags:

asp.net

iis

I'm trying to get an asp.net application up on IIS on a Windows Server 2008 machine. I can hit the app from localhost, no problem. But I can't access the app using the server's domain name either locally or from another machine on the network.

But here's the odd part. I can access a normal file on IIS using the domain name, both from a browser running on the server and from a browser running on another machine on the network. Here's a synopsis ("http" converted to "htp" below because I don't have enough points to have all these links in my message):

From IE on the server itself:
works htp://localhost/foo.htm
works htp://localhost/App
works htp://test.foo.com/foo.htm
dead htp://test.foo.com/App

From IE on another machine:
works htp://test.foo.com/foo.htm
dead htp://test.foo.com/App

And when I say "dead" I mean the request times out.

Any ideas?

like image 470
Kevin Donn Avatar asked Feb 11 '11 22:02

Kevin Donn


2 Answers

I worked this out. Basically the app was redirecting to https, but only for remote connections, and IIS was not bound to 443.

like image 54
Kevin Donn Avatar answered Nov 09 '22 07:11

Kevin Donn


Let's say your server's domain name is myServer and its IP is 192.168.2.1.

Try ping-ing the server from another machine by its domain name. In a DOS prompt type:

ping myServer

Do you get a response?

Try accessing the site on the server using the server's IP address:

http://192.168.2.1/foo.htm

If its visible by IP but not pingable by name then your issue is related to DNS. You need to

  • set up IIS so the site is bound to the host name (Host Name via the Edit Bindings ... option for the site in IIS Manager).
  • if you have a DNS server you need to get an admin to put entries in its lookup db for the server.
  • if you don't, put an entry in your hosts file for the server.

HTH

like image 1
indra Avatar answered Nov 09 '22 07:11

indra