To day I will Show you How to Host Asp.net web site Locally with Custom URL on local Machine.
In previous article I already explained you how to Purplish and Deploy Asp.net Web or web service and How to Configure IIS Server on windows Xp and Windows 7.
So I Recommend you If you to first study that tutorial before starting this one .
After reading this Article we will be able to
setup a new site in IIS with Custom URL like
(http://www.visualstudiolearn.com/) in local system which is not under any Default Website.
Before setting up a new site in IIS let us first create one sample application in asp.net or Simple Web service in ASP.net using visual studio . Once new application is ready, next Open Run command and type "inetmgr" . Click the enter button ! IIS will open if it does not than that indicates that IIS is not installed in your machine.
To install IIS in your system (Do the Following! Go to START ---> Control Panel ---> Programs ---> Turn Windows Features on or off ---> Internet Information Services ---> Web Management Tools ---> Check or select IIS Management Console ---> Click OK)
Once opened IIS now select sites ---> Right click on it and select Add Website
Whenever we select Add Web Site option a new window will open in which we will enter Site Name, Physical Path and Host name that would be as follows:
If you observe in the image above here I have given Host name as visualstudiolearn.com after completion of my setup if I type http://www.visualstudiolearn.com/ in my browser automatically it will display my custom local setup application instead of my website. After entering all the details click OK. Now our site has been added in IIS .
Now our application is ready Right click on your site ---> Select Manage Web Site ---> Click Browse
After clicking on Browse the application will open with our custom url (Here given as http://www.visualstudiolearn.com/ )
Why this error is coming?
We are getting this error because of we didn’t set host file with this url
To set url in host file you need to open this path
C:\Windows\System32\drivers\etc
In this folder select hosts file and open with notepad (if you’re using Windows7 open that file like Run as Administrator) and set the url path will be like this
127.0.0.1 visualstudiolearn.com
(Note: Don’t include # symbol before IP and url because if you add # it will ignore our site path)
After set the url path now run your application that will show output of your application will be like this
Hope You Guys Found The Tutorial Helpful. If You Find Any Problems or Issues Make Sure To Comment!!
In previous article I already explained you how to Purplish and Deploy Asp.net Web or web service and How to Configure IIS Server on windows Xp and Windows 7.
So I Recommend you If you to first study that tutorial before starting this one .
After reading this Article we will be able to
setup a new site in IIS with Custom URL like
(http://www.visualstudiolearn.com/) in local system which is not under any Default Website.
Before setting up a new site in IIS let us first create one sample application in asp.net or Simple Web service in ASP.net using visual studio . Once new application is ready, next Open Run command and type "inetmgr" . Click the enter button ! IIS will open if it does not than that indicates that IIS is not installed in your machine.
To install IIS in your system (Do the Following! Go to START ---> Control Panel ---> Programs ---> Turn Windows Features on or off ---> Internet Information Services ---> Web Management Tools ---> Check or select IIS Management Console ---> Click OK)
Once opened IIS now select sites ---> Right click on it and select Add Website
Whenever we select Add Web Site option a new window will open in which we will enter Site Name, Physical Path and Host name that would be as follows:
If you observe in the image above here I have given Host name as visualstudiolearn.com after completion of my setup if I type http://www.visualstudiolearn.com/ in my browser automatically it will display my custom local setup application instead of my website. After entering all the details click OK. Now our site has been added in IIS .
Now our application is ready Right click on your site ---> Select Manage Web Site ---> Click Browse
After clicking on Browse the application will open with our custom url (Here given as http://www.visualstudiolearn.com/ )
We are getting this error because of we didn’t set host file with this url
To set url in host file you need to open this path
C:\Windows\System32\drivers\etc
In this folder select hosts file and open with notepad (if you’re using Windows7 open that file like Run as Administrator) and set the url path will be like this
127.0.0.1 visualstudiolearn.com
(Note: Don’t include # symbol before IP and url because if you add # it will ignore our site path)
After set the url path now run your application that will show output of your application will be like this
Hope You Guys Found The Tutorial Helpful. If You Find Any Problems or Issues Make Sure To Comment!!
0 comments:
Post a Comment