简体   繁体   English

IIS应用程序的物理路径是否应该与虚拟路径匹配?

[英]Should the physical path of an IIS Application match the virtual path?

I understand that the physical path of an Application in IIS is not required to live in the same location reflected in the virtual paths. 据我所知,住在反映在虚拟路径的相同位置中的IIS应用程序的物理路径不是必需的。 Of course, it can be done that way. 当然可以那样做。

Is it considered bad practice to have this overlap? 这种重叠是否被认为是不好的做法? Are there any negative consequences that might occur by doing this? 这样做可能会产生负面影响吗?


Here is an example: 这是一个例子:

I have a website at c:\\inetpub\\wwwroot and I deploy two applications: 我在c:\\inetpub\\wwwroot有一个网站,并且部署了两个应用程序:

Virtual Paths: 虚拟路径:
/apps/Application1
/apps/Application2

Physical Paths: 物理路径:
C:\\inetpub\\wwwroot\\apps\\Application1
C:\\inetpub\\wwwroot\\apps\\Application2


An alternative solution might be this: 一个替代解决方案可能是这样的:

Virtual Paths: 虚拟路径:
/apps/Application1
/apps/Application2

Physical Paths: 物理路径:
C:\\inetpub\\Application1
C:\\inetpub\\Application2

No, the physical path does not need to match the virtual path. 否,物理路径不需要与虚拟路径匹配。 It's totally up to you how you want to set it up. 设置方式完全取决于您。

They can be different. 它们可以不同。 I use different physical paths in many cases. 在许多情况下,我使用不同的物理路径。 A lot of times it's easier to deploy to some well known physical location with a date or release number as part of the directory name... and have a (sometimes branded) user oriented path on the server. 很多时候,将日期或发行号作为目录名称的一部分部署到某个知名的物理位置会更容易...并且在服务器上有一个(有时是品牌化的)面向用户的路径。

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

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