IIS 站点和应用程序池导入导出

Exporting and Importing Sites and App Pools from IIS 7 and 7.5

When using multiple IIS server in a Load Balanced Environment it will  be alot of work to create all your website twice with the same settings on each webserver. Therefor it is possible to export and import your configuration from one webserver to the other. This will also be usefull when your upgrading from IIS 7 (Windows Server 2008) to IIS 7.5 (Windows Server 2008 R2).

When you create a website in IIS 7 or 7.5 a unique application pool will also be created and used by this website, that’s why you need to import these application pools first on the second webserver before importing the website(s).

To Export the Application Pools on IIS 7 :
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml

This will export all the application pools on your webserver, therefor you need to edit the apppools.xml and remove the application that you do not need to import for example:
•DefaultAppPool
•Classic .NET AppPool
•SecurityTokenServiceApplicationPool

And other apppools that already exist on the second webserver, appcmd doesn’t skip already existing apppools, it just quit’s and doesn’t import any.

To import the Application Pools:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml

All the AppPools in the xml will be created on your second webserver.

To Export all your website:
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml

This will export all the websites on your webserver, therefor you need to edit the sites.xml and remove the websites that you do not need to import for example:
•Default Website

And all other websites that already exist on the second webserver.

To Import the website:
%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml

It’s also possible to export a single website or application pool all you need to do is add the name of the Application Pool or Website to the command line:

To export/import a single application pool:
%windir%\system32\inetsrv\appcmd list apppool “MyAppPool” /config /xml > c:\myapppool.xml

Import:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\myapppool.xml

To export/import a single website:
%windir%\system32\inetsrv\appcmd list site “MyWebsite” /config /xml > c:\mywebsite.xml

Import:
%windir%\system32\inetsrv\appcmd add site /in < c:\mywebsite.xml

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
IIS应用程序回收是指IIS(Internet Information Services)在一定条件下自动终止和重新启动应用程序的过程。 应用程序IIS中一个独立的进程,在运行网站时负责处理HTTP请求,并将静态或动态内容返回给客户端。由于长时间运行或资源占用过多,应用程序可能出现问题,导致网站响应缓慢甚至崩溃。 为了确保网站的性能和稳定性,IIS提供了应用程序回收功能。当满足以下条件之一时,IIS会自动回收应用程序: 1. 配置更改:修改了应用程序的相关设置,例如CPU占用限制、内存限制等。 2. 定时回收:设定了应用程序的闲置时间或过期时间,超过指定时间没有请求访问应用程序时,IIS会自动回收它。 3. 内存限制:当应用程序使用的物理内存超过了设定的限制时,IIS会回收应用程序。 4. CPU限制:当应用程序的CPU使用率超过限制值时,IIS会回收应用程序。 5. 请求失败:当应用程序连续多次失败或崩溃时,IIS会回收它。 在回收过程中,IIS会终止应用程序中的运行中的进程,并且清除内存中的所有对象。然后,IIS会重新启动应用程序,以确保网站继续正常运行。 应用程序回收是IIS中一个关键的功能,它可以提高网站的性能和稳定性。但是,频繁的回收可能会导致一定的延迟,因此需要根据实际情况进行合理的配置和调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值