Mailing List Archive

[mod_backhand-users] Blank Page Returned by Mod_perl Backend
Hi,

Using mod_backhand frontend and mod_perl backend (on 127.0.0.1), I'm
getting behavior I don't understand with this simple script:

#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "This is a test\n\n";
exit;

1. If the script is NOT handed off to the backend, the browser shows:
This is a test

2. If the script is handed off to the backend, the browser show a blank
page.

3. If I go directly to the backend, the browser shows:
Content-type: text/html This is a test

I'd like to get the same output on 2 as I do on 1.

Can anyone help?

Thanks!

Bob Foster
[mod_backhand-users] Blank Page Returned by Mod_perl Backend [ In reply to ]
Bob Foster wrote:
> Using mod_backhand frontend and mod_perl backend (on 127.0.0.1), I'm
> getting behavior I don't understand with this simple script:
>
> #!/usr/local/bin/perl
> print "Content-type: text/html\n\n";
> print "This is a test\n\n";
> exit;
>
> 1. If the script is NOT handed off to the backend, the browser shows:
> This is a test
>
> 2. If the script is handed off to the backend, the browser show a blank
> page.
>
> 3. If I go directly to the backend, the browser shows:
> Content-type: text/html This is a test

If you go directly to the backend and you get Content-type: text/html This is
a test -- all on one line, you have a problem outside mod_backhand.

You asy you are using mod_perl. That perl script would be "BAD" if it is a
perl handler. I can only assume that it is running as a plain old vanilla CGI
script and mod_perl isn't handling it. Otherwise that exit is going to get you.

Symptom (2) makes sense given your symptom (3).

--
Theo Schlossnagle
1024D/82844984/95FD 30F1 489E 4613 F22E 491A 7E88 364C 8284 4984
2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7
[mod_backhand-users] Blank Page Returned by Mod_perl Backend [ In reply to ]
--8HhMLSHvAouSipEr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> > #!/usr/local/bin/perl
> > print "Content-type: text/html\n\n";
> > print "This is a test\n\n";
> > exit;
> >=20
> > 1. If the script is NOT handed off to the backend, the browser shows:
> > This is a test
> >=20
> > 2. If the script is handed off to the backend, the browser show a blank
> > page.
> >=20
> > 3. If I go directly to the backend, the browser shows:
> > Content-type: text/html This is a test=20
>=20
> If you go directly to the backend and you get Content-type: text/html Thi=
s is=20
> a test -- all on one line, you have a problem outside mod_backhand.
>=20
> You asy you are using mod_perl. That perl script would be "BAD" if it is=
a=20
> perl handler. I can only assume that it is running as a plain old vanill=
a CGI=20
> script and mod_perl isn't handling it. Otherwise that exit is going to g=
et you.
>=20
> Symptom (2) makes sense given your symptom (3).

Try the following as a .pl file (depending on your httpd.conf=20
that is):

#!/usr/bin/perl -w

use strict;
use Apache;
use Apache::Constants (':response');

my $r =3D shift;
$r->send_http_header('text/html');
return(OK) if $r->header_only;

$r->print("This is a test\n");



-sc

--=20
Sean Chittenden

--8HhMLSHvAouSipEr
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Comment: Sean Chittenden <sean@chittenden.org>

iEYEARECAAYFAjtzGiYACgkQn09c7x7d+q1kDwCeJ0ZlnPb7RCBiqIkblmyh+6HV
x/8AoM5ssM3peygQPK2Cvnep0Oosdeo6
=syoB
-----END PGP SIGNATURE-----

--8HhMLSHvAouSipEr--