简体   繁体   English

使用IIS和Windows Server将我的网站部署到公共网站

[英]Deploying my website to the pulic using IIS and windows server

I recently bought a domain. 我最近买了一个域名。 Let's say my domain is "domain.com", and I made a website in visual web dev. 假设我的域名是“ domain.com”,并且我是用Visual Web开发人员创建的网站。 using ASP.NET and VB.NET. 使用ASP.NET和VB.NET。 I also have an old computer that I turned into a home server so I installed windows server 2008 R2 SP2. 我还有一台旧计算机,已变成家庭服务器,因此安装了Windows Server 2008 R2 SP2。 So I uploaded my website to a folder and went to the IIS manager. 因此,我将网站上传到一个文件夹,然后转到IIS管理器。 There I added a website, set the sitename to "domain.com" application pool to "ASP.NET v4.0". 我在那里添加了一个网站,将站点名称设置为“ domain.com”,应用程序池设置为“ ASP.NET v4.0”。 Then the physical path to: "c:\\websites\\wwwroot\\domain.com" then in the bindings I added 3 different things. 然后是物理路径:“ c:\\ websites \\ wwwroot \\ domain.com”,然后在绑定中添加了3种不同的东西。

type   hostname     port   IP adress
http www.domain.com  80   my IP found at www.what'smyip.com
http domain.com      80   my IP found at www.what'smyip.com
http   *blank*       80   192.168.1.6(my server's internal IP)

I made sure port 80 is open in my router and I added a firewall inbound rule for port 80. 我确保路由器中的端口80已打开,并且为端口80添加了防火墙入站规则。

When I connect using 192.168.1.6 I get my website and everthing works like it should. 当我使用192.168.1.6连接时,我得到了我的网站,一切正常。

However when I connect using domain.com or www.domain.com I see a 404 page. 但是,当我使用domain.com或www.domain.com连接时,会看到404页面。 http://prntscr.com/42ynf4 http://prntscr.com/42ynf4

Also when I change my bindings and I change the IP for domain.com and www.domain.com like displayed below: 同样,当我更改绑定并更改domain.com和www.domain.com的IP时,如下所示:

type   hostname     port   IP adress
http www.domain.com  80   192.168.1.6(my server's internal IP)
http domain.com      80   192.168.1.6(my server's internal IP)
http   *blank*       80   192.168.1.6(my server's internal IP)

It works just like it's supposed to? 它像预期的那样工作?

I have done a DNSlookup on the domain and it's active. 我已经在域上完成了DNSlookup,并且该域名处于活动状态。 I'm a little bit stuck on this and I know you guys aren't experts on hosting but you all probably have more knowledge about this then I do. 我对此有些坚持,我知道你们不是托管方面的专家,但你们可能比我更了解此事。

You should check what is the server IP address (netstat), because you could use a proxy and then the Internet IP info will be not correct. 您应该检查什么是服务器IP地址(netstat),因为可以使用代理,然后Internet IP信息将不正确。 Also, make sure that you set the correct home page in IIS. 另外,请确保在IIS中设置正确的主页。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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