最近由于一個新項目需要用到ASPX和FLEX, 得在IIS上部署,但被一個WAS服務無法正常啟動的問題搞得很郁悶,網上找了很久都沒找到一個可以用的方案。
錯誤如下:
The Windows Process Activation Service service terminated with the following error: The system cannot find the file specified.
這是在系統日志中拿到的錯誤資訊。
其實這個服務本來是好的,但之前由于IIS一些東西在 Constrol Panel -> Programs and Features -> Windows features turn on/off 那裡裝不上,然後不知道怎麼想的就覺得原因應該在WAS這個服務上,索性sc delete WAS讓它去死。
結果發現悲劇了,IIS啟動需要 WAS 和 W3SVC 這兩個服務。
于是, 就想 WAS 這個服務嘛,簡單,去同學電腦上大概看了下參數配置,開始動手:
sc create WAS binPath= "C:\windows\system32\svchost.exe -k iissvcs" DisplayName= "Windows Process Activation Service" type= share error= normal start= delayed-auto depend= RPCSS
服務是可以在服務管理器那邊看到了。可是,啟動的時候死活就是不行——“The system cannot find the file specified.”。
在網上找了一個又一個的網站,說實話,壓根基本是沒什麼作用。最後無奈, 想想還是自已動手。
服務有問題,想着再去了同學電腦一趟 ,到系統資料庫中把HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WAS這個項整個導出到一個reg檔案中。
再回到自己電腦,
1.sc delete WAS
2.sc create WAS binPath= "C:\windows\system32\svchost.exe -k iissvcs" DisplayName= "Windows Process Activation Service" type= share error= normal start= delayed-auto depend= RPCSS
3. 把.導出的.reg檔案導入自己電腦的系統資料庫
再次打開IIS,久違的 Restart 字眼, IIS已經正常WORK了。
總結一下:
1. 系統服務還是不能亂删的,恢複的時候可以參考其他電腦,可借助系統資料庫的導入和導出功能進行服務的恢複。
2. 系統日志對于找一些錯誤還是很有用的,Windows所有應用程式的異常大部分會出現在那裡。
3. 解決問題時要多思考,不要想着依賴。
此記! 2012-03-16 15:55
By M