lshboo 发表于 2015-8-14 12:32:54

IIS 7 WAS服务不可用

  在 Windows Server 2008 上使用 %windir%\system32\inetsrv\appcmd.exe list wp 命令,得到如下错误:
  ERROR ( message:WAS 服务不可用 - 请先尝试启动该服务。 )
  ERROR ( message:The WAS service is not available - try starting the service first. )
  但执行 sc query was 与 sc query w3svc 发现这两个服务的状态都是 running。
  转而尝试执行 appcmd list site 或者 appcmd list site 都会得到如下错误:
  ERROR ( message:配置错误
文件名: redirection.config
行号: 0
描述: 由于权限不足而无法读取配置文件
。 )
  ERROR ( message:Configuration error
Filename: redirection.config
Line Number: 0
Description: Cannot read configuration file due to insufficient permissions
. )
  看来又是权限问题,原来此时自己用的并不是管理员账号,appcmd 许多命令都需要提升为管理员权限才能执行,因此运行 runas /user:administrator cmd 重新打开一个 cmd,再次执行 appcmd list wp,OK,当前正在运行的应用程序池列出来了!
  相关参考:
  IIS 7.0:Appcmd.exe
  Windows 进程激活服务 (WAS)
  AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"
  Listing Running Web Applications Using Iisapp.vbs (IIS 6.0)
  来自:http://blogs.leoworks.net/feng/post.aspx?post=iis7-appcmd-list-wp-The-WAS-service-is-not-available
  
  附:win7 也类似需要以管理员身份运行 cmd命令
页: [1]
查看完整版本: IIS 7 WAS服务不可用