You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Foo Ji-Haw <jh...@nexlabs.com> on 2005/05/26 07:42:22 UTC

[mp2] how to automap modules in httpd.conf?

Hello guys,

I have been happily developing apps with MP2. Some hiccups, but mostly 
all due to my bad coding. But generally MP2 is a great platform and I 
will like to be a better MP2 guy. :)

For one of my applications, I have a bunch of modules that I wrote, each 
actually maps to unique directory paths. For example:

 app::module1 => http://www.domain.com/module1/
 app::module2 => http://www.domain.com/module2/

I can do this by creating an exhaustive list in httpd.conf with:
<Location /module1>
        SetHandler perl-script
        PerlResponseHandler app::module1
</Location>
<Location /module2>
        SetHandler perl-script
        PerlResponseHandler app::module2
</Location>
...

But if I have a really long list of modules all with similar package 
names, is there a way to do autoloading at the httpd.conf level? I 
thought I read about it before, but now I just can't seem to find it on 
the Web again...

Thanks in advance.

Re: [mp2] how to automap modules in httpd.conf?

Posted by Foo Ji-Haw <jh...@nexlabs.com>.
Yup. Apache::Dispatch is what I'm looking for! Thanks for the reminder.

Even though I can't find Apache2::Dispatch (Dispatch for Apache2?), it 
gives me an idea on how to implement it internally.

Thanks Stas.

Stas Bekman wrote:

> Foo Ji-Haw wrote:
>
>> Hello guys,
>>
>> I have been happily developing apps with MP2. Some hiccups, but 
>> mostly all due to my bad coding. But generally MP2 is a great 
>> platform and I will like to be a better MP2 guy. :)
>>
>> For one of my applications, I have a bunch of modules that I wrote, 
>> each actually maps to unique directory paths. For example:
>>
>> app::module1 => http://www.domain.com/module1/
>> app::module2 => http://www.domain.com/module2/
>>
>> I can do this by creating an exhaustive list in httpd.conf with:
>> <Location /module1>
>>        SetHandler perl-script
>>        PerlResponseHandler app::module1
>> </Location>
>> <Location /module2>
>>        SetHandler perl-script
>>        PerlResponseHandler app::module2
>> </Location>
>> ...
>>
>> But if I have a really long list of modules all with similar package 
>> names, is there a way to do autoloading at the httpd.conf level? I 
>> thought I read about it before, but now I just can't seem to find it 
>> on the Web again...
>>
>> Thanks in advance.
>
>
> Foo Ji-Haw, please take a look at Geoff's:
> http://search.cpan.org/dist/Apache-Dispatch/
> I'm not sure if was ported to mp2, but it should be an easy thing to do.
>
> Also take a look at:
> http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.html
>

Re: [mp2] how to automap modules in httpd.conf?

Posted by Stas Bekman <st...@stason.org>.
Foo Ji-Haw wrote:
> Hello guys,
> 
> I have been happily developing apps with MP2. Some hiccups, but mostly 
> all due to my bad coding. But generally MP2 is a great platform and I 
> will like to be a better MP2 guy. :)
> 
> For one of my applications, I have a bunch of modules that I wrote, each 
> actually maps to unique directory paths. For example:
> 
> app::module1 => http://www.domain.com/module1/
> app::module2 => http://www.domain.com/module2/
> 
> I can do this by creating an exhaustive list in httpd.conf with:
> <Location /module1>
>        SetHandler perl-script
>        PerlResponseHandler app::module1
> </Location>
> <Location /module2>
>        SetHandler perl-script
>        PerlResponseHandler app::module2
> </Location>
> ...
> 
> But if I have a really long list of modules all with similar package 
> names, is there a way to do autoloading at the httpd.conf level? I 
> thought I read about it before, but now I just can't seem to find it on 
> the Web again...
> 
> Thanks in advance.

Foo Ji-Haw, please take a look at Geoff's:
http://search.cpan.org/dist/Apache-Dispatch/
I'm not sure if was ported to mp2, but it should be an easy thing to do.

Also take a look at:
http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.html

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com