使用appcmd添加新网站问题

发布于 2024-08-08 15:18:48 字数 354 浏览 3 评论 0原文

我使用的是 VSTS 2008 + C# + .Net 3.5 + IIS 7.0。我想使用appcmd添加一个新网站,我的场景是这样的。

  1. 我的所有网站文件都位于文件夹 c:\template 下;
  2. 我想将我的新网站添加为默认网站下的虚拟目录,该虚拟目录名为“testsite1”;
  3. 我想使用默认应用程序池(或默认网站正在使用的应用程序池)。

我研究了appcmd很长一段时间,但无法弄清楚。也许要么是我太笨,要么是因为IIS 7.0/appcmd是新的,帮助信息有限。 :-)

如果有人能让我知道如何使用 appcmd 完成部署任务,我将不胜感激?

提前致谢, 乔治

I am using VSTS 2008 + C# + .Net 3.5 + IIS 7.0. I want to using appcmd to add a new web site, my scenario is like this.

  1. All my web site files are under folder c:\template;
  2. I want to add my new web site as a virtual directory under default web site, the virtual directory is called "testsite1";
  3. I want to use the default application pool (or the application pool which default web site is using).

I have stuied appcmd for quite some time, but cannot figure out. Maybe either I am too stupid or because IIS 7.0/appcmd is new, help information is limited. :-)

Appreciate if anyone could let me know how to complete my deployment task using appcmd?

thanks in advance,
George

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你与昨日 2024-08-15 15:18:48
  1. 您必须以管理员身份打开命令提示符
  2. 执行以下操作:

    "%windir%\system32\inetsrv\AppCmd" add app /site.name:"默认网站" /path:/testsite1 /physicalPath:"c:\template"
    

我是如何发现这一点的?我做了以下操作:

appcmd add app /?

并且有这个例子:

appcmd add app /site.name:"Default Web Site" /path:/app1

所以我刚刚添加了 physicalPath

也检查一下。

  1. You must open the command prompt as Administrator
  2. Execute the following:

    "%windir%\system32\inetsrv\AppCmd" add app /site.name:"Default Web Site" /path:/testsite1 /physicalPath:"c:\template"
    

How I found this out? I did the following:

appcmd add app /?

and there was this example:

appcmd add app /site.name:"Default Web Site" /path:/app1

so I just added physicalPath

check this also.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文