Running Web Applications in IIS

Whether you built ASP.NET application or MVC application, you can run your application in IIS.
  • Pre-requisites:
    • Running IIS
    • Visual Studio
If you don’t know how to enable IIS then, here is the link: http://bit.ly/1lAWh7H

If you already have a web application running in Visual Studio Move to Step 2.
Step 1: Create Web Application
1) Create a Web Application -> ASP.NET web application or MVC application.
(Note if you already have created your Application then go to Step 2.)
2) Add new HTML Page and name it index
2) In index.html page enter just a few lines of code.
Below body tag write:
And then save.
Step 2: Go to IIS Manager (If you don’t know how to navigate to IIS then follow this link: http://bitly.com/1si7HC9)
– Under Sites Folder -> Add Website

 

Enter Site name, Select appropriate Physical path of the website, be careful in selecting the project folder, Enter Host Name (Host name will be the URL of which you will be able to access application).
Let’s Browse Website:
Now when you click Browse Website, you won’t be able to browse it, because you haven’t made the host entry. The system isn’t able to identify that yes it has to look in local IIS for the application you want to browse.
Step 3: Run Notepad application in Administrator Mode. Open the hosts file which is located at C:WindowsSystem32driversetc
Do below host entry –
127.0.0.1      aspapplication.com
Now Let’s Browse.
You will come up on following error:

This is because IIS does not have read permissions.
Step 4: Provide permissions to IIS
For giving permissions to IIS right click on your Website in IIS and then go to Edit Permissions. Then go to Security Tab, click on Edit, click on Add, click on Advanced, click on Find Now, and then select IUSR OK, Again click on Advanced select IIS_IUSRS and then OK, OK, OK.
Provide full control to both groups.
That’s it.!
You can now browse your application with URL: aspapplication.com
Feel free to fire queries.
Happy Coding..!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.