Error 20014 with mod_proxy

apache-2.2mod-proxy

I have strange situation. I need to call a program in cgi-bin from within a perl script. When I try to do that with exec($program), I get

(20014)Internal error: proxy: error reading status line from remote server
proxy: Error reading from remote server returned by ...

The long story… I am calling mapserv (http://mapserver.org) as a cgi program from OpenLayers (http://openlayers.org). Ordinarily, my web site is served by Perl Dancer, but the mapserver calls are made directly to http://server/cgi-bin/mapserv from JavaScript. The Dancer web site is served by Starman behind an Apache2 proxy front-end. This is how it looks

[browser] -> http://server/app -> [apache2] -> proxy port 5000 -> Starman
    |
    |
    +-> http://server/cgi-bin/mapserv -> [apache2] -> cgi-bin -> mapserv

This is what I am trying to accomplish

[browser] -> http://server/app -> [apache2] -> proxy port 5000 -> Starman
                                                                    |
                                                                    |
                               mapserv <-- cgi-bin <-- [apache2] <--+

I saw this question re: 20014 error, but that suggested solution didn't help.

Any other hints?

Best Answer

I'm not sure which version of Apache are you using. I've had a similar issue with Apache 2.2.22, and Apache's documentation suggests the following:

proxy-initial-not-pooled

If this variable is set no pooled connection will be reused if the client connection is an initial connection. This avoids the "proxy: error reading status line from remote server" error message caused by the race condition that the backend server closed the pooled connection after the connection check by the proxy and before data sent by the proxy reached the backend. It has to be kept in mind that setting this variable downgrades performance, especially with HTTP/1.0 clients.

But i'm not sure if that will resolve your issue.

Related Topic