简体   繁体   English

在IIS默认网站下创建asp.net MVC Web应用程序或将其创建为新网站之间的区别

[英]Difference between creating my asp.net MVC web application ,under the IIS Default web site, or create it as a new web site

I have published my asp.net MVC web application under the “Default web site” inside IIS. 我已经在IIS中的“默认网站”下发布了asp.net MVC Web应用程序。 I actually added two versions of my web application:- 我实际上添加了两个版本的Web应用程序:

  • one directly under the default website and it can be accessed by typing http://servername 一个直接位于默认网站下,可以通过键入http://servername进行访问
  • one under presaging path , and can be accessed by typing http://servername/prestaging 一个在预配置路径下,可以通过键入http://servername/prestaging

so I got confused on which approach it is recommend to add my asp.net web application, and what is the difference between adding my web application under the default web site, or creating a whole new web site ? 所以我对建议添加asp.net Web应用程序的方法感到困惑,在默认网站下添加我的Web应用程序或创建一个全新的网站有什么区别?

Thanks 谢谢

This has more to do with organization within your company's IIS structure than right and wrong. 这与公司的IIS结构中的组织关系多于对与错。 If the site you built truly is the only site on the server, putting it on the Default site is not looked down upon. 如果您真正构建的站点是服务器上的唯一站点,则不要轻视它放置在“默认”站点上。

But if the application is a sub application of the default site, the latter approach is the more appropriate approach if you only get to access the site from the //servername URL. 但是,如果该应用程序是默认站点的子应用程序,则仅从// servername URL访问该站点时,后一种方法是更合适的方法。

If you have a separate domain, myapp.servername.com, you can install it into the default iis site and add a binding or you could create a whole separate web site. 如果您有单独的域myapp.servername.com,则可以将其安装到默认的iis站点中并添加绑定,也可以创建整个单独的网站。

Has more to do with your structure than right or wrong. 与您的结构有关的多于对与错。

Edit To answer your comment, creating the site under the default web site will make the URL in most cases be: ' http://myservername/MyApp '. 编辑为了回答您的评论,在默认网站下创建网站将使URL在大多数情况下为:“ http://myservername/MyApp ”。 Creating your own application would require (in most cases) a separate binding address, ' http://myapp.myservername.com ' It is really only affecting the URL you place in your browser and nothing else. 创建您自己的应用程序将需要(在大多数情况下)一个单独的绑定地址,即http://myapp.myservername.com 。它实际上只会影响您在浏览器中放置的URL,而不会影响其他任何内容。 More complicated setups are possible, but for most cases, these are your two options. 可以进行更复杂的设置,但是在大多数情况下,这是您的两个选择。

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

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