我在 Microsoft Azure 上发布了一个网站,最近我收到以下错误:“指定的 CGI 应用程序遇到错误,服务器终止了该进程。”
我的应用程序是Java应用程序并使用“最新的Tomcat 7.0”。我尝试了一些修复,但没有成功( The specified CGI application encountered an error and the server terminated the process )。我的 web.config 甚至没有这个属性。
从我的日志中我注意到 Java 应用程序没有记录任何错误,但它只是在一段时间后停止运行。当我重新启动服务器时它可以正常工作,但是一两天后,我开始收到此错误。
我以前也遇到过这个问题,但是一两个月后才出现这个错误,现在几乎每天都会出现这个错误。我没有对我的文件或服务器进行任何更改。
知道如何解决吗?
最佳答案
Azure 网站有一项称为自动修复的功能。这仅在标准模式下可用,在免费或基本模式下不可用。
您可以将服务器配置为定期重新启动。这不会解决根本原因,但可能足以让您的应用程序保持运行。 查看此 github 要点,了解如何在 web.config 文件中配置它
https://gist.github.com/SyntaxC4/0d7185b30acf477c2033#file-web-autoheal-config
Azure 网站备忘单中描述了自动修复
http://microsoftazurewebsitescheatsheet.info/
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<monitoring>
<triggers>
<!-- Scenario #1: Recycling based on Request Count -->
<requests count="1000" timeInterval="00:10:00"/>
<!-- Scenario #2: Recycling based on slow requests -->
<slowRequests timeTaken="00:00:45" count="20" timeInterval="00:02:00" />
<!-- Scenario #3: Logging an event (or recycling) based on HTTP status code(s) -->
<statusCode>
<add statusCode="500" subStatusCode="100" win32StatusCode="0" count="10" timeInterval="00:00:30"/>
</statusCode>
<!-- Scenario #4: Taking custom actions (or recycling/logging) based on memory limit -->
<memory privateBytesInKB="800000"/>
</triggers>
<!-- Scenario #1 & #2 Action -->
<actions value="Recycle"/>
<!-- Scenario #3 Action -->
<actions value="LogEvent"/>
<!-- Scenario #4 Action -->
<actions value="CustomAction">
<customAction exe="d:\home\procdump.exe" parameters="-accepteula w3wp d:\home\w3wp_PID_%1%_" />
</actions>
</monitoring>
</system.webServer>
</configuration>
<小时/>
关于java - Azure网站: The specified CGI application encountered an error and the server terminated the process,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35130780/