You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ian Macdonald <ic...@primus.com.au> on 2002/05/13 10:57:07 UTC
Proxied mod_perl server problem
Hi All.
I'm setting up a new server and wish to run two Apache configurations,
one vanilla and one mod_perl. I've configured pretty much according to
Stas' excellent guide, using the rewrite module to push the perl
requests to the second (ie mod_perl) server.
Versions; HP-UX 10.20, Apache 1.3.24, mod_perl 1.26.
It's _nearly_ working, but I'm getting one weird piece of behaviour
which looks to me like the sort of problem someone with more experience
will recognise very swiftly; when I request a perl script via the
mod_perl-enabled locations, the content is preceded by a hex number,
which corresponds very closely to the size of the content, and then a
blank line, as shown below:
4e9
PID = 3282
DOCUMENT_ROOT="/opt/web_root/html"
GATEWAY_INTERFACE="CGI-Perl/1.1"
etc.
The browser displays the wait cursor for about 15 seconds and then
follows the content (which is correct) with another blank line and then
a zero:
...
SERVER_SOFTWARE="Apache/1.3.24 (Unix) mod_perl/1.26"
TZ="EST-10EDT"
0
The script works correctly from the command line, or if the mod_perl
server port is accessed directly from the browser, or if the mod_perl
server is started without proxying enabled.
This looks to me as if two parts of the system are contributing the same
header information, or if two protocol layers are being added in the
wrong order, or something like that.
Thanks for any tips.
Ian Macdonald
ickphum@primus.com.au
Here's the rewrite config chunk from the main apache:
RewriteEngine On
RewriteLogLevel 0
RewriteRule ^proxy:.* - [F]
RewriteRule ^/perl/(.*) http://%{HTTP_HOST}:8200/perl/$1 [P,L]
RewriteRule ^/cgi-perl/(.*) http://%{HTTP_HOST}:8200/cgi-perl/$1 [P,L]
ProxyPassReverse / http://%{HTTP_HOST}/
Here's the /perl/ location config from the mod_perl apache
<Location /perl/*.pl>
SetHandler perl-script
PerlHandler Apache::Registry
Options -Indexes ExecCGI
PerlSendHeader On
</Location>
open3 does not proper work in mod_perl context
Posted by Silvio Wanka <Si...@alcatel.de>.
Hi,
I will upgrade from
Embedded Perl version 5.00502 for Apache/1.3.6 (Unix) mod_perl/1.19
to
Embedded Perl version v5.6.1 for Apache/1.3.23 (Unix) mod_perl/1.26
But now all mod_perl scripts which uses IPC::Open3::open3() fails
because STDIN of the new process is closed. I have done some test
and found that
print(join "\n", fileno(STDIN), fileno(STDOUT), fileno(STDERR), '' );
shows
1
1
2
and not the expected
0
1
2
open3 calls
xopen \*STDIN, "<&=" . fileno $kid_rdr;
but because fileno(STDOUT) is equal to fileno(STDIN) the new fileno
of STDIN after the dup will be greater than 2 and so closed by the
exec call but also as 1 it would not work.
Is this a known problem?
regards, Silvio
Re: Proxied mod_perl server problem
Posted by Andrew McNaughton <an...@scoop.co.nz>.
The problem occurs because when the apache proxy recieves an HTTP/1.0
request it sends an HTTP/1.1 request to the upstream server. The response
then comes back with 'Transfer-encoding: chunked' and until a fix was put
in, the transfer encoding was not changed in sending the HTTP/1.0 response
back, despite it's not being compatible with browsers using HTTP/1.0.
You can get around the problem by forcing apache to use HTTP/1.0, at the
expense of the keep-alive efficiencies you'd get from HTTP/1.1
To my way of thinking apache's proxying a HTTP/1.0 request by sending an
HTTP/1.1 upstream is just plain incorrect. It denies the upstream server
the opportunity to correctly select a whole range of headers that have
changed between protocol versions.
Also, what on earth is going on with MSIE 6.0 regressing to using HTTP/1.0
requests?
Andrew McNaughton
On Fri, 24 May 2002, Pedro Melo Cunha wrote:
> Date: Fri, 24 May 2002 01:04:45 +0100
> From: Pedro Melo Cunha <me...@isp.novis.pt>
> To: Ian Macdonald <ic...@primus.com.au>
> Cc: Modperl <mo...@perl.apache.org>
> Subject: Re: Proxied mod_perl server problem
>
> upgrade to cvs version of apache on the proxy. cvs version solveds this problem.
>
> best regards,
>
> On Mon, May 13, 2002 at 06:57:07PM +1000, Ian Macdonald wrote:
> > Hi All.
> >
> > I'm setting up a new server and wish to run two Apache configurations,
> > one vanilla and one mod_perl. I've configured pretty much according to
> > Stas' excellent guide, using the rewrite module to push the perl
> > requests to the second (ie mod_perl) server.
> >
> > Versions; HP-UX 10.20, Apache 1.3.24, mod_perl 1.26.
> >
> > It's _nearly_ working, but I'm getting one weird piece of behaviour
> > which looks to me like the sort of problem someone with more experience
> > will recognise very swiftly; when I request a perl script via the
> > mod_perl-enabled locations, the content is preceded by a hex number,
> > which corresponds very closely to the size of the content, and then a
> > blank line, as shown below:
> >
> > 4e9
> >
> > PID = 3282
> > DOCUMENT_ROOT="/opt/web_root/html"
> > GATEWAY_INTERFACE="CGI-Perl/1.1"
> > etc.
> >
> > The browser displays the wait cursor for about 15 seconds and then
> > follows the content (which is correct) with another blank line and then
> > a zero:
> >
> > ...
> > SERVER_SOFTWARE="Apache/1.3.24 (Unix) mod_perl/1.26"
> > TZ="EST-10EDT"
> >
> > 0
> >
> > The script works correctly from the command line, or if the mod_perl
> > server port is accessed directly from the browser, or if the mod_perl
> > server is started without proxying enabled.
> >
> > This looks to me as if two parts of the system are contributing the same
> > header information, or if two protocol layers are being added in the
> > wrong order, or something like that.
> >
> > Thanks for any tips.
> > Ian Macdonald
> > ickphum@primus.com.au
> >
> > Here's the rewrite config chunk from the main apache:
> >
> > RewriteEngine On
> > RewriteLogLevel 0
> > RewriteRule ^proxy:.* - [F]
> > RewriteRule ^/perl/(.*) http://%{HTTP_HOST}:8200/perl/$1 [P,L]
> > RewriteRule ^/cgi-perl/(.*) http://%{HTTP_HOST}:8200/cgi-perl/$1 [P,L]
> >
> > ProxyPassReverse / http://%{HTTP_HOST}/
> >
> > Here's the /perl/ location config from the mod_perl apache
> >
> > <Location /perl/*.pl>
> > SetHandler perl-script
> > PerlHandler Apache::Registry
> > Options -Indexes ExecCGI
> > PerlSendHeader On
> > </Location>
> >
> >
>
> --
> Pedro Melo Cunha - <me...@isp.novis.pt>
> Novis Telecom, S.A. - Dir. Rede - ISP <http://www.novis.pt/>
> Edif�cio Novis - Estrada da Outurela, 118 - 2795-606 Carnaxide
> tel: +351 21 0104340 - fax: +351 21 0104301
>
Re: Proxied mod_perl server problem
Posted by Pedro Melo Cunha <me...@isp.novis.pt>.
upgrade to cvs version of apache on the proxy. cvs version solveds this problem.
best regards,
On Mon, May 13, 2002 at 06:57:07PM +1000, Ian Macdonald wrote:
> Hi All.
>
> I'm setting up a new server and wish to run two Apache configurations,
> one vanilla and one mod_perl. I've configured pretty much according to
> Stas' excellent guide, using the rewrite module to push the perl
> requests to the second (ie mod_perl) server.
>
> Versions; HP-UX 10.20, Apache 1.3.24, mod_perl 1.26.
>
> It's _nearly_ working, but I'm getting one weird piece of behaviour
> which looks to me like the sort of problem someone with more experience
> will recognise very swiftly; when I request a perl script via the
> mod_perl-enabled locations, the content is preceded by a hex number,
> which corresponds very closely to the size of the content, and then a
> blank line, as shown below:
>
> 4e9
>
> PID = 3282
> DOCUMENT_ROOT="/opt/web_root/html"
> GATEWAY_INTERFACE="CGI-Perl/1.1"
> etc.
>
> The browser displays the wait cursor for about 15 seconds and then
> follows the content (which is correct) with another blank line and then
> a zero:
>
> ...
> SERVER_SOFTWARE="Apache/1.3.24 (Unix) mod_perl/1.26"
> TZ="EST-10EDT"
>
> 0
>
> The script works correctly from the command line, or if the mod_perl
> server port is accessed directly from the browser, or if the mod_perl
> server is started without proxying enabled.
>
> This looks to me as if two parts of the system are contributing the same
> header information, or if two protocol layers are being added in the
> wrong order, or something like that.
>
> Thanks for any tips.
> Ian Macdonald
> ickphum@primus.com.au
>
> Here's the rewrite config chunk from the main apache:
>
> RewriteEngine On
> RewriteLogLevel 0
> RewriteRule ^proxy:.* - [F]
> RewriteRule ^/perl/(.*) http://%{HTTP_HOST}:8200/perl/$1 [P,L]
> RewriteRule ^/cgi-perl/(.*) http://%{HTTP_HOST}:8200/cgi-perl/$1 [P,L]
>
> ProxyPassReverse / http://%{HTTP_HOST}/
>
> Here's the /perl/ location config from the mod_perl apache
>
> <Location /perl/*.pl>
> SetHandler perl-script
> PerlHandler Apache::Registry
> Options -Indexes ExecCGI
> PerlSendHeader On
> </Location>
>
>
--
Pedro Melo Cunha - <me...@isp.novis.pt>
Novis Telecom, S.A. - Dir. Rede - ISP <http://www.novis.pt/>
Edifício Novis - Estrada da Outurela, 118 - 2795-606 Carnaxide
tel: +351 21 0104340 - fax: +351 21 0104301
Re: Proxied mod_perl server problem
Posted by Igor Sysoev <is...@rambler-co.ru>.
On Mon, 13 May 2002, Ian Macdonald wrote:
> I'm setting up a new server and wish to run two Apache configurations,
> one vanilla and one mod_perl. I've configured pretty much according to
> Stas' excellent guide, using the rewrite module to push the perl
> requests to the second (ie mod_perl) server.
>
> Versions; HP-UX 10.20, Apache 1.3.24, mod_perl 1.26.
>
> It's _nearly_ working, but I'm getting one weird piece of behaviour
> which looks to me like the sort of problem someone with more experience
> will recognise very swiftly; when I request a perl script via the
> mod_perl-enabled locations, the content is preceded by a hex number,
> which corresponds very closely to the size of the content, and then a
> blank line, as shown below:
>
> 4e9
>
> PID = 3282
> DOCUMENT_ROOT="/opt/web_root/html"
> GATEWAY_INTERFACE="CGI-Perl/1.1"
> etc.
Your backend send chunked response - I think you use 1.3.24 mod_proxy
and it probably send HTTP/1.1 request.
You should force mod_perl to HTTP/1.0
Another way is to use mod_accel. It always uses HTTP/1.0 with backend
and more advanced then mod_proxy.
Igor Sysoev
http://sysoev.ru