Resolving Timeout in Apache Webserver for ProxyPass Setting

Posted on

There is access to a website which is not directly passed to the server but it is facilitated with another running Apache in another server. So, when some users sending a request for that website, it will be directly passed by that running Apache Webserver in another server to the server that is actually running the web. Below is the image of how the condition actually exist :

The above condition can be implemented by using ProxyPass configuration defined in Apache Webserver configuration which is shown below :

skema-proxy-pass

Based on the log provided by Apache Webserver, it can be concluded that there are timeout which caused Error reading from remote server.

[Thu Oct 13 13:46:41 2016] [error] [client xxx.xxx.xxx.xxx] (70007)The timeout specified has expired: proxy: error reading status line from remote server 172.16.0.10, referer: http://192.168.1.100/app/page.xxx
[Thu Oct 13 13:46:41 2016] [error] [client xxx.xxx.xxx.xxx] proxy: Error reading from remote server returned by /app/page.xxx, referer: http://192.168.1.100/app/page.xxx

[Thu Oct 13 13:48:05 2016] [error] [client xxx.xxx.xxx.xxx] (70007)The timeout specified has expired: proxy: error reading status line from remote server 172.16.0.10, referer: http://192.168.1.100/app/page.xxx

[Thu Oct 13 13:48:05 2016] [error] [client xxx.xxx.xxx.xxx] proxy: Error reading from remote server returned by /app/page.xxx, referer: http://192.168.1.100/app/page.xxx

The Apache Webserver exists in server with the IP Address of 192.168.1.100 has a timeout reading from remote server located in the server with the IP Address of 172.16.0.10. Maybe it is because the connection between the two of them, or the rendering process from the server which is actually the application resides is slow so the returning process of the rendered output to the server which act as a proxy is disturbed.

To be able to resolve the above problem, there is a solution which can be performed. It is done by editing Apache Webserver configuration in the server act as a proxy by changing the Timeout parameter.

By default, Timeout is set at 60 seconds, so in order to make Apache Webserver to be able to compromise with longer time processing, the option is changed into a longer value, let’s say 300. It can be changed by editing the Apache Webserver configuration file, in this context it is located in /etc/httpd/conf/httpd.conf. Try to edit it with any text-editor available :

Timeout 60

into

Timeout 300

Save the edited file and restart Apache Webserver. See if the problem persist, but based on the comment given in the Timeout option, it is The number of seconds before receives and sends time out. Hopefully by editing the file and change the value of Timeout option the problem will go away.

Leave a Reply