使用 appcmd 将应用程序池关联到站点

发布于 2024-10-08 06:32:24 字数 195 浏览 0 评论 0原文

我想使用 appcmd 通过命令行创建一个站点。

如何将特定应用程序池关联到站点?

为了创建一个网站,我这样写:

appcmd add site /name:"prova" bindings:http://localhost:8080 /physicalPath:c:\sites\prova

I want create a site by command line using appcmd.

How can I associate a specific application pool to site?

To create a site, I write in this way:

appcmd add site /name:"prova" bindings:http://localhost:8080 /physicalPath:c:\sites\prova

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

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

发布评论

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

评论(3

毁我热情 2024-10-15 06:32:24

你可以这样做:

APPCMD.exe 设置应用程序“prova/”/applicationPool:“YOUR_APP_POOL_NAME_HERE”

请注意 prova 后面附加的斜杠,这很重要。

例如,如果我希望将 prova 的应用程序池设置为 DefaultAppPool,我将发出以下命令:

APPCMD.exe 设置应用程序“prova/”/applicationPool:“DefaultAppPool”

从下面 Chris 的评论中获取,如果您的网站中有现有应用程序,请说 /mybloggy 和如果您希望更改它所属的应用程序池,那么您将发出以下命令:

APPCMD.exe 设置应用程序“prova/mybloggy”/applicationPool:“DefaultAppPool”

You can do this:

APPCMD.exe set app "prova/" /applicationPool:"YOUR_APP_POOL_NAME_HERE"

Note the trailing slash appended to prova, that's important.

For example if I wish to set the application pool for prova to the DefaultAppPool I would issue the following command:

APPCMD.exe set app "prova/" /applicationPool:"DefaultAppPool"

Picking up from Chris's comment below, if you have an existing application in your site, say /mybloggy and you wish to change application pool it belongs to then you'd issue the following:

APPCMD.exe set app "prova/mybloggy" /applicationPool:"DefaultAppPool"

流年里的时光 2024-10-15 06:32:24

替代语法:

APPCMD.exe set site /site.name:"站点名称" /[path='/'].applicationPool:"应用程序池名称"

在 Windows Server 文档中找到:
https://technet.microsoft.com/en-我们/library/cc732992(v=ws.10).aspx

Alternative syntax:

APPCMD.exe set site /site.name:"Site name" /[path='/'].applicationPool:"App Pool Name"

Found in Windows Server docs:
https://technet.microsoft.com/en-us/library/cc732992(v=ws.10).aspx

メ斷腸人バ 2024-10-15 06:32:24

尽管OP希望在“添加站点”命令中分配应用程序池,但我找不到将其包含在原始“添加站点”命令中的方法。我使用上面 Kev 的语法使用“添加站点”和“设置站点”使其工作。

另一方面,如果您需要在该“网站”下添加“应用程序”,您可以指定应用程序池,当您使用带有 applicationPool 参数的“add app”命令,如下所示:

APPCMD add app /site.name:"prova" /path:/App1 /physicalPath:c:\sites\prova\App1 /applicationPool:"provaAppPool"

ps 您可能需要在 APPCMD 前面添加 %systemroot%\system32\inetsrv\ 并调用

%systemroot%\system32\inetsrv\APPCMD /site.name:"prova"...

Although the OP was looking to assign the app pool within the "add site" command, I couldn't find a way to include it with the original "add site" command. I got it working using "add site" followed by "set site" using syntax by Kev above.

On the other hand, if you ever need to add an "application" under that "site", you can specify the app pool when you use the "add app" command with the applicationPool argument as here:

APPCMD add app /site.name:"prova" /path:/App1 /physicalPath:c:\sites\prova\App1 /applicationPool:"provaAppPool"

p.s. You may need to prefix APPCMD with %systemroot%\system32\inetsrv\ and call

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