Listed below are the steps to deploy a web app in IIS.
- Click start. Click Run.
- Type inetmgr in the Run dialog Box.
- Expand the localComputer. Right Click on the Sites. Click Add New Site as shown below:
- Type the name of the web site. In my case, it is "
MyWebSite". Type the location of the web application or site. Give a port number (You have to manually add this port number to inbound rules of Windows Firewall later). And then press OK.
If a connection with that port number already exists, then give another port number.
- Right click on the site name ("
MyWebSite" in my case), click on "Manage Web Site" and "Browse".
- In the sub directories of the web site, if any web.config files are present, remove the tags with names authorization, roleprovider, profile, members. As this may cause the error as shown below:
- Change the Framework of the application pool to v4.0:
Change the "
CodeBehind" in the aspx file to "
Change the URLs to the appropriate directory. (Since ~ means root directory, it has a different meaning when executed in Visual Studio when compared to IIS.)
- All the above steps make the site work from the same computer in which IIS is installed. If you go to another computer and type the IP address of the system (in which IIS is installed), then you may not be able to access the website. For this, you have to configure the port in the Windows Firewall.
- Open the Windows Firewall from control panel as "Control Panel\All Control Panel Items\Windows Firewall". Click "Advanced Settings".
Right click on InBound Rules as shown below. And fill the details as necessary.
That's it! You can access the web site (hosted with IIS) from within the LAN by just typing the IP address of the system on which IIS is installed as:
http://IPAddress:Portnumber e.g.:- http://192.168.1.1:90