You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Greg Leidreiter <ge...@ozemail.com.au> on 2000/07/11 13:17:48 UTC

The Eagle has landed!

I am trying to work my way through Stein and MacEachern but having a few
teething troubles.
I am following the example code in Chapter 2 faithfully, have build and
installed mod_perl
(which now appears under httpd -l) and modified the configuration files
according to the suggestions in the book. ie:

Perl 5.6.0
Apache 1.3.12
mod_perl-1.24

ServerRoot is /usr/local/apache
underneath which I have created the lib/perl/Apache tree for holding
mod_perl modules,
and dutifully entered the required code in a file called Hello.pm in this
directory.

DocumentRoot is /usr/local/apache/htdocs

in httpd.conf I have added the following:
------------------------------
<IfModule mod_perl.c>
	Include conf/perl.conf
</IfModule>
------------------------------


conf/perl.conf looks like this:
------------------------------
PerlRequire conf/startup.pl
PerlFreshRestart On

<Location /hello/world>
	SetHandler perl-script
	PerlHandler Apache::Hello
</Location>

-------------------------------

and startup.pl looks like this:
-------------------------------
#!/usr/local/bin/perl

print "\n\tstartup.pl is attempting to modify the include path...\n\n";

BEGIN {
	use Apache();
	use lib Apache->server_root_relative('lib/perl');
}

use Apache::Registry
use Apache::Constants
use CGI qw(-compile :all);
use CGI::Carp;

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

which I understood was going to update @INC to include my new module
library, and the <Location /hello/world> directive would realise that
Apache::Hello refered to <ServerRoot>/lib/perl/Apache/Hello.pm...

However, when attempting to access http://localhost/hello/world from a
browser it returns 404, and the errorlog shows the /hello/world URL appended
to DocumentRoot, so of course it can't find anything, it's expecting to find
a <DocumentRoot>/hello/world! Clearly I have misunderstood something here
but the Apache manual assures me that arguments to <Location>
are completely independent of the file system... any ideas?

Thanks,
Greg


Re: The Eagle has landed!

Posted by "G.W. Haywood" <ge...@jubileegroup.co.uk>.
Hi there,

On Tue, 11 Jul 2000, Greg Leidreiter wrote:

> when attempting to access http://localhost/hello/world from a
> browser it returns 404, and the errorlog shows the /hello/world URL appended
> to DocumentRoot

> any ideas?

Is there an `Alias' directive somewhere in your config?

73,
Ged.





Re: The Eagle has landed!

Posted by "G.W. Haywood" <ge...@jubileegroup.co.uk>.
Hi there,

On Tue, 11 Jul 2000, Greg Leidreiter wrote:

> when attempting to access http://localhost/hello/world from a
> browser it returns 404, and the errorlog shows the /hello/world URL appended
> to DocumentRoot

> any ideas?

Is there an `Alias' directive somewhere in your config?

73,
Ged.