简体   繁体   English

在网络上托管Web API应用程序时我在做什么错?

[英]What am I doing wrong in hosting my Web API app on the network?

I followed the steps in this article , yet when I enter my IP address (machine name) and the port number that I set up following those instructions (namely 8090) in my browser, I just see a directory listing of my site: 我按照本文中的步骤进行操作,但是当我在浏览器中输入IP地址(计算机名称)和按照这些说明设置的端口号(即8090)时,我只看到我的站点的目录列表:

在此处输入图片说明

Note: Using the direct IP Address (in place of the machine name) gives the exact same results. 注意:使用直接IP地址(代替计算机名称)可获得完全相同的结果。

For a Web API site/app, do I need something appended to the plain IP Address/MachineName + Port number URL? 对于Web API网站/应用程序,我是否需要在普通IP地址/机器名称+端口号URL后面附加一些内容?

According to IIS Manager, I was successful in setting up the app to run: 根据IIS管理器,我成功设置了要运行的应用程序:

在此处输入图片说明

Web API apps do not have a Default.aspx "startng point" page or some such; Web API应用程序没有Default.aspx“起始点”页面或类似页面; is there something else analogous that I should use? 还有其他类似的东西我应该使用吗? I tried: 我试过了:

http://shannon2:8090/Web.config

...but that gave me: ...但是那给了我:

HTTP Error 404.8 - Not Found The request filtering module is configured to deny a path in the URL that contains a hiddenSegment section. HTTP错误404.8-找不到请求过滤模块配置为拒绝URL中包含hiddenSegment部分的路径。

What step[s] am I missing? 我缺少什么步骤?

Note: The article referenced has an IIS 8 download, but according to Control Panel, I already had IIS 8 installed, so I didn't re-install it. 注意:所引用的文章已下载IIS 8,但根据控制面板,我已经安装了IIS 8,因此没有重新安装它。 Yet, the About box for IIS Manager says it is version 7.5.7600.16385 (?!?) 但是,IIS管理器的“关于”框表示它是版本7.5.7600.16385(?!?)

Is there a way to force the usage of version 8 instead of this one? 有没有一种方法可以强制使用版本8而不是版本8? Does it matter in this scenario? 在这种情况下有关系吗?

UPDATE UPDATE

Based on what I read here [ http://msmvps.com/blogs/deborahk/archive/2014/02/18/the-world-s-simplest-angularjs-example-in-visual-studio.aspx] , specifically "By convention, the main file of an application is Index.html", I also tried this: 根据我在此处阅读的内容[ http://msmvps.com/blogs/deborahk/archive/2014/02/18/the-world-s-simplest-angularjs-example-in-visual-studio.aspx] ,特别是“按照惯例,应用程序的主文件是Index.html“,我也尝试过这样做:

http://shannon2:8090/Index.html

...but got: ...但是得到:

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

But I don't really have an Index.html file in my project, so that's was a shot in the dark/leap of gullibility, I guess. 但是我的项目中确实没有Index.html文件,所以我猜这是在黑暗/小暴躁的情况下拍摄的照片。

You are seeing the directory listing because the page you are referring to tells you to enable directory browsing. 您看到的是目录列表,因为您所引用的页面告诉您启用目录浏览。

I am not sure what the gentleman was trying to convey in that link. 我不知道这位绅士试图在那个环节传达什么。 I think he is trying to convey how to access your "files" within the network. 我认为他正在尝试传达如何在网络内访问您的“文件”。 However, disable directory browsing and you should be ok. 但是,禁用目录浏览,您应该可以。

And web API should run in managed pipeline within the application pool settings. Web API应该在应用程序池设置内的托管管道中运行。

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

相关问题 IIS 7.5我在做什么错? - IIS 7.5 What am I doing wrong? 如何设置Web API应用程序使其可通过网络使用? - How can I set up my Web API app to be available over the network? 在 AppHarbor 上托管 WCF Web API 应用程序? - Hosting a WCF Web API app on AppHarbor? 在我的网络上托管公共 web 站点的风险? - Risks of hosting public web site right on my network? 在 IIS 中托管 .NET 核心 Web 应用程序时,“进程内”和“进程外”托管模型之间的优缺点是什么 - When hosting .NET core web app in IIS, what are the pros and cons between "In process" and "out of process" hosting model 托管 Web 服务时我的 web.config 文件有问题 - Something wrong with my web.config file while hosting web service 我想念什么? 我的应用程序可以在我的开发箱上通过gmail发送电子邮件,但不能在我的服务器上 - What am I missing? My app can send e-mail via gmail on my dev box, but not on my server 使用 IIS windows 10 自托管(是否正常工作 不知道我错过了什么步骤) - Self hosting with IIS windows 10 (Had it working No clue what step I am missing) 如何将Web API 2 Web应用分发给我的客户? - How to distribute a Web API 2 web app to my clients? 转换 Web API 以使用自托管 - Convert Web API to use Self Hosting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM