2011-11-03 71 views
3

我使用Apache作为代理服务器。当我的web应用程序发送一个500错误代码为响应AJAX调用,阿帕奇显示它自己默认的内部错误消息Apache覆盖500个HTTP状态码响应

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 
<html><head> 
<title>500 Internal Server Error</title> 
</head><body> 
<h1>Internal Server Error</h1> 
<p>The server encountered an internal error or 
misconfiguration and was unable to complete 
your request.</p> 
<p>Please contact the server administrator, 
[email protected] and inform them of the time the error occurred, 
and anything you might have done that may have 
caused the error.</p> 
<p>More information about this error may be available 
in the server error log.</p> 
</body></html> 

是否有办法避免这种情况,从而使错误响应亘古不得到由Apache服务器蜕变。

回答

0

检查您的httpd.conf文件中Apache存储错误的位置。 然后您可以tail error.log查看最新的错误或cat error.log查看所有错误。

如果没有错误,vim offending.file.ext查看是否有错误。可能是行结束或语法错误。

否则,我建议让我们看看代码。

0

我有一个类似的问题,我用的是代码:(PHP)

header("HTTP", true, 500); 

代替

header("HTTP/1.0 500 Internal Server Error"); 

我的本地XAMPP服务器上,但不能在某些其他服务器的第一个工作,切换到HTTP/1.0响应而不是在两者上工作。

相关问题