You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rodger Castle <ro...@profocusdesigns.com> on 2005/03/09 09:03:47 UTC

mod_perl/Apache troubles with cell phone

I've been pulling my hair out this evening trying to resolve a problem serving content to a cell phone.

Phone is a LG VX-4500.  I've written a simple handler as a start to just send "Hello" to the phone along with a Content-Length and Connection: Close header but the phone just times out.  With a browser, all is well.  File-based (non mod_perl) content gets to the phone fine, it's only the mod_perl content that is timing  out.  I can see the requests coming and going in the logs.  It looks like the data just never gets sent back to the phone.

Running:
Debian Sarge
Apache 2.0.52
mod_perl2

Any thoughts on this would be appreciated.

Rodger

Re: mod_perl/Apache troubles with cell phone

Posted by Stas Bekman <st...@stason.org>.
Rodger Castle wrote:
> I've been pulling my hair out this evening trying to resolve a problem
> serving content to a cell phone.
> 
> Phone is a LG VX-4500. I've written a simple handler as a start to just
> send "Hello" to the phone along with a Content-Length and Connection:
> Close header but the phone just times out. With a browser, all is well.
> File-based (non mod_perl) content gets to the phone fine, it's only the
> mod_perl content that is timing out. I can see the requests coming and
> going in the logs. It looks like the data just never gets sent back to the
> phone.

> Running:
> Debian Sarge
> Apache 2.0.52
> mod_perl2
> 
> Any thoughts on this would be appreciated.

Rodger, you will need to send me one of those toys if you want me to test 
it for you :)

Seriously, you provide too little information to work with. Does your 
modperl setup work with a normal browser? What do you see in error_log and 
access_log files on those requests? Finally saying, I run mod_perl2, is 
not a way to report a problem, please take a look at:
http://perl.apache.org/bugs/



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: mod_perl/Apache troubles with cell phone

Posted by Rodger Castle <ro...@profocusdesigns.com>.
Perrin,

	My first inclination upon reading this post was "Silly, of course I checked the headers."

	However, upon doing what you suggested by putting the CGI.pm script and mod_perl version side by side in lynx, the only difference was the following header:

	Cache-Control: max-age=0 must-revalidate

	I took that out and it works fine.  Further inspection reveals that Cache-Control is apparently an HTTP1.1 feature.  I replaced it with the HTTP1.0 'Pragma: no-cache' and that worked out fine.

	Thank you so much for the suggestion.  I'm sure it was suggested before, but perhaps I just needed to time away from it to look deeper.

Rodger

On Tue, 15 Mar 2005 22:25:10 -0500
Perrin Harkins <pe...@elem.com> wrote:

> On Sat, 2005-03-12 at 18:25 -0500, Rodger Castle wrote:
> > I got around the immediate problem by a per-file <Location> directive
> > for the particular script in question and writing it with CGI.pm with
> > no problems.
> 
> This almost certainly means that your mod_perl script is not sending out
> the right headers.  Look at the complete response headers using GET or
> lynx or something and compare them to see what's missing in your
> mod_perl script.
> 
> - Perrin
> 
> 

Re: mod_perl/Apache troubles with cell phone

Posted by Perrin Harkins <pe...@elem.com>.
On Sat, 2005-03-12 at 18:25 -0500, Rodger Castle wrote:
> I got around the immediate problem by a per-file <Location> directive
> for the particular script in question and writing it with CGI.pm with
> no problems.

This almost certainly means that your mod_perl script is not sending out
the right headers.  Look at the complete response headers using GET or
lynx or something and compare them to see what's missing in your
mod_perl script.

- Perrin


Re: mod_perl/Apache troubles with cell phone

Posted by Rodger Castle <ro...@profocusdesigns.com>.
Thanks to all for all the suggestions.  I've been afk for a couple days.

This particular phone uses a 'standard' html browser, i.e. the content doesn't have to be wml.  We've worked with a few of these before now.

I got around the immediate problem by a per-file <Location> directive for the particular script in question and writing it with CGI.pm with no problems.

In response to some other suggestions on this thread, the access log shows the same entry for the cell phone as it does with a normal browser (IE, Opera and Firefox) with the exception of User Agent.  There are no entries in the error log for these requests.

I'll be reviewing the suggestions made and posting my results to this thread as soon as I get settled back in from my trip.  8 hours in a van with 2 toddlers is a bit distracting.

Again, thanks for all the help.

Rodger

On Wed, 09 Mar 2005 10:16:02 -0800
Ofer Nave <on...@shopzilla.com> wrote:

> Rodger Castle wrote:
> 
> >I've been pulling my hair out this evening trying to resolve a problem serving content to a cell phone.
> >
> >Phone is a LG VX-4500.  I've written a simple handler as a start to just send "Hello" to the phone along with a Content-Length and Connection: Close header but the phone just times out.  With a browser, all is well.  File-based (non mod_perl) content gets to the phone fine, it's only the mod_perl content that is timing  out.  I can see the requests coming and going in the logs.  It looks like the data just never gets sent back to the phone.
> >
> >Running:
> >Debian Sarge
> >Apache 2.0.52
> >mod_perl2
> >
> >Any thoughts on this would be appreciated.
> >
> >Rodger
> >  
> >
> The first step is setting up a static wml file - a tiny hello world file 
> named index.wml (make sure it has a .wml extension).  Now try to view 
> that.  If that doesn't work, you're problem has nothing to do with 
> mod_perl.  If it does, then you've got more work to do.  And if you've 
> done this already... sorry to waste your time.  :)  And if your phone 
> has a normal web browser instead of a WAP browser, ignore this 
> entirely... but I'm assuming you're using a WAP browser.
> 
> I'm far from an expert, as I just started playing with WAP and WML a few 
> weeks ago, but unless content-type isn't coming out correctly, your 
> issue isn't mod_perl related.  You're best bet is to hit a 
> WAP/WML-specific forum or mailing list for help.
> 
> Ultimately, when in doubt, try things in static pages first, and when 
> you get that working, try the same thing under mod_perl.  If that 
> doesn't work, use telnet to connect to your web server and request the 
> document to see what exactly it's doing.  After that, it's likely to be 
> obvious.
> 
> -ofer
> 
> 
>