简体   繁体   English

托管ASP.Net MVC网站

[英]Host ASP.Net MVC Site

I've created a site using ASP.Net MVC that is meant to be stored on a local machine at my place of work. 我已经使用ASP.Net MVC创建了一个站点,该站点应该存储在我工作地点的本地计算机上。 The intention is to have the site stored on this machine, but then accessible by all the other machines within this building. 目的是将站点存储在此计算机上,但随后可由建筑物中的所有其他计算机访问。

I've followed Microsoft's tutorial as well as Code Project's tutorial , but I am not having very much luck. 我遵循了Microsoft的教程以及Code Project的教程 ,但是我不太走运。 The binding is just the localhost, port 80, with * for the IP address. 绑定只是本地主机,端口80,带*的IP地址。 The URL is localhost/GrantTracker. 该URL为localhost / GrantTracker。

I've opened the ports within the firewall, checked the permissions on the directory (which is just within wwwroot), tried having the site take the place of the default IIS site (as Microsoft tutorial has you do) and tried having the site stand on its own with its own port (per Code Projects tutorial). 我打开了防火墙内的端口,检查了目录的权限(仅在wwwroot中),尝试使该站点代替默认的IIS站点(如Microsoft教程所述),并尝试使该站点站立自己使用自己的端口(根据Code Projects教程)。

On the host machine I am receiving the standard "This site can't be reached, localhost refused to connect" which feels like either a port or permissions problem. 在主机上,我收到标准的“无法访问此站点,本地主机拒绝连接”的感觉,就像是端口或权限问题。 I must be missing a step, but I can't seem to find what it would be. 我一定错过了一步,但似乎找不到答案。 I am new to hosting sites through IIS so forgive me if I am just missing something basic. 我不熟悉通过IIS托管站点,因此,如果我只是缺少基本知识,请原谅我。

I find it a bit strange too because my project uses Windows Authentication and when the site is first visited it performs that initial check with the user, authenticates, but then throws me the error. 我也觉得有点奇怪,因为我的项目使用Windows身份验证,并且在首次访问该站点时,它会与用户进行初始检查,进行身份验证,但随后抛出错误。

Anyone have any ideas? 有人有想法么? Thanks in advance. 提前致谢。

start simple, create a simple html page, create an IIS application for it, on port 80. Check and make sure you can see that page from another computer using the internal IP address of the the host machine so something like: 从简单开始,创建一个简单的html页面,在端口80上为其创建IIS应用程序。检查并确保您可以使用主机的内部IP地址从另一台计算机看到该页面,如下所示:

http:\\\\192.168.0.3\\hostapp\\test.html . http:\\\\192.168.0.3\\hostapp\\test.html

You can see the proper URL by running it from IIS, this will give you the entire URL you need, with localhost then just replace localhost with the IP address of the host machine to see it on other machines. 您可以通过从IIS运行它来查看正确的URL,这将为您提供所需的完整URL,使用localhost,然后将localhost替换为主机的IP地址即可在其他计算机上查看它。

Do this in the original IIS folder so you don't encounter any folder permission issues. 在原始IIS文件夹中执行此操作,这样就不会遇到任何文件夹权限问题。 If you choose another folder you'll have to give access to the Network Service user ( i think, can't remember now, but there is a specific user that needs access to the folder where the website is deployed ) 如果您选择其他文件夹,则必须授予网络服务用户访问权限(我想现在不记得了,但是有一个特定的用户需要访问网站所在的文件夹)

if you can see the page then deploy a proper website and do the same thing. 如果您可以看到该页面,则部署适当的网站并执行相同的操作。 Make sure the app pool is created correctly and it's up and running, then access it again on other computers and it should work. 确保正确创建了应用程序池,并且该应用程序池已启动并正在运行,然后在其他计算机上再次访问它,并且该池应能正常工作。

Port 80 should be open by default so that should not be an issue. 默认情况下,端口80应该是打开的,因此这不是问题。

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

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