You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by m m <mb...@yahoo.com> on 2000/07/13 21:03:16 UTC

newbie Location question

I sent this question a few hours ago but it hasnt
shown up on the list so please ignore if youve already
seen it.

I tried out the Apache::NavBar example from the Eagle
book and it works nicely I get a navbar in my html
pages. But the problem is now my cgis are coming out
as text as well. 
I would like to rectify the problem but more
importantly understand why this is happening.
the configuration in the example is 
<Location />
stuff
</Location>

in particular I dont understand what happens when I
request an html file as opposed to a script .cgi .pl
and how it relates to the line in NavBar.pm
$r->content-type eq 'text/html' || return DECLINED;
are scripts recognized as type text/html and is the
reason why they are not executing? or is <Location>
binding really strongly and ignoring ... argh I dont
understand whats going on.

thanks for your help.



__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail � Free email you can access from anywhere!
http://mail.yahoo.com/

Re: newbie Location question

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

On Thu, 13 Jul 2000, m m wrote:

> I sent this question a few hours ago but it hasnt shown up

Oh yes it has:)

> But the problem is now my cgis are coming out as text as well.

It's only doing what you told it to do:)

> I would like to rectify the problem but more importantly understand
> why this is happening.

Good man!  There are several semi-unrelated topics to get to grips
with: your OS; HTML/HTTP/DNS/networky stuff; Apache, and particularly
its configuration and the use of modules; Perl/CGI/etc; and of course
mod_perl (just another Apache module) itself - more configuration,
unfortunately, some of which confuses people terribly because it's not
always clear where you stop configuring Apache and where you start
configuring mod_perl.

> in particular I dont understand what happens when I request an html
> file as opposed to a script .cgi .pl

Read the Eagle Book chapters 1-4 again.  Admittedly it's tough for a
newcomer, but it's worth persevering with the whole book.  I've lost
count of the number of times I've been back to it to clarify things.
You might want to get hold of a good book on Apache too.  The Apache
documentation is fairly complete but kinda dense.  I've seen good
reports about "Professional Apache" ISBN 1-861003-02-1 although it was
less useful as a reference than I was hoping when I found it on the
shelves of a Client recently.  I'd buy it if I thought I was ever
going to get time to read it.

> and how it relates to the line in NavBar.pm $r->content-type eq
> 'text/html' || return DECLINED; are scripts recognized as type
> text/html and is the reason why they are not executing?

Scripts normally *produce* output.  They aren't (normally:) output in
themselves so it doesn't make sense to talk about them being
recognized as text/html.  You tell Apache what kind of output they are
producing by some means.  You also have to tell Apache where to find
them, what is allowed and what not (e.g. whether scripts can be
executed in a certain place, whether .htaccess files can override the
defaults), and stuff like that.  Have a look in your httpd.conf to see
how it tells Apache how to handle certain types of file, certain
Locations, Directories, etc.  Then of course there's your normal
operating system permissions and things which people know about but
seem to forget in all the excitement.

> or is <Location> binding really strongly and ignoring

My strong feeling is that nothing is being ignored by accident.  Of
course things can be ignored on purpose, even if you caused that by
accident. :o

> argh I dont understand whats going on.

Don't worry, this is perfectly normal at first.  Stick with it.

73,
Ged.