PLEASE HELP.....

I am trying to get Apache::Hello to work. I saved it as Hello.pm in
lib/perl/Apache. Below are my setup files and pertinent info. When I access
the virtual location (hello/world) from Apache's root directory, my browser
returns the following message: "The document contains no data." I can
successfully run Apache's built-in server-status module. I don't receive any
errors when starting Apache and don' t see any errors in the logs. Any
suggestions?

Apache Version 1.3.9
mod_perl Version 1.26
Perl Version 5.6.1

# vi startup.pl
"startup.pl" 19 lines, 372 characters
#!/usr/local/bin/perl

# modify the include path before we do anything else
BEGIN {
   use Apache ();
   use lib Apache->server_root_relative('lib/perl');
}

# commonly used modules
use Apache::Registry ();
use Apache::Constants ();
use CGI qw(-compile :all);
use CGI::Carp ();

# put any other common modules here
# use Apache::DBI ();
# use LWP ();
# use DB_File ();
1;

# vi perl.conf
"perl.conf" 10 lines, 318 characters
#Tells Apache to load and run the startup script when it is first launched.
PerlRequire             conf/startup.pl
PerlFreshRestart        On

###I also tried this in httpd.conf because it was not working and
server-status is in httpd.conf
<Location /hello/world>
   SetHandler   perl-script
   PerlHandler  Apache::Hello
</Location>

# vi Hello.pm
"Hello.pm" 26 lines, 392 characters
package Apache::Hello;
# File: Apache/Hello.pm

use strict;
use Apache::Constants qw(:common);

sub handler {
   my $r = shift;
   $r->content-type('text/html');
   $r->send_http_header;
   my $host = $r->get_remote_host;
   $r->print(<<END);
<HTML>
<HEAD>
<TITLE>Hello There</TITLE>
</HEAD>
<BODY>
<H1>Hello $host</H1>
Who would take this book seriously if the first example didn't
say "hello world"?
</BODY>
</HTML>
END
   return OK;
}

1;

Thanks, Ray

Reply via email to