mod_perl problem with Apache::Registry :-/
I'm playing with mod_perl for the first time, and seem to have it installed okay etc,.. however, when I try and run a mod_perl-ized script, it barfs trying to use the Apache module. See errors below:
From apache error log:
[Wed Aug 1 10:42:46 2001] [error] [client 212.32.17.13] invalid CGI ref "/perl/navbar.cgi" in /storage/htdocs/www.perlguy.org.uk/HEADE R.shtml
If run from command line:
[Wed Aug 1 10:43:40 2001] navbar.pl: Can't locate object method "request" via package "Apache" (perhaps you forgot to load "Apache"?) at ./navbar.pl line 10.
Line 10 from navbar.pl is trying to get my Apache request info:
my $r = Apache->request();
In my httpd.conf I have:
PerlTaintCheck On
PerlRequire /storage/htdocs/startup.perl
AddHandler perl-script .pl
From apache error log:
[Wed Aug 1 10:42:46 2001] [error] [client 212.32.17.13] invalid CGI ref "/perl/navbar.cgi" in /storage/htdocs/www.perlguy.org.uk/HEADE
If run from command line:
[Wed Aug 1 10:43:40 2001] navbar.pl: Can't locate object method "request" via package "Apache" (perhaps you forgot to load "Apache"?) at ./navbar.pl line 10.
Line 10 from navbar.pl is trying to get my Apache request info:
my $r = Apache->request();
In my httpd.conf I have:
PerlTaintCheck On
PerlRequire /storage/htdocs/startup.perl
AddHandler perl-script .pl
[Error: Irreparable invalid markup ('<directory /storage/htdocs/*/perl>') in entry. Owner must fix manually. Raw contents below.]
I'm playing with mod_perl for the first time, and seem to have it installed okay etc,.. however, when I try and run a mod_perl-ized script, it barfs trying to use the Apache module. See errors below:
From apache error log:
[Wed Aug 1 10:42:46 2001] [error] [client 212.32.17.13] invalid CGI ref "/perl/navbar.cgi" in /storage/htdocs/www.perlguy.org.uk/HEADER.shtml
If run from command line:
[Wed Aug 1 10:43:40 2001] navbar.pl: Can't locate object method "request" via package "Apache" (perhaps you forgot to load "Apache"?) at ./navbar.pl line 10.
Line 10 from navbar.pl is trying to get my Apache request info:
my $r = Apache->request();
In my httpd.conf I have:
PerlTaintCheck On
PerlRequire /storage/htdocs/startup.perl
AddHandler perl-script .pl
<Directory /storage/htdocs/*/perl>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
AllowOverride None
Options +ExecCGI
</Directory>
... and /storage/htdocs/startup.perl contanis:
#!/usr/bin/perl -w
use strict;
use Apache::Registry ();
use CGI ();
CGI->compile(':all');
use CGI::Carp ();
use DBI ();
use DBD::mysql ();
1;
Apache starts up with no complaints at all in the logs, and the CPAN shell reports that I'm already running the latest versions of Apache::Registry et al. I've also tried running the following test.pl directly from a browser, but still exactly the same problem:
#!/usr/bin/perl -wT
use strict;
use Apache::Constants qw(OK);
my $r = Apache->request;
$r->content_type('text/html');
$r->sent_httpd_header;
return OK if $r->header_only;
my $remote_host = $r->get_remote_host;
my $request_time = scalar localtime $r->request_time;
my $uri = $r->uri;
my $protocol = $r->protocol;
$r->print(<<HTML);
<HTML>
<HEAD>
<TITLE>Apache::Registry Example</TITLE>
</HEAD>
<BODY>
Hello $remote_host, on $request_time you requested that I send you $uri with the $protocol protocol. Well, this is
it! Thank you for playing.
</BODY>
</HTML>
HTML
If anybody has ANY ideas I'd be VERY grateful. Please help? :)
Below is my Apache setup:
[root@bacardi /root]# httpd -V
Server version: Apache/1.3.20 (Unix)
Server built: Jul 28 2001 23:25:32
Server's Module Magic Number: 19990320:10
Server compiled with....
-D HAVE_MMAP
-D HAVE_SHMGET
-D USE_SHMGET_SCOREBOARD
-D USE_MMAP_FILES
-D USE_SYSVSEM_SERIALIZED_ACCEPT
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D SHARED_CORE
-D HTTPD_ROOT="/opt/httpd"
-D SUEXEC_BIN="/opt/httpd/bin/suexec"
-D SHARED_CORE_DIR="/opt/httpd/libexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/httpd.scoreboard"
-D DEFAULT_LOCKFILE="logs/httpd.lock"
-D DEFAULT_XFERLOG="logs/access_log"
-D DEFAULT_ERRORLOG="logs/error_log"
-D TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
-D ACCESS_CONFIG_FILE="conf/access.conf"
-D RESOURCE_CONFIG_FILE="conf/srm.conf"
[root@bacardi /root]# httpd -l
Compiled-in modules:
http_core.c
mod_vhost_alias.c
mod_env.c
mod_log_config.c
mod_mime_magic.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_info.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
mod_access.c
mod_auth.c
mod_setenvif.c
mod_perl.c
suexec: disabled; invalid wrapper /opt/httpd/bin/suexec
[root@bacardi /root]#
From apache error log:
[Wed Aug 1 10:42:46 2001] [error] [client 212.32.17.13] invalid CGI ref "/perl/navbar.cgi" in /storage/htdocs/www.perlguy.org.uk/HEADER.shtml
If run from command line:
[Wed Aug 1 10:43:40 2001] navbar.pl: Can't locate object method "request" via package "Apache" (perhaps you forgot to load "Apache"?) at ./navbar.pl line 10.
Line 10 from navbar.pl is trying to get my Apache request info:
my $r = Apache->request();
In my httpd.conf I have:
PerlTaintCheck On
PerlRequire /storage/htdocs/startup.perl
AddHandler perl-script .pl
<Directory /storage/htdocs/*/perl>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
AllowOverride None
Options +ExecCGI
</Directory>
... and /storage/htdocs/startup.perl contanis:
#!/usr/bin/perl -w
use strict;
use Apache::Registry ();
use CGI ();
CGI->compile(':all');
use CGI::Carp ();
use DBI ();
use DBD::mysql ();
1;
Apache starts up with no complaints at all in the logs, and the CPAN shell reports that I'm already running the latest versions of Apache::Registry et al. I've also tried running the following test.pl directly from a browser, but still exactly the same problem:
#!/usr/bin/perl -wT
use strict;
use Apache::Constants qw(OK);
my $r = Apache->request;
$r->content_type('text/html');
$r->sent_httpd_header;
return OK if $r->header_only;
my $remote_host = $r->get_remote_host;
my $request_time = scalar localtime $r->request_time;
my $uri = $r->uri;
my $protocol = $r->protocol;
$r->print(<<HTML);
<HTML>
<HEAD>
<TITLE>Apache::Registry Example</TITLE>
</HEAD>
<BODY>
Hello $remote_host, on $request_time you requested that I send you $uri with the $protocol protocol. Well, this is
it! Thank you for playing.
</BODY>
</HTML>
HTML
If anybody has ANY ideas I'd be VERY grateful. Please help? :)
Below is my Apache setup:
[root@bacardi /root]# httpd -V
Server version: Apache/1.3.20 (Unix)
Server built: Jul 28 2001 23:25:32
Server's Module Magic Number: 19990320:10
Server compiled with....
-D HAVE_MMAP
-D HAVE_SHMGET
-D USE_SHMGET_SCOREBOARD
-D USE_MMAP_FILES
-D USE_SYSVSEM_SERIALIZED_ACCEPT
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D SHARED_CORE
-D HTTPD_ROOT="/opt/httpd"
-D SUEXEC_BIN="/opt/httpd/bin/suexec"
-D SHARED_CORE_DIR="/opt/httpd/libexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/httpd.scoreboard"
-D DEFAULT_LOCKFILE="logs/httpd.lock"
-D DEFAULT_XFERLOG="logs/access_log"
-D DEFAULT_ERRORLOG="logs/error_log"
-D TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
-D ACCESS_CONFIG_FILE="conf/access.conf"
-D RESOURCE_CONFIG_FILE="conf/srm.conf"
[root@bacardi /root]# httpd -l
Compiled-in modules:
http_core.c
mod_vhost_alias.c
mod_env.c
mod_log_config.c
mod_mime_magic.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_info.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
mod_access.c
mod_auth.c
mod_setenvif.c
mod_perl.c
suexec: disabled; invalid wrapper /opt/httpd/bin/suexec
[root@bacardi /root]#
