Add a website to local IIS7 and browse to it with friendly name
Written by stevey on October 2nd, 2012
- Launched IIS7 -> Sites -> Add Web Site
- Entered yangsoft.com; left application pool with default name
- Mapped to physical path H:\Development\yangsoft.com\Yangsoft.Web
- Pick a unassigned port: 8092
- Host name: yangsoft.com (hopefully, this will precede the real domain name, once the entry is made into hosts file)
- After exiting IIS7, browsed to C:\Windows\System32\drivers\etc and opened the hosts file with notepad
- Added this entry: 127.0.0.1 yangsoft.com and saved.
- Browsed to http://localhost:8092 but get a bad request error 400: invalid hostname
- Returned to IIS7 and changed App Pool Identity “yangsoft.com” to use .net 4.0 and Integrated Mode. By default, whenever a website was first setup, it uses .net v 2.0
- Now go to browser and type in :yangsoft.com:8092 and it brought up the local site that is in development folder, not in the deployed folder.
- In order to launch the website from VS 2010 IDE in the same fashion, I went into VS2010 web project properties and changed the Servers setting from “Use Visual Studio Development Server” to “Use Local ISI Web server” and pasted in the url: yangsoft.com:8092
- Ran the project in debug mode and now the website rendered as http://yangsoft.com:8092/Default.aspx instead of the http://localhost:2236/Default.aspx or whatever random port number the IDE picks for you.
Posted in .Net Framework, ASP.Net, IIS7, Web Development |
Tags: local IIS server