我应该将我的 ASP.NET 网站放在 wwwroot 文件夹中吗? [英] Should I put my ASP.NET websites in the wwwroot folder?

查看:19
本文介绍了我应该将我的 ASP.NET 网站放在 wwwroot 文件夹中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有许多网站在一台机器上运行在 IIS 下.

I have a number of websites that run under IIS on a single machine.

我应该将这些网站放在 C:inetpubwwwroot 文件夹中还是 C:inetpub 文件夹中?

Should I put these websites inside of the C:inetpubwwwroot folder or inside the C:inetpub folder?

例如

  • C:inetpubwwwrootWebsite1
  • C:inetpubwwwrootWebsite2

  • C:inetpubWebsite1
  • C:inetpubWebsite2

这两个位置或其他推荐位置有什么优点/缺点(我在这台机器上只有一个 C 驱动器)?

Are there any pros/cons for either or another recommended location (I only have a C drive on this machine)?

我不确定是否有一个正确"的答案,但如果有的话,我想遵循最佳实践.

I am not sure whether there is a "correct" answer to this, but want to follow best practice if there is one.

非常感谢,乔纳森

推荐答案

走第二条路.

wwwroot 只是作为服务器默认网站的容器.如果您从 IIS 中删除默认网站,则可以安全地删除此目录.无论如何,您的站点与默认站点无关,因此它们应该位于 inetpub 下的自己的文件夹中.

wwwroot is simply there as the container for the default website for the server. If you delete the default website from within IIS, then you can safely remove this directory. Regardless, your sites have nothing to do with the default, so they should be in their own folders under inetpub.

也就是说,我们有时在同一台服务器上有多种类型"的网站.例如 DEV 和 QA.在这种情况下,我会将其结构为:

That said, we sometimes have multiple "types" of sites on the same server. For example DEV and QA. In this case I would structure it as:

c:inetpubdevsite1
c:inetpubdevsite2

c:inetpubdevsite1
c:inetpubdevsite2

c:inetpubqasite1
c:inetpubqasite2

c:inetpubqasite1
c:inetpubqasite2

这篇关于我应该将我的 ASP.NET 网站放在 wwwroot 文件夹中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