<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>荷包蛋博客 &#187; iis7</title>
	<atom:link href="http://www.hebaodans.com/tag/iis7/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hebaodans.com</link>
	<description>好的心态是成功的开始</description>
	<lastBuildDate>Tue, 20 Jul 2010 17:32:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>win2008 iis7 安装pear</title>
		<link>http://www.hebaodans.com/2008/12/win2008-iis7-pear-install/</link>
		<comments>http://www.hebaodans.com/2008/12/win2008-iis7-pear-install/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 05:30:05 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[pear安装]]></category>
		<category><![CDATA[win2008]]></category>

		<guid isPermaLink="false">http://www.hebaodans.com/?p=183</guid>
		<description><![CDATA[安装环境:windows2008+php5.2.6+iis7 1、确认php目录下是否有pear/go-pear.phar。用install安装的php,没有pear/go-pear.phar,可以打开 http://pear.php.net/go-pear.phar ，把里面的内容复制另存到php目录pear/go-pear.phar 。 2.开始-运行-cmd-输入 php pear/go-pear.phar。没有把php目录加入环境变量的请先切换到该目录下。提示 Are you installing a system-wide PEAR or a local copy? (system&#124;local) [system] :直接默认回车 显示 Below is a suggested file layout for your new PEAR installation.  To change individual locations, type the number in front of the directory.  Type &#8216;all&#8217; to change all of them or simply press Enter [...]]]></description>
			<content:encoded><![CDATA[<p>安装环境:windows2008+php5.2.6+<span class='wp_keywordlink_affiliate'><a href="http://www.hebaodans.com/tag/iis7/" title="View all posts in iis7" target="_blank">iis7</a></span></p>
<p>1、确认php目录下是否有pear/go-pear.phar。用install安装的php,没有pear/go-pear.phar,可以打开 <a href="http://pear.php.net/go-pear.phar">http://pear.php.net/go-pear.phar</a> ，把里面的内容复制另存到php目录pear/go-pear.phar 。</p>
<p>2.开始-运行-cmd-输入 php pear/go-pear.phar。没有把php目录加入环境变量的请先切换到该目录下。提示</p>
<p>Are you installing a system-wide PEAR or a local copy?<br />
(system|local) [system] :直接默认回车</p>
<p>显示<br />
Below is a suggested file layout for your new PEAR installation.  To<br />
change individual locations, type the number in front of the<br />
directory.  Type &#8216;all&#8217; to change all of them or simply press Enter to<br />
accept these locations.</p>
<p> 1. Installation base ($prefix)                   : d:\php<br />
 2. Temporary directory for processing            : d:\php\tmp<br />
 3. Temporary directory for downloads             : d:\php\tmp<br />
 4. Binaries directory                            : d:\php<br />
 5. PHP code directory ($php_dir)                 : d:\php\pear<br />
 6. Documentation directory                       : d:\php\docs<br />
 7. Data directory                                : d:\php\data<br />
 8. User-modifiable configuration files directory : d:\php\cfg<br />
 9. Public Web Files directory                    : d:\php\www<br />
10. Tests directory                               : d:\php\tests<br />
11. Name of configuration file                    : C:\Windows\pear.ini<br />
12. Path to CLI php.exe                           : d:\php</p>
<p>1-12, &#8216;all&#8217; or Enter to continue:</p>
<p>可以按1修改pear安装路径，比如修改为d:\pear,按11修改为d:\pear\pear.ini，完成后按enter确认。</p>
<p>Beginning install&#8230;<br />
Configuration written to d:\pear\pear.ini&#8230;<br />
Initialized registry&#8230;<br />
Preparing to install&#8230;<br />
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.2.tar&#8230;<br />
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.3.tar&#8230;</p>
<p>installing phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.7.1.tar&#8230;<br />
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar.<br />
..<br />
pear/PEAR can optionally use package &#8220;pear/XML_RPC&#8221; (version &gt;= 1.4.0)<br />
install ok: channel://pear.php.net/Archive_Tar-1.3.2<br />
install ok: channel://pear.php.net/Console_Getopt-1.2.3<br />
install ok: channel://pear.php.net/Structures_Graph-1.0.2<br />
install ok: channel://pear.php.net/PEAR-1.7.1<br />
PEAR: Optional feature webinstaller available (PEAR&#8217;s web-based installer)<br />
PEAR: Optional feature gtkinstaller available (PEAR&#8217;s PHP-GTK-based installer)<br />
PEAR: Optional feature gtk2installer available (PEAR&#8217;s PHP-GTK2-based installer)</p>
<p>PEAR: To install optional features use &#8220;pear install pear/PEAR#featurename&#8221;</p>
<p>******************************************************************************<br />
WARNING!  The include_path defined in the currently used php.ini does not<br />
contain the PEAR PHP directory you just specified:<br />
&lt;D:\pear\pear&gt;<br />
If the specified directory is also not in the include_path used by<br />
your scripts, you will have problems getting any PEAR packages working.<br />
Would you like to alter php.ini &lt;D:\php\php.ini&gt;? [Y/n] : </p>
<p> 选Y修改php.ini</p>
<p>列出当前php.ini配置<br />
php.ini &lt;D:\php\php.ini&gt; include_path updated.</p>
<p>Current include path           : .;C:\php5\pear<br />
Configured directory           : D:\pear\pear<br />
Currently used php.ini (guess) : D:\php\php.ini<br />
Press Enter to continue:<br />
回车<br />
** WARNING! Old version found at D:\pear, please remove it or be sure to use the<br />
 new d:\pear\pear.bat command</p>
<p>The &#8216;pear&#8217; command is now at your service at d:\pear\pear.bat</p>
<p>** The &#8216;pear&#8217; command is not currently in your PATH, so you need to<br />
** use &#8216;d:\pear\pear.bat&#8217; until you have added<br />
** &#8216;D:\pear&#8217; to your PATH environment variable.</p>
<p>Run it without parameters to see the available actions, try &#8216;pear list&#8217;<br />
to see what packages are installed, or &#8216;pear help&#8217; for help.</p>
<p>For more information about PEAR, see:</p>
<p>  <a href="http://pear.php.net/faq.php">http://pear.php.net/faq.php</a><br />
  <a href="http://pear.php.net/manual/">http://pear.php.net/manual/</a></p>
<p>Thanks for using go-pear!</p>
<p> </p>
<p>* WINDOWS ENVIRONMENT VARIABLES *<br />
For convenience, a REG file is available under D:\pear\PEAR_ENV.reg .<br />
This file creates ENV variables for the current user.</p>
<p>Double-click this file to add it to the current user registry.</p>
<p>双击 D:\pear\PEAR_ENV.reg  ，将 D:\pear加入到当前用户环境变量中。</p>
<p>安装完成！</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hebaodans.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hebaodans.com/2008/12/win2008-iis7-pear-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS 7.0 Appcmd 使用</title>
		<link>http://www.hebaodans.com/2008/10/iis7-appcmd-useful/</link>
		<comments>http://www.hebaodans.com/2008/10/iis7-appcmd-useful/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 03:51:38 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[win2008]]></category>
		<category><![CDATA[appcmd]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://www.hebaodans.com/?p=117</guid>
		<description><![CDATA[ IIS 7.0：Appcmd.exe IIS 7.0 提供了一个新的命令行工具 Appcmd.exe，可以使用该工具来配置和查询 Web 服务器上的对象，并以文本或 XML 格式返回输出。下面是一些可以使用 Appcmd.exe 完成的任务的示例： ? 创建和配置站点、应用程序、应用程序池和虚拟目录。   ? 停止和启动站点。   ? 启动、停止和回收应用程序池。   ? 查看有关在 Web 服务器上运行的工作进程和请求的信息。   Appcmd.exe 为常见的查询和配置任务提供了一致的命令，从而降低了学习语法的复杂性。例如，您可以使用 list 命令来搜索有关对象（如应用程序）的信息，也可以使用 add 命令来创建对象（如站点）。 另外，您还可以将命令组合在一起使用，以返回与 Web 服务器上对象相关的更为复杂的数据，或执行更为复杂的任务。例如，您可以完成类似如下任务的复杂任务：停止所有具有运行时间超过六十秒的请求的站点。 IIS 7.0：启动 Appcmd.exe 如果要通过使用命令 shell 窗口来配置 IIS 7.0 设置，请打开 Appcmd.exe。Appcmd.exe 位于 %windir%\system32\inetsrv 目录中，只有管理员帐户或身为相应计算机上 Administrators 组成员的用户才可以访问此目录。此外，Administrators 组的成员必须在 Windows Vista® 和 Windows Server® 2008 中以提升的权限启动 Appcmd.exe，才能查看和更改以下服务器级配置文件中的设置：Machine.config、根 [...]]]></description>
			<content:encoded><![CDATA[<p> IIS 7.0：Appcmd.exe<br />
IIS 7.0 提供了一个新的命令行工具 Appcmd.exe，可以使用该工具来配置和查询 Web 服务器上的对象，并以文本或 XML 格式返回输出。下面是一些可以使用 Appcmd.exe 完成的任务的示例：</p>
<p>? 创建和配置站点、应用程序、应用程序池和虚拟目录。<br />
 <br />
? 停止和启动站点。<br />
 <br />
? 启动、停止和回收应用程序池。<br />
 <br />
? 查看有关在 Web 服务器上运行的工作进程和请求的信息。<br />
 </p>
<p>Appcmd.exe 为常见的查询和配置任务提供了一致的命令，从而降低了学习语法的复杂性。例如，您可以使用 list 命令来搜索有关对象（如应用程序）的信息，也可以使用 add 命令来创建对象（如站点）。</p>
<p>另外，您还可以将命令组合在一起使用，以返回与 Web 服务器上对象相关的更为复杂的数据，或执行更为复杂的任务。例如，您可以完成类似如下任务的复杂任务：停止所有具有运行时间超过六十秒的请求的站点。</p>
<h1 class="title">IIS 7.0：启动 Appcmd.exe</h1>
<div class="intro">
<p>如果要通过使用命令 shell 窗口来配置 IIS 7.0 设置，请打开 Appcmd.exe。Appcmd.exe 位于 %<em>windir</em>%\system32\inetsrv 目录中，只有管理员帐户或身为相应计算机上 Administrators 组成员的用户才可以访问此目录。此外，Administrators 组的成员必须在 Windows Vista® 和 Windows Server® 2008 中以提升的权限启动 Appcmd.exe，才能查看和更改以下服务器级配置文件中的设置：Machine.config、根 Web.config 文件（位于 .NET Framework 目录中）以及 ApplicationHost.config。查看或更改站点或应用程序目录中的 Web.config 文件的用户必须对这些目录中的文件具有读取和写入权限。</p>
<table class="sidebarContent" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px;">
<td class="dropCapQ" style="vertical-align: top;" align="left"> </td>
<td style="vertical-align: top;">
<h5><img src="http://www.hebaodans.com/library/gallery/templates/MNP2.Common/images/note.gif" border="0" alt="" width="10" height="10" />注：</h5>
</td>
</tr>
<tr id="eCEME" style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px;" valign="top">
<td class="dropCapQ" align="right"> </td>
<td>如果您运行的是 64 位 Windows，请从 <em>本地驱动器</em>\system32\inetsrv 目录而不是 <em>本地驱动器</em>\syswow64\inetsrv 目录使用 Appcmd.exe。</td>
</tr>
</tbody>
</table>
<table class="numberedList" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px;">
<td class="dropCapQ" style="vertical-align: top;" align="left"> </td>
<td style="vertical-align: top;"><strong>启动 Appcmd.exe</strong></td>
</tr>
<tr id="eCEWE" style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px;" valign="top">
<td class="dropCapQ" align="right"> </td>
<td>
<table border="0">
<tbody>
<tr style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px; border: red 1px inset;">
<td style="vertical-align: top;" colspan="2">
<div class="intro">
<table class="sidebarContent" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px;">
<td class="dropCapQ" style="vertical-align: top;" align="left"> </td>
<td style="vertical-align: top;">
<h5><img src="http://www.hebaodans.com/library/gallery/templates/MNP2.Common/images/note.gif" border="0" alt="" width="10" height="10" />注：</h5>
</td>
</tr>
<tr id="eCE4E" style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px;" valign="top">
<td class="dropCapQ" align="right"> </td>
<td>如果您登录到计算机时使用的是管理员帐户，您可以双击 <strong>Appcmd.exe</strong>。</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px; border: red 1px inset;">
<td class="pageNumber" style="vertical-align: top; line-height: 140%;">1.</td>
<td style="vertical-align: top;">单击<strong>“开始”</strong>，然后单击<strong>“运行”</strong>。</td>
</tr>
<tr style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px; border: red 1px inset;">
<td class="pageNumber" style="vertical-align: top; line-height: 140%;">2.</td>
<td style="vertical-align: top;">在<strong>“运行”</strong>对话框中的<strong>“打开”</strong>框中，键入 <strong>%</strong><em>windir</em><strong>%\system32\inetsrv</strong>。</td>
</tr>
<tr style="padding-right: 0px; padding-left: 0px; padding-bottom: 7px; padding-top: 0px; border: red 1px inset;">
<td class="pageNumber" style="vertical-align: top; line-height: 140%;">3.</td>
<td style="vertical-align: top;">右键单击 <strong>Appcmd.exe</strong>，然后单击<strong>“以管理员身份运行”</strong>。<strong><span class='wp_keywordlink_affiliate'><a href="http://www.hebaodans.com/tag/appcmd/" title="View all posts in appcmd" target="_blank">appcmd</a></span> /?</strong>若要查看有关特定 Appcmd.exe 对象（例如可以与 <strong>site</strong> 对象一起使用的命令）的帮助信息，请在命令提示符处键入如下命令，然后按 Enter：<strong><span class='wp_keywordlink_affiliate'><a href="http://www.hebaodans.com/tag/appcmd/" title="View all posts in appcmd" target="_blank">appcmd</a></span> site /?</strong>若要查看有关可以使用 Appcmd.exe 对象和命令（如 <strong>site</strong> 对象和 <strong>add</strong> 命令）配置的设置的帮助信息，请在命令提示符处键入如下命令，然后按 Enter：</p>
<p><strong><span class='wp_keywordlink_affiliate'><a href="http://www.hebaodans.com/tag/appcmd/" title="View all posts in appcmd" target="_blank">appcmd</a></span> add site /?</strong></td>
</tr>
</tbody>
</table>
<p>设置path环境 path=%path%;%SystemRoot%\System32\inetsrv</p>
<p>列出站点名称 appcmd list site /text:site.name</p>
<p>列出站点物理路径 APPCMD list vdirs /text:physicalPath</p>
<p> </p>
<p><span style="font-size: xx-small; color: #000099;">备份</span></p>
<p><span style="font-size: 14pt; color: #000099;"><strong>&gt;AppCmd Add Backup &#8220;BackupName&#8221;</strong></span></p>
<p><span style="font-size: 14pt; color: #000099;"><span style="font-size: xx-small;">罗列备份</span></span></p>
<p><span style="font-size: 14pt; color: #000099;"><span style="font-size: 14pt; color: #000099;"><strong>&gt;AppCmd List Backup</strong></span></span></p>
<p><span style="font-size: 14pt; color: #000099;"><span style="font-size: xx-small;">恢复</span></span></p>
<p><span style="font-size: 14pt; color: #000099;"><span style="font-size: xx-small;"><span style="font-size: 14pt; color: #000099;"><strong>&gt;AppCmd Restore Backup &#8220;BackupName&#8221;</strong></span></span></span></p>
<p><strong></strong></p>
<h2>1) Creating a backup</h2>
<p>To create a backup, simply type in:</p>
<p><strong><span style="font-size: 14pt; color: #000099;">&gt;AppCmd Add Backup &#8220;BackupName&#8221;</span></strong></p>
<p>You can omit the name, in which case AppCmd is going to generate the backup name automatically using the current date and time.  When a backup is created, the following happens:</p>
<ol>
<li>A directory with the backup name is created under the <em>%windir%\system32\inetsrv\backup</em> directory.</li>
<li>AppCmd copies the current configuration files into the backup directory, including <em>applicationHost.config<strong> </strong></em>(IIS global configuration), <em>administration.config</em> (Admin Tool&#8217;s configuration), <em>metabase.xml</em> and <em>mbschema.xml.</em>  The last two files contain the metabase data that is still used by some IIS services including SMTP and FTP, that have not been migrated to the new configuration system.  AppCmd only backs up the files that are there, so if you delete any of these files, and then make a backup, the backup will not contain the missing files. </li>
</ol>
<h2> </h2>
<h2>2) Managing existing backups</h2>
<p>To list the backups that exist on the server, type in:</p>
<p><strong><span style="font-size: 14pt; color: #000099;">&gt;AppCmd List Backup</span></strong></p>
<p>This will list the backup objects, including their names that can be used to restore or delete them.  To delete any of these backups if its no longer needed, type in:</p>
<p><strong><span style="font-size: 14pt; color: #000099;">&gt;AppCmd List Backup &#8220;BackupName&#8221;</span></strong></p>
<h2> </h2>
<h2> </h2>
<h2>3) Restoring a backup</h2>
<p>To restore a backup, type in:</p>
<p><strong><span style="font-size: 14pt; color: #000099;">&gt;AppCmd Restore Backup &#8220;BackupName&#8221;</span></strong></p>
<p>This will stop IIS (equivalent to calling IISRESET.EXE /STOP), and overwrite the server&#8217;s state with the files in the specified backup directory.  Then, IIS will be re-started (equivalent to calling IISRESET.EXE /START).</p>
<p>If you do no want AppCmd to stop IIS (which can take a while), and instead want to stop and start services yourself, you can include the <span style="font-size: 14pt; color: #000099;"><strong>/stop:false</strong></span> parameter.  Typically, only the IISADMIN service requires to be stopped so that the <em>mbschema.xml</em> file can be restored, if services like FTP or SMTP are being used.  Other files, including <em>applicationHost.config</em> and <em>administration.config,</em> are not locked by the configuration system so they can be restored without stopping IIS, and IIS components will pick up the changes.</p>
<p>I recommend that you make backups every time before making significant changes to the IIS7 configuration, which can save you a lot of time when something doesnt go as planned.  I&#8217;ve watched &#8220;AppCmd Restore Backup&#8221; come to the rescue more times then I can count, so its almost always the first thing that I do when I begin working with a new server, or help someone on the team investigate an issue.</p>
<p>In Windows Server &#8220;Longhorn&#8221; beta 3, we are adding a Configuration History service that automatically makes configuration backups every 2 minutes whenever configuration is changed.  This often eliminates the need to do manual backups, but not completely &#8211; often its desireable to make a backup at a specific point before making changes, so that that exact state is saved and can be restored at any point.  More info on the Configuration History service in a future post</p>
<p>转载来源</p>
<p><a href="http://technet2.microsoft.com/windowsserver2008/zh-CHS/library/ec52c53b-6aff-4d76-995e-3d222588bf322052.mspx?mfr=true">http://technet2.microsoft.com/windowsserver2008/zh-CHS/library/ec52c53b-6aff-4d76-995e-3d222588bf322052.mspx?mfr=true</a></p>
<p> </p>
<p>更详细用法</p>
<p> </p>
<p><strong>Application Pools<br />
</strong><span style="font-size: small; font-family: Calibri;">1. Recycle all application pools (replace recycle with start/stop to start/stop all apppools)<br />
</span></p>
<div><span style="font-size: small;"><span style="font-family: Calibri;"></p>
<div><em style="mso-bidi-font-style: normal;">appcmd list apppool /xml | appcmd recycle apppool /in</em></div>
<p></span></span></div>
<p><span style="font-size: small;"><span style="font-family: Calibri;"><em style="mso-bidi-font-style: normal;">2. Stop application pools with word &#8220;cheap&#8221; in it<br />
<em style="mso-bidi-font-style: normal;">appcmd list apppool /name:&#8221;$=*cheap*&#8221; /xml | appcmd stop apppool /in</em></p>
<div><span style="font-size: small; font-family: Calibri;"><br />
3. Set property enable32BitAppOnWin64 to true for all apppools (Filter apppools as in 2 if needed)<br />
<em style="mso-bidi-font-style: normal;">appcmd list apppool /xml | appcmd set apppool /in /enable32BitAppOnWin64:true</em></span></div>
<p></em></span></span><span style="font-size: small; font-family: Calibri;">4. Start apppools which are stopped<br />
<em style="mso-bidi-font-style: normal;">appcmd list apppool /state:Stopped /xml | appcmd start apppool /in</em></p>
<p>5. Recycle application pools which are used in some applications<br />
appcmd list app /xml | appcmd list apppool /in /xml | appcmd recycle apppool /in<br />
<em style="mso-bidi-font-style: normal;">appcmd list app /xml | appcmd recycle apppool /in (This might recycle one apppool multiple times)</em></p>
<p>6. Recycle apppools serving website “Default Web Site”</p>
<div><span style="font-size: small;"><span style="font-family: Calibri;"><em style="mso-bidi-font-style: normal;">appcmd list site &#8220;Default Web Site&#8221; /xml | appcmd list app /in /xml | appcmd list apppool /in /xml | appcmd recycle apppool /in<br />
appcmd list app /site.name:&#8221;Default Web Site&#8221; /xml | appcmd list apppool /in /xml | appcmd recycle apppool /in</em></span></span></div>
<p></span><span style="font-size: small;"><span style="font-family: Calibri;"><strong style="mso-bidi-font-weight: normal;">Sites</strong><br />
7. Start all the sites (Replace start with stop to stop all sites)<br />
<em style="mso-bidi-font-style: normal;">appcmd list site /xml | appcmd start site /in</em></p>
<p>8. Start the sites which are stopped<br />
<em style="mso-bidi-font-style: normal;">appcmd list site /state:stopped /xml | appcmd start site /in</em></p>
<p>9. Set serverAutoStart to false for all sites<br />
<em style="mso-bidi-font-style: normal;">appcmd list site /xml | appcmd set site /serverAutoStart:false /in</em></p>
<p>10. Keep sites config data and restore later</p>
<div><span style="font-size: small;"><span style="font-family: Calibri;"><em style="mso-bidi-font-style: normal;">appcmd list site /config /xml &gt; sites.xml<br />
appcmd add sites /in &lt; sites.xml</em></span></span></div>
<p></span></span><span style="font-size: small;"><span style="font-family: Calibri;"><strong style="mso-bidi-font-weight: normal;">Applications and Vdirs</strong><br />
11. Delete all apps which are using a particular apppool<br />
<em style="mso-bidi-font-style: normal;">appcmd list apppool DefaultAppPool /xml | appcmd list app /in /xml | appcmd delete app /in</em></p>
<p>12. Move all applications in a site to NewAppPool apppool<br />
<em style="mso-bidi-font-style: normal;">appcmd list app /site.name:&#8221;Default Web Site&#8221; /xml | appcmd set app /in /applicationPool:NewAppPool</em></p>
<p>13. List all sites with &#8220;/test&#8221; app<br />
<em style="mso-bidi-font-style: normal;">appcmd list app /path:&#8221;/test&#8221; /xml | appcmd list site /in</em></p>
<p>14. List apps created by user10 (assuming all his apps under a folder whose name contains user10)<br />
<em style="mso-bidi-font-style: normal;">appcmd list vdir /physicalPath:&#8221;$=*user10*&#8221; /xml | appcmd list app /in</em></p>
<p>15. List sites which read from C:\inetput\wwwroot<br />
<em style="mso-bidi-font-style: normal;">appcmd list vdir /physicalPath:C:\inetput\wwwroot /xml | appcmd list app /xml /in | appcmd list site /in</em></p>
<p>16. List the vdirs of sites which are stopped<br />
<em style="mso-bidi-font-style: normal;">appcmd list site /state:stopped /xml | appcmd list app /xml /in | appcmd list vdir /in</em></p>
<p><strong style="mso-bidi-font-weight: normal;">Worker processes and Requests</strong><br />
17. Stop apppools of requests running for more than 60 seconds<br />
<em style="mso-bidi-font-style: normal;">appcmd list request /xml /time:&#8221;$&gt;60000&#8243; | appcmd list apppool /in /xml | appcmd stop apppool /in</em></p>
<p>18. List apps served by wp 3600<br />
<em style="mso-bidi-font-style: normal;">appcmd list wp 3600 /xml | appcmd list apppool /xml /in | appcmd list app /in</em></p>
<p><strong style="mso-bidi-font-weight: normal;">Modules</strong><br />
19. Disable all managed modules<br />
<em style="mso-bidi-font-style: normal;">appcmd list module /preCondition:managedHandler /xml | appcmd delete module /in</em></p>
<p>20. Uninstall all native modules<br />
<em style="mso-bidi-font-style: normal;">appcmd list module /type:&#8221;" /xml | appcmd uninstall module /in</em></p>
<p>21. Unlock all module entries under system.webServer/modules (won’t work on vista)<br />
<em style="mso-bidi-font-style: normal;">appcmd list module /xml | appcmd set config /lockItem:false /in</em></p>
<div><strong style="mso-bidi-font-weight: normal;"><span style="font-size: small;"><span style="font-family: Calibri;"></p>
<div></div>
<p></span></span></strong></div>
<p></span></span><strong style="mso-bidi-font-weight: normal;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"><span style="font-size: small;"><span style="font-family: Calibri;"><strong style="mso-bidi-font-weight: normal;">Configuration</strong><br />
22. Keep config of a particular section and restore later<br />
</span></span><em style="mso-bidi-font-style: normal;"><span style="font-size: small; font-family: Calibri;">appcmd list config </span><a href="http://localhost/app1/"><span style="font-size: small; color: #0000ff; font-family: Calibri;">http://localhost/app1/</span></a><span style="font-size: small; font-family: Calibri;"> /section:caching /xml /config &gt; config.xml<br />
appcmd set config </span><a href="http://localhost/app1"><span style="font-size: small; color: #0000ff; font-family: Calibri;">http://localhost/app1</span></a><span style="font-size: small; font-family: Calibri;"> /in &lt; config.xml</span></em><strong style="mso-bidi-font-weight: normal;"></strong></p>
<div></div>
<p></span></span></span></strong><span style="font-size: small; font-family: Calibri;"><span style="font-size: small;"><span style="font-family: Calibri;"><strong style="mso-bidi-font-weight: normal;">Backups and Traces<br />
</strong>23. Delete all backups<br />
<em style="mso-bidi-font-style: normal;">appcmd list backup /xml | appcmd delete backup /in</em></span></span></p>
<div><strong style="mso-bidi-font-weight: normal;"></strong></div>
<p></span><strong style="mso-bidi-font-weight: normal;"><span style="font-size: small;"><span style="font-family: Calibri;">24. List sites generating 404<br />
<em style="mso-bidi-font-style: normal;">appcmd list trace /statusCode:404 /xml | appcmd list site /in</em><strong style="mso-bidi-font-weight: normal;"></strong></span></span><em style="mso-bidi-font-style: normal;"><span style="font-size: small; font-family: Calibri;"><br />
</span></em></p>
<p></strong><em style="mso-bidi-font-style: normal;"><span style="font-size: small; font-family: Calibri;">转载来源 <a href="http://blogs.iis.net/ksingla/archive/2007/06/17/things-you-can-do-by-piping-appcmd-commands.aspx">http://blogs.iis.net/ksingla/archive/2007/06/17/things-you-can-do-by-piping-appcmd-commands.aspx</a></span></em></td>
</tr>
</tbody>
</table>
</div>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hebaodans.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hebaodans.com/2008/10/iis7-appcmd-useful/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Win2008下的IIS7与PHP相关问题</title>
		<link>http://www.hebaodans.com/2008/08/win2008-iis7-php-setting/</link>
		<comments>http://www.hebaodans.com/2008/08/win2008-iis7-php-setting/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 09:09:58 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[setting]]></category>
		<category><![CDATA[win2008]]></category>

		<guid isPermaLink="false">http://www.hebaodans.com/?p=77</guid>
		<description><![CDATA[【实战】Win2008下的IIS7与PHP相关问题 导读：本文主要是介绍在 Win2008 的 IIS7 中配置和使用 PHP 的相关问题。注意，本文是针对 Win2008 全新的讲解，力求使用上的完美和配置上的简捷。 先推荐下载个视频（虽然是英文的，但是也可以先大致浏览了解一下）：http://wallpaper.iis7.org/videos/php-fastCGI.wmv 重点：从以上视频可以了解到，在 Win2008 的 IIS7 中，对 PHP 支持的最大改进有两点：1、FastCGI；2、Output Caching（输出缓存）。所以以下着重介绍用 FastCGI 支持 PHP 的方式，而 ISAPI 支持方式应该和以前版本的 IIS 大同小异，不再赘述。 需要下载的相关程序（全部为免费程序，找不到的话就别做网站了） 1、PHP 5.x.x For Win 版本（推荐使用免安装的压缩版本）； 2、MySQL 5.x For Win 版本； 3、phpmyadmin 最新版； 4、ZendOptimizer 最新版。 安装、配置下载的程序 0、在 Win2008 中添加角色：打开“服务器管理器”，在“Web 服务器中”别忘了添加“CGI”。如果没有添加，接下来是没有“FastCGI”选项的； 1、为 PHP 应用配置“FastCGI”：打开“IIS 管理器”，双击某个网站（或虚拟目录、应用程序），双击“处理程序映射”，然后从右边选择“添加模块映射”，“请求路径”填写“*.php”，“模块”选择“FastCgiModule”，“可执行文件”选择你 PHP 所在的目录中的“php-cgi.exe”（比如 D:\php\php-cgi.exe），“名称”就叫“php”好了。以下是配置说明： （1）将“PHP.INI-dist”拷贝在同目录中，名为“PHP.INI”（不建议使用“php.ini-recommended”拷贝，因为安全性较高，容易出问题）； [...]]]></description>
			<content:encoded><![CDATA[<p>【实战】Win2008下的IIS7与PHP相关问题<br />
导读：本文主要是介绍在 Win2008 的 IIS7 中配置和使用 PHP 的相关问题。注意，本文是针对 Win2008 全新的讲解，力求使用上的完美和配置上的简捷。</p>
<p>先推荐下载个视频（虽然是英文的，但是也可以先大致浏览了解一下）：http://wallpaper.<span class='wp_keywordlink_affiliate'><a href="http://www.hebaodans.com/tag/iis7/" title="View all posts in iis7" target="_blank">iis7</a></span>.org/videos/php-fastCGI.wmv</p>
<p>重点：从以上视频可以了解到，在 Win2008 的 IIS7 中，对 PHP 支持的最大改进有两点：1、FastCGI；2、Output Caching（输出缓存）。所以以下着重介绍用 FastCGI 支持  PHP 的方式，而 ISAPI 支持方式应该和以前版本的 IIS 大同小异，不再赘述。</p>
<p>需要下载的相关程序（全部为免费程序，找不到的话就别做网站了）<br />
1、PHP 5.x.x For Win 版本（推荐使用免安装的压缩版本）；<br />
2、MySQL 5.x For Win 版本；<br />
3、phpmyadmin 最新版；<br />
4、ZendOptimizer 最新版。</p>
<p>安装、配置下载的程序</p>
<p>0、在 Win2008 中添加角色：打开“服务器管理器”，在“Web 服务器中”别忘了添加“CGI”。如果没有添加，接下来是没有“FastCGI”选项的；</p>
<p>1、为 PHP 应用配置“FastCGI”：打开“IIS 管理器”，双击某个网站（或虚拟目录、应用程序），双击“处理程序映射”，然后从右边选择“添加模块映射”，“请求路径”填写“*.php”，“模块”选择“FastCgiModule”，“可执行文件”选择你 PHP 所在的目录中的“php-cgi.exe”（比如 D:\php\php-cgi.exe），“名称”就叫“php”好了。以下是配置说明：<br />
（1）将“PHP.INI-dist”拷贝在同目录中，名为“PHP.INI”（不建议使用“php.ini-recommended”拷贝，因为安全性较高，容易出问题）；<br />
（2）编辑“PHP.INI”，主要是修改以下关键配置的设置（注意，如果没有某个关键词，就自己创建；“d:\php”假设为 PHP 所在目录。）：<br />
register_long_arrays = on<br />
extension_dir = &#8220;d:\php\ext&#8221;<br />
cgi.force_redirect = 0<br />
extension=php_gd2.dll<br />
extension=php_mbstring.dll<br />
extension=php_mcrypt.dll<br />
extension=php_mysql.dll<br />
extension=php_pdo.dll<br />
extension=php_pdo_mysql.dll<br />
session.save_path = &#8220;d:\php\tmp&#8221;<br />
（3）特别说明：以上关键配置的设置是经过本人实战验证的，和目前网上流传的 PHP 配置说明主要不同之处在于：根本无需将任何一个文件拷贝来拷贝去。而且，进行以上配置后，对 MySQL 和 phpmyadmin 都已经完美支持了。</p>
<p>2、PHP 程序目前已经可以正常运行了，接下来安装 MySQL。安装后，你会发现无法继续进行配置（也许后续版本会解决此问题），这时候时需要修改“MySQLInstanceConfig.exe”（推荐使用“Resource Hacker”工具），找到 24-1-1033，将“asAdministrator”改成“requireAdministrator”，然后就可以从开始菜单运行 MySQL 的配置了。<br />
（1）MySQL 的具体配置可以参考网上的帖子，并没有针对 Win2008 的特别注意事项，不再赘述；<br />
（2）在这里单独说一下“Strict Mode”，如果某些程序运行中出现“mysql error number: 1366”，则可以关闭这个参数再试试看，也许能解决此问题。<br />
（3）MySQL 的语法使用也不介绍了，只说一个小技巧：如何解决导入超大 SQL 数据库时超时的问题？<br />
执行：mysql -u root -p【password】 -h localhost 【yourdb】 < 【yoursql】<br />
比如：mysql -u root -p123456 bbs < d:\bbs.sql</p>
<p>3、该安装 phpmyadmin 了，实际上无需安装（只是个 PHP 的应用程序而已，解压缩到你的 Web 目录下即可），而且有些人认为这个功能太弱，喜欢用其它类似产品。不过由于它的通用性，还是讲解一下吧：需要修改“libraries\config.default.php”的两个地方：<br />
（1）把 $cfg['blowfish_secret'] = &#8221;; 更改为 $cfg['blowfish_secret'] = &#8216;加密私钥&#8217;;<br />
（2）把 $cfg['Servers'][$i]['auth_type'] = &#8216;config&#8217;; 更改为 $cfg['Servers'][$i]['auth_type'] = &#8216;cookie&#8217;;</p>
<p>4、安装 ZendOptimizer（千万不要以为 FastCGI 方式不需要安装这个）：<br />
（1）最新版的 ZendOptimizer 在安装时可以识别 IIS7；<br />
（2）如果重装系统，ZendOptimizer 可以不用重新安装（当然，前提是 ZendOptimizer 没有安装在 C 盘）。</p>
<p>一直没有时间总结，写的很累啊……不足之处，欢迎指点！</p>
<p>本人使用以上方法在 Win2008 中应用 PHP 程序已有一个多月了，暂时没发现什么问题。另外，关于“输出缓存”的配置技巧希望大家能够补充一下<br />
此配置方法确实简单使用<br />
转载来源：http://forum.pcbeta.com/thread-270368-1-1.html</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hebaodans.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hebaodans.com/2008/08/win2008-iis7-php-setting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://wallpaper.iis7.org/videos/php-fastCGI.wmv" length="21979513" type="video/x-ms-wmv" />
		</item>
	</channel>
</rss>
