You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Michael Yoon <mi...@yoon.com> on 2002/01/18 02:14:38 UTC

browser can't render output produced by Apache::ASP

Hi,

I just started using Apache::ASP, and and I'm experiencing a strange
problem:

When I try to view any .asp page on my server, my browser (Microsoft IE 6)
displays nothing. In trying to debug this, I've ended up with a test.asp
page that contains only plain text (specifically, "Hello, world"), no <% %>
tags whatsoever. Even still, when I request that page, IE shows nothing. (I
also tried Opera, which did something even stranger - it automatically
re-requests the page several times and then gives up, reporting this error:
"Repeated attempts failed to load this page completely.")

My .htaccess file is pretty minimal:

    <Files ~ (\.asp)>
      SetHandler  perl-script
      PerlModule  Apache::ASP
      PerlHandler Apache::ASP
      PerlSetVar  Global .
      PerlSetVar  NoState 1
    #  PerlSetVar  StateDir /tmp/asp
    </Files>

When I looked in Apache's error_log, no errors were reported, so I decided
to use lwp-request, to take a look at the raw HTTP response. Here's what it
shows:

    $ lwp-download -S -e http://www.jessicamd.com/test.asp
    GET http://www.jessicamd.com/test.asp --> 200 OK
    Cache-Control: private
    Connection: close
    Date: Fri, 18 Jan 2002 00:57:20 GMT
    Server: Apache/1.3.22 (Unix) mod_gzip/1.3.19.1a mod_perl/1.26
mod_bwlimited/0.8 PHP/4.1.0 mod_log_bytes/0.3 FrontPage/5.0.2.2510
mod_ssl/2.8.5 OpenSSL/0.9.6b
    Content-Length: 13
    Content-Type: text/html
    Client-Date: Fri, 18 Jan 2002 00:57:20 GMT
    Client-Response-Num: 1

    Hello, world.

This looks like a perfectly valid HTTP response to me, but my browser(s)
disagree.

I even copied test.asp to test.txt, and ran lwp-request on it, to compare:

    $ lwp-request -S -e http://www.jessicamd.com/test.txt
    GET http://www.jessicamd.com/test.txt --> 200 OK
    Connection: close
    Date: Fri, 18 Jan 2002 01:00:16 GMT
    Accept-Ranges: bytes
    ETag: "2f81e9-d-3c476892"
    Server: Apache/1.3.22 (Unix) mod_gzip/1.3.19.1a mod_perl/1.26
mod_bwlimited/0.8 PHP/4.1.0 mod_log_bytes/0.3 FrontPage/5.0.2.2510
mod_ssl/2.8.5 OpenSSL/0.9.6b
    Content-Length: 13
    Content-Type: text/plain
    Last-Modified: Fri, 18 Jan 2002 00:13:06 GMT
    Client-Date: Fri, 18 Jan 2002 01:00:16 GMT
    Client-Response-Num: 1

    Hello, world.

To my eyes, these responses look pretty similar. The only differences that I
see appear to be harmless. The .asp response has one extra header
(Cache-Control) while the .txt response has three extra headers:
Accept-Ranges, ETag, and Last-Modified. Could any of these be the culprit?

I'm sure I'm missing something really obvious, but I'm stumped. Ideas?

Thanks in advance,
Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: browser can't render output produced by Apache::ASP

Posted by Joshua Chamas <jo...@chamas.com>.
Michael Yoon wrote:
> 
> Thanks, Philip! That was the problem.
> 
> I added "mod_gzip_on No" in my .htaccess file, and my .asp files now work.
> 
> Of course, I would like to get mod_gzip *and* Apache::ASP working together,
> but that can wait...
> 
> Thanks again,
> Michael

Philip is a very smart guy :)

One can gzip compress Apache::ASP output with

  PerlSetVar CompressGzip 1

this functionality is handled by the module directly.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


RE: browser can't render output produced by Apache::ASP

Posted by Michael Yoon <mi...@yoon.com>.
Thanks, Philip! That was the problem.

I added "mod_gzip_on No" in my .htaccess file, and my .asp files now work.

Of course, I would like to get mod_gzip *and* Apache::ASP working together,
but that can wait...

Thanks again,
Michael

