I had a classic ASP webapp running on a virtual system and I could access it using http://localhost/webapp/ or http://127.0.0.1/webapp URLs. No problem, until I made the following changes:
- Added the virtual system to our domain to be able to access some apps
- Moved the virtual system files to an external HDD
And if I tried to access the app using http://127.0.0.1/webapp, I get a "Access Denied" error message as shown below:
I am not sure which one of these is caused this issue or if the above changes are even the culprits.
I tried the usual stuff (not necessarily in the order listed below) like the following:
- Checked my C:\WINDOWS\SYSTEM32\drivers\etc\hosts file and made sure local loop back address is mapped to localhost.
- Pinged the localhost to make sure it is getting resolved correctly.
- Checked the IIS configuration to make sure the "IP Address" is set to "All Unassigned" in the "Web Site" tab:
- I have checked the permissions on the folder mapped to the Home Directory.
- I have un-installed and re-installed IIS.
- Followed the steps given in the Microsoft KB Article ID: 271071 (How to set required NTFS permissions and user rights for an IIS 5.0 Web server). CAUTION: This process took a long time to complete.
After trying few other things that I could not quite recall all the details, I wondered if I should access the webapp using the hostname, i.e. http://myhost/webapp and bingo! it worked. I am still not sure why hostname works and the other two don't. I searched using Google and I did not find any similar issues, so I do not know what is causing it.
I gave up for the day and decided to leave it like that. The next day, I wanted to give it another try since it was really bothering me.
I decided to use the telnet command to fetch the starting page using all three URLs and lo and behold all of them retrieved the right content. So, there is nothing in the IIS that is causing this, so some setting in Internet Explorer (IE) must be causing it. I tweaked a few settings in IE and they did not fix the problem. Then I found the reset all button.
I reset all the IE settings and restarted IE and now I could access my app using all three URLs.
So, I still do not know what caused this strange issue, but am happy that it is fixed now. I guess, if it happens again I know what to try and where to look.
Hope you find this useful.