IIS 5 & IIS 6
How to map localhost (port 80) to local IP and for outside access?
Last post Mar 31, 2011 07:53 AM by Southbranch
Mar 30, 2011 02:04 PM|Southbranch|LINK
I am using W7 and VS 2010 for a web project and when i hit F5 the project starts in debug mode and
http://localhost (using port 80) appears in the bowser's url.
In my router I have made forward/open for external access to port 80 mapped to my PC's local IP which is 192.168.1.2. Now, I have tried to disable both the router's firewall + Window's firewall.But all attempts to access my web project (debug purpose) from
the outside completely fails...
The router uses an dynamic assigned IP address
Also the file: C:\Windows\System32\drivers\etc\hosts it says:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
What can I do to solve this problem? Do I need to do anything in the IIS?
I don't think there is anything wrong with the router since I am runing other softwares that opens/uses various ports like e.g Skype etc.
Mar 30, 2011 02:11 PM|KristoferG|LINK
How do you access the website from the outside (what URL, localhost will not work, that references the local computer you are using)?
What is the issue? You cannot connect? You get an error message from IIS? Something else?
If you cannot establish a connection, your ISP may block port 80. Some of them do this. Either talk to your ISP, or try to run it on a different port (works sometimes, depends on how your ISP has this set up).
Mar 30, 2011 03:58 PM|Southbranch|LINK
Thanks for a quick reply.
Yes, you are right, some ISPs do block certain ports (e.g 80) but I have tried various random ports and nothing works. And also my ISP claims they don't.
Whan trying to access from outside I use (example IP) e.g.
http://22.214.171.124:80 (or other various ports)
But since the 'localhost' apparently is mapped to 127.0.0.1 (as above) I realize it won't work until the mapping localhost -> 192.168.1.2. But FIRST I need to get a port that works from outside....
Mar 30, 2011 04:22 PM|KristoferG|LINK
Hmm, i thought you used IIS, but my understanding now is that you use the web server in Visual Studio (Cassini). Is this correct?
I remember there were a few limitation of the web server in prior Visual Studio versions, one of them was that it would not accept remote request (that is, you can only access it on the machine itself).
I do however not know if this is also true for VS 2010.
If you are using the web server in VS 2010, you may want to check if it is possible to access it remotely, with a question in the VS forum:
They should know the limitations better.
Mar 30, 2011 08:44 PM|Southbranch|LINK
But, I think the problem is two fold:
1) Must be able to get a port open (e.g. 80) externally and mapped correctly to my local PC's local IP 192.168.1.2.
2) Get the VS2010 web server to map localhost to this port. It seems it only maps to 127.0.0.1 (by default) and I have no idea on how to change this to my local IP.
Right now I am stuck on both issues.
Mar 31, 2011 05:42 AM|KristoferG|LINK
The server you mention may not identify that port 80 is open, if nothing is listening and responding on that port. It depends how it performs the port scan.
I think the big issue is 2), and at this moment we should focus on that. Try the other forum and see if they have any idea. Once you get this working, we can continue to help you if you need more help.
Mar 31, 2011 07:53 AM|Southbranch|LINK
Thanks, will do