[cgiapp] getting C::A::Dispatch to ignore certain URLs

P Kishor punkish at eidesis.org
Sun Jan 25 13:25:08 EST 2009


On 1/25/09, Matthew Whipple <mwhipple at kothartech.com> wrote:
> P Kishor wrote:
>
> > On 1/25/09, Matthew Whipple <mwhipple at kothartech.com> wrote:
> >
> >
> > > P Kishor wrote:
> > >
> > >
> > >
> > > > Very well put. So, how do I make the webserver (in my case, Apache
> > > > without mod_perl, for now) serve directly anything under /img (or any
> > > > other specified folder) without invoking C::A::Dispatch?
> > > >
> > > > Many thanks in advance.
> > > >
> > > > Puneet.
> > > >
> > > >
> > > >
> > > >
> > >  Try moving the img directory out of the directory handled by
> dispatching
> > > and then accessing it through an Apache alias.
> > >
> > >
> > >
> > >
> >
> >
> > hmmm... I was hoping for a different solution. While the above is
> > doable, it messes up my mellow. My directory structure is thusly
> >
> > <site folder>/
> >  - index.cgi
> >  - _perl/.. various Perl modules for this site
> >  - _tmpl/.. html templates
> >  - _logs/.. my own logs
> >  - css/.. stylesheets
> >  - js/.. javascripts
> >  - img/.. images and other media
> >
> > All folders prefixed with '_' are *not* accessible directly via the
> > web, while the other folders, css, js and img contain stuff that can
> > be accessed through a URL. That way I can give some a direct URL to an
> > image in the img directory, for instance. This also allows me to keep
> > everything specific to a web application within its own folder. If I
> > move the img directory outside the <site folder>, I no longer have a
> > single folder for a single application.
> >
> >
>  The issue is that (seemingly) you've assigned a default handler for the
> entire directory, overriding the web server normal functionality.  This
> could potentially be reversed by Perl but that is a convoluted solution.
> You could restructure your directories so that all of the scripts (or those
> handled as such) are separated within the project parent directory (more of
> a traditional cgi-bin setup while still keeping projects grouped together),
> or implement more selective handler assignment.
>
>
>

yes, what you say makes sense. My <site folder> has index.cgi, so I
need to be able to run that with Perl, but, other than that, it is
only the _perl folder (<site folder>/_perl/) that has the Perl
modules. I don't really like the cgi-bin setup.

What I could do is that explicitly code "view" in the URLs that I want
to be handled by C::A::Dispatch unless I can implement some other
solution.

Puneet


More information about the cgiapp mailing list