douguiyan9164 2014-04-27 00:43
浏览 48
已采纳

长时间运行的程序超过DMZ代理错误

I have set up a DMZ to run a web site. Most of the code is on an application server running Debian Release 7.0 (wheezy) 64-bit. I also have a web server running CentOS 6.5. It acts as a proxy for the application server. I have set up LAMP on both and my web pages are written in PHP. A PHP script on the web server calls a PHP script on the application server. The application server script calls a long running (> 1 minute) executable (that had been developed in C++). After 60 seconds (timed by my watch), the script fails with the following message.

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /appServer/scriptName.php.

Reason: Error reading from remote server

Apache/2.2.15 (CentOS) Server at sitename.com Port 80

I commented out code in the application server PHP script and narrowed the problem down to the long-running C++ executable. I also ran the executable in the shell without any problems. So there is clearly a time-out issue and it seems to be associated with the web server. I have only recently replaced an old version of Ubuntu, with Centos 6.5, on the web server and I did not have this problem before I did that. Also, the PHP code is the same as before I made the switch and it did not give me this problem prior to that. So I am convinced that the problem lies with something on the web server and one of the setting I have, with php or apache, on the new system.

I edited /etc/php.ini, on the web server, and changed all of the uncommented-out 60 second time limits (max_input_time, default_socket_timeout, mysql.connect_timeout) from 60 seconds to 600 seconds. I still get the above proxy error after 60 seconds.

  • 写回答

1条回答 默认 最新

  • dongtang7347 2014-04-27 17:45
    关注

    Solution.

    On the (CentOS) web server, edit /etc/httpd/conf/httpd.conf

    Include the line

    ProxyPass       /appServer/  http://[private IP address]/ timeout=600 Keepalive=On
    

    Specifically add the

    timeout=600 Keepalive=On
    

    part.

    I also restarted apache to be on the safe side.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!