简体   繁体   中英

Deploy Website in IIS

I am trying to deploy a website on IIS. When I deploy it without giving it a host name, everything works fine.

However, if I try to specify a host name, the website never loads in the browser. For instance, I gave it a hostname of www.webservice.com. When I try to load the home page, the web browser tries to access www.webservice.com:2000/HomePage.aspx but the connection always times out.

How can I solve this problem?

在此处输入图片说明

Seems like you want to host your website in your local IIS server. Generally by default you can access your site by accessing localhost ie http://localhost:[port no]/HomePage.aspx

But if you want to give your own Host name, Either you can set up your domain or for local testing then try the following link:

use myfakesite.com instead of localhost in IIS 7

Shihan's comments made me realise what you're trying to achieve:

You cannot do this since you do not own the domain name. If you owned the domain name then this would be fine.

You need to register the domain name and point (via the DNS section) the A record to your server IP. IIS is about taking in the request, dealing with it and spitting out what is relevant (based upon the request), it doesn't organise your DNS records for you (nor create them).

However, since you're using a PC for this, I would suspect you're not on a static IP address which makes this much more complex.

You will also need to note that IIS on a local PC is much more limited than on a Windows Server.

You have to either set up DNS to point to the host where IIS is running or make an entry in your "hosts" file. DNS is good for production purposes but if you just want to test something a hosts entry will be good enough. You find the hosts file under %WINDOWSROOT%\\System32\\drivers\\etc (eg.: C:\\Windows\\System32\\drivers\\etc). Just add the name of site (www.webservice.com) there together with the IP of the IIS host.

IIS doesn't set up the DNS for you automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM