perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xyon <x...@indigorobot.com>
Subject Re: mod_perl 2.0 Handler issue
Date Wed, 12 Mar 2008 16:43:26 GMT
Got it sorted, I forgot I had removed the content_type definition from
the handler. It's always the simple things that hang ya up.



/home/perl/Myserver/Handler.pm
----------------------------------------------------
package Myserver::Handler;

#Setup some essentials
use strict;         #strict tolerance for code
use Carp;           #debugging
use diagnostics;    #more debugging
use warnings;       #more debugging

#Handler-related stuff
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => qw(OK);

sub handler {
    my $self        = shift;
    $self->content_type('text/html');
    return Apache2::Const::OK;
}

1;
----------------------------------------------------


On Wed, 2008-03-12 at 12:29 -0400, xyon wrote:
> Hello everyone,
> 
> I am writing my first mod_perl handler. I've looked at some of the docs
> online and have come up with the config/code below. However, when I go
> to visit the URL in Apache, I get a download prompt for type:
> httpd/unix-directory.
> 
> 
> 
> OS Info:
> ----------------------------------------------------
> CentOS release 4.6 (Final)
> ----------------------------------------------------
> 
> 
> 
> Package info:
> ----------------------------------------------------
> perl-5.8.8-11
> httpd-2.0.59-1.el4s1.10.el4.centos
> mod_perl-2.0.3-1.el4s1.3
> ----------------------------------------------------
> 
> 
> 
> Apache config:
> ----------------------------------------------------
> PerlRequire /etc/httpd/perl/startup.pl
> <Location /admin>
>     SetHandler modperl 
>     PerlResponseHandler Myserver::Handler
> </Location>
> ----------------------------------------------------
> 
> 
> 
> /etc/httpd/perl/startup.pl:
> ----------------------------------------------------
> use lib qw(/home/Perl/);
> 1;
> ----------------------------------------------------
> 
> 
> 
> /home/perl/Myserver/Handler.pm
> ----------------------------------------------------
> package Myserver::Handler;
> 
> #Setup some essentials
> use strict;         #strict tolerance for code
> use Carp;           #debugging
> use diagnostics;    #more debugging
> use warnings;       #more debugging
> 
> #Handler-related stuff
> use Apache2::RequestRec ();
> use Apache2::RequestIO ();
> use Apache2::Const -compile => qw(OK);
> 
> sub handler {
>     my $self        = shift;
>     return Apache2::Const::OK;
> }
> 
> 1;
> 
> ----------------------------------------------------
> 



Mime
View raw message