部署環境:
Apache 2.3 + Tomcat 6.0 羣集
Apache地址:192.168.20.206:80
tomcat1地址:192.168.20.206:8080
tomcat2地址:192.168.20.205:8080
問題描述:
直接登錄tomcat,查詢報表出現如下報錯
主要錯誤信息:
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred and anything you might have ...
More information about this error may be available in the server error log.
問題原因:
判斷爲tomcat下工程文件授權不足導致
解決方案:
執行chmod 755 -R /usr/local/tomcat/webapps/ROOT命令給文件賦權
再登錄tomcat地址,查詢報表後不再報錯,但登錄apache,查詢報表仍然有一樣的報錯;
去查看了apache/logs下的error.log日誌,發現存在如下錯誤:[Wed Nov 20 20:23:15 2013] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Nov 20 20:23:15 2013] [error] (120006)APR does not understand this error code: proxy: read response failed from 192.168.20.205:8009 (192.168.20.205)
問題原因:
1、apache的超時時間Timeout配置爲120s(2分鐘);
2、tomcat查詢報表的時間超過了2分鐘;
解決方案:
修改apache/conf下的httd.conf文件,找到
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 120
將120改爲900 (900是我根據現場需要修改的,也可以修改成其他數字,注意單位是秒)
重啓apache後,問題得到解決;