網站和 Web 應用程式相依於 Internet Information Services (IIS) 應用程式集區的可用性。IIS 應用程式集區則繼而相依於 Windows 處理序啟用服務 (WAS)。如果 WAS 不在執行中,或在應用程式集區啟動或關閉期間發生錯誤,則網站和 Web 應用程式可能會無法使用。
必須將應用程式集區的身分識別設為有效帳戶,以使應用程式集區可正常運作。應用程式集區的身分識別有兩種類型:內建和自訂。內建帳戶為 NetworkService、LocalService 和 LocalSystem。預設 (建議使用) 帳戶則為 NetworkService。如果您將應用程式集區的身分識別設為自訂帳戶,則必須確保使用者認證為有效狀態,且使用者必須是 IIS_USRS 群組的成員。下列程序說明如何設定應用程式集區的身分識別並在之後重新啟動應用程式集區。
設定應用程式集區的身分識別:
依序按一下 [開始]、[控制台] 和 [系統管理工具]。
對 [Internet Information Services (IIS) 管理員] 按一下滑鼠右鍵,然後選取 [以系統管理員身分執行]。
在左側的 [連線] 窗格中展開電腦,然後選取電腦名稱下方的 [應用程式集區] 資料夾。
在 [功能檢視] 中選取應用程式集區。在 [動作] 窗格中,選取 [進階設定...]
在 [處理序模型] 下方,確認 [身分識別] 類型。預設為 [NetworkService]。
如果身分識別類型設成特定使用者 (而非內建的其中一個帳戶),請按一下身分識別名稱右方的 按鈕,然後按一下 [設定] 以指定自訂帳戶認證。
若您已指定自訂使用者,請繼續進行下一個步驟;否則,請跳過停止和重新啟動應用程式集區的程序。如果將應用程式集區的身分識別設為自訂使用者,則必須將該使用者新增至電腦中的 IIS_USRS 群組。
將特定使用者 (自訂帳戶) 新增至 IIS_USRS 群組:
依序按一下 [開始]、[系統管理工具] 和 [電腦管理]。
在左側窗格中展開 [本機使用者和群組]。
選取 [群組],然後按兩下 [IIS_USRS]。
新增您稍早針對處理序模型身分識別所指定的自訂使用者。
透過以下程序中的步驟來停止和重新啟動 Web 服務。
注意:將使用者新增至 IIS_USRS 群組之後,必須停止並重新啟動 Web 服務以讓新的登入權限生效。此操作將會停止伺服器的所有網路流量。
如果您未將身分識別新增至 IIS_USRS 群組,請繼續執行停止並重新啟動應用程式集區的步驟。
停止和重新啟動 Web 服務:
開啟提高權限的 [命令提示字元] 視窗。按一下 [開始],指向 [所有程式],按一下 [附屬應用程式],以滑鼠右鍵按一下 [命令提示字元],然後按一下 [以系統管理員身分執行]。
鍵入 net stop was /y,然後按 ENTER。
輸入 net start was,然後按 ENTER。
輸入 net start w3svc,然後按 ENTER。
停止和重新啟動應用程式集區:
開啟 [IIS Manager]。
在 [連線] 窗格中,展開伺服器節點並按一下 [應用程式集區]。
在 [功能檢視] 中,選取您要停止並重新啟動的應用程式集區。
在 [動作] 窗格中,按一下 [停止] 以停止應用程式集區,然後按一下 [啟動] 以重新啟動應用程式集區。
您也可以使用以下連結來重新啟動應用程式集區:
回收應用程式集區
Target | Microsoft.Windows.InternetInformationServices.6.2.ApplicationPool | ||
Parent Monitor | System.Health.ConfigurationState | ||
Category | ConfigurationHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Error | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.Windows.InternetInformationServices.6.2.ApplicationPool.EventLogManualReset2StateMonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.Windows.InternetInformationServices.6.2.The.identity.of.the.application.pool.is.invalid.Monitor" Accessibility="Public" Enabled="true" Target="Microsoft.Windows.InternetInformationServices.6.2.ApplicationPool" ParentMonitorID="SystemHealth!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Microsoft.Windows.InternetInformationServices.6.2.ApplicationPool.EventLogManualReset2StateMonitorType" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.Windows.InternetInformationServices.6.2.The.identity.of.the.application.pool.is.invalid.Monitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/EventDescription$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ManualResetEventRaised" MonitorTypeStateID="ManualResetEventRaised" HealthState="Success"/>
<OperationalState ID="ErrorEventRaised" MonitorTypeStateID="ErrorEventRaised" HealthState="Error"/>
</OperationalStates>
<Configuration>
<LogName>System</LogName>
<Expression>
<And>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>MatchesRegularExpression</Operator>
<Pattern>^(5021|5057)$</Pattern>
</RegExExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-Windows-WAS</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</Configuration>
</UnitMonitor>