You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Cliff Shaw <cb...@genforum.com> on 2000/07/27 05:45:16 UTC
ScriptAlias hacking?
HI all,
This is my first post to the list so hopefully I don't screw it up. I am
attempting to do the following with mod_perl and am stumped on
ScriptAliases.
I want to have www.foo.com/bar/ run a mod_perl script. Simple huh? yes.
Except I want to you use PATH_INFO to create directories (so to speak) in
bar. So www.foo.com/bar/test/whatever
would not look for a directory but rather call the bar script and send in
the PATH_INFO, all of this has ruled out the possibility of using an
index.cgi
Any help?
Thanks
Cliff
Re: ScriptAlias hacking?
Posted by ___cliff rayman___ <cl...@genwax.com>.
i am not positive i understand your question or problem.
the place to look is in the mod_perl guide.
try here first:
http://perl.apache.org/guide/config.html#Alias_Configurations
cliff
--
___cliff rayman___cliff@genwax.com___http://www.genwax.com/
Cliff Shaw wrote:
> HI all,
>
> This is my first post to the list so hopefully I don't screw it up. I am
> attempting to do the following with mod_perl and am stumped on
> ScriptAliases.
>
> I want to have www.foo.com/bar/ run a mod_perl script. Simple huh? yes.
> Except I want to you use PATH_INFO to create directories (so to speak) in
> bar. So www.foo.com/bar/test/whatever
> would not look for a directory but rather call the bar script and send in
> the PATH_INFO, all of this has ruled out the possibility of using an
> index.cgi
>
> Any help?
> Thanks
> Cliff
Re: ScriptAlias hacking?
Posted by ___cliff rayman___ <cl...@genwax.com>.
lots of us are using Alias with PATH_INFO. We are just not using ScriptAlias
because that invokes mod_cgi instead of mod_perl.
--
___cliff rayman___cliff@genwax.com___http://www.genwax.com/
Cliff Shaw wrote:
> I'd love to hear more from others about this but I believe ScriptAliasing is
> VERY MUCH ALIVE in mod_perl. I kept reading that you can't use ScriptAlias
> with mod_perl. Fine. True. But I read that as a death sentence to having
> pretty URL's with mod_perl. With that statement, it should say "To use
> ScriptAliases with mod_perl, simply rename them to Alias."
> This is what I put in my Apache 1.3.12 installation and mod_perl 1.22
> httpd.conf file:
> Alias /printer /www/circles_cgi/printenv.cgi
>
> and it works! People need to know that you can get the same effect that a
> ScriptAlias gives you with an a straight Alias, as long as you the script
> called (printenv.cgi) is flagged as a mod_perl script under a <Files> tag or
> <Location> tag.
>
> How did I get this to work? Why hasn't anyone else figured this out? Am I
> just preaching the obvious here? Sure seemed to me that any type of
> "ScriptAlias" was DEAD under mod_perl.
>
> Cliff
RE: ScriptAlias hacking?
Posted by Cliff Shaw <cb...@genforum.com>.
I'd love to hear more from others about this but I believe ScriptAliasing is
VERY MUCH ALIVE in mod_perl. I kept reading that you can't use ScriptAlias
with mod_perl. Fine. True. But I read that as a death sentence to having
pretty URL's with mod_perl. With that statement, it should say "To use
ScriptAliases with mod_perl, simply rename them to Alias."
This is what I put in my Apache 1.3.12 installation and mod_perl 1.22
httpd.conf file:
Alias /printer /www/circles_cgi/printenv.cgi
and it works! People need to know that you can get the same effect that a
ScriptAlias gives you with an a straight Alias, as long as you the script
called (printenv.cgi) is flagged as a mod_perl script under a <Files> tag or
<Location> tag.
How did I get this to work? Why hasn't anyone else figured this out? Am I
just preaching the obvious here? Sure seemed to me that any type of
"ScriptAlias" was DEAD under mod_perl.
Cliff
-----Original Message-----
From: Kenneth Lee [mailto:kenneth.lee@alfacomtech.com]
Sent: Thursday, July 27, 2000 1:02 AM
To: Cliff Shaw
Cc: modperl@apache.org
Subject: Re: ScriptAlias hacking?
if i understand correctly, you should have in your httpd.conf something
like
<Location "/bar">
SetHandler perl-script
PerlHandler Your::Handler
Options +ExecCGI
</Location>
then, in your module
package Your::Handler;
sub handler {
my $r = shift;
my $path_info = $r->path_info;
...
}
1;
i'm fairly new to mod_perl, so pls correct/criticize if there's anything
wrong.
kenneth
Cliff Shaw wrote:
>
> HI all,
>
> This is my first post to the list so hopefully I don't screw it up. I am
> attempting to do the following with mod_perl and am stumped on
> ScriptAliases.
>
> I want to have www.foo.com/bar/ run a mod_perl script. Simple huh? yes.
> Except I want to you use PATH_INFO to create directories (so to speak) in
> bar. So www.foo.com/bar/test/whatever
> would not look for a directory but rather call the bar script and send in
> the PATH_INFO, all of this has ruled out the possibility of using an
> index.cgi
>
> Any help?
> Thanks
> Cliff
Re: ScriptAlias hacking?
Posted by Kenneth Lee <ke...@alfacomtech.com>.
if i understand correctly, you should have in your httpd.conf something
like
<Location "/bar">
SetHandler perl-script
PerlHandler Your::Handler
Options +ExecCGI
</Location>
then, in your module
package Your::Handler;
sub handler {
my $r = shift;
my $path_info = $r->path_info;
...
}
1;
i'm fairly new to mod_perl, so pls correct/criticize if there's anything
wrong.
kenneth
Cliff Shaw wrote:
>
> HI all,
>
> This is my first post to the list so hopefully I don't screw it up. I am
> attempting to do the following with mod_perl and am stumped on
> ScriptAliases.
>
> I want to have www.foo.com/bar/ run a mod_perl script. Simple huh? yes.
> Except I want to you use PATH_INFO to create directories (so to speak) in
> bar. So www.foo.com/bar/test/whatever
> would not look for a directory but rather call the bar script and send in
> the PATH_INFO, all of this has ruled out the possibility of using an
> index.cgi
>
> Any help?
> Thanks
> Cliff