> -----Original Message-----
> From: Philip Mak [mailto:pmak@aaanime.net]
> Sent: Thursday, January 17, 2002 8:17 PM
> To: Michael Yoon
> Cc: asp@perl.apache.org
> Subject: Re: browser can't render output produced by Apache::ASP
>
>
> I think mod_gzip is breaking Apache::ASP. Check this out (notice that
> I put "Accept-Encoding: gzip" in my request header; if I don't include
> this header, it works):
>
> $ telnet www.jessicamd.com 80
> Trying 64.119.173.35...
> Connected to jessicamd.com.
> Escape character is '^]'.
> GET /test.asp HTTP/1.1
> Host: jessicamd.com
> Accept-Encoding: gzip
>
> HTTP/1.1 200 OK
> Date: Fri, 18 Jan 2002 01:13:27 GMT
> Server: Apache/1.3.22 (Unix) mod_gzip/1.3.19.1a mod_perl/1.26
> mod_bwlimited/0.8 PHP/4.1.0 mod_log_bytes/0.3 FrontPage/5.0.2.2510
> mod_ssl/2.8.5 OpenSSL/0.9.6b
> Content-Length: 13
> Cache-Control: private
> Connection: close
> Content-Type: text/html
>
> Connection closed by foreign host.
>
> Whenever Opera keeps trying to reload a page, it does it because the
> page had no data.
>
> You might try posting about this on the mod_gzip mailing list for
> help. It's probably a simple configuration issue.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: File exists on include path

Posted by Joshua Chamas <jo...@chamas.com>.
"John D. Leonard II" wrote:
> 
> All:
> 
> Any code for testing to see if a file exists along the Includes (and
> global) path?
> 
> $Response->Include( $filename)  and  $Response->TrapInclude( $filename )
> automatically scan the path, but return an error if the file is not
> found.  I want to trap this error.
> 
> Is the solution $Server->MapPath, or perhaps to expose SearchDirs
> (inside ASP.pm)?  How about something like:
> 
> $Server->FileExists( $file_to_include_before_it_is_included );
> 

Exposing Apache::ASP::SearchDirs functionality is the answer.  In 2.31,
this will be as:

  my $file_path = $Server->MapInclude($include);

It seems a similar idea to MapPath, but MapPath deals with more how
the web server would translate a URI, while MapInclude() is about how
Apache::ASP would translate an include execution.

Let me know if you would like an early release of the module.  I'll
probably release it soon anyway.  BTW, to deal with this problem
before, I have explicitly trapped errors like:

  eval { $Response->Include() }
  if($@) { # deal with missing include } 

since a missing include will trigger a die().

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


File exists on include path

Posted by "John D. Leonard II" <jo...@ce.gatech.edu>.
All:

Any code for testing to see if a file exists along the Includes (and
global) path?

$Response->Include( $filename)  and  $Response->TrapInclude( $filename )
automatically scan the path, but return an error if the file is not
found.  I want to trap this error.

Is the solution $Server->MapPath, or perhaps to expose SearchDirs
(inside ASP.pm)?  How about something like:

$Server->FileExists( $file_to_include_before_it_is_included );

JL


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: browser can't render output produced by Apache::ASP

Posted by Philip Mak <pm...@aaanime.net>.
I think mod_gzip is breaking Apache::ASP. Check this out (notice that
I put "Accept-Encoding: gzip" in my request header; if I don't include
this header, it works):

$ telnet www.jessicamd.com 80
Trying 64.119.173.35...
Connected to jessicamd.com.
Escape character is '^]'.
GET /test.asp HTTP/1.1
Host: jessicamd.com
Accept-Encoding: gzip

HTTP/1.1 200 OK
Date: Fri, 18 Jan 2002 01:13:27 GMT
Server: Apache/1.3.22 (Unix) mod_gzip/1.3.19.1a mod_perl/1.26
mod_bwlimited/0.8 PHP/4.1.0 mod_log_bytes/0.3 FrontPage/5.0.2.2510
mod_ssl/2.8.5 OpenSSL/0.9.6b
Content-Length: 13
Cache-Control: private
Connection: close
Content-Type: text/html

Connection closed by foreign host.

Whenever Opera keeps trying to reload a page, it does it because the
page had no data.

You might try posting about this on the mod_gzip mailing list for
help. It's probably a simple configuration issue.

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org