Coder Social home page Coder Social logo

apache-dir's Introduction

Apache/Dir version 0.08

This simple module is designed to be a partial replacement for the standard Apache mod_dir module. One of the things that module does is to redirect browsers to a directory URL ending in a slash when they request the directory without the slash. Since mod_dir seems do its thing during the Apache response phase, if you use a Perl handler, it won't run. This can be problematic if the Perl handler doesn't likewise take the directory redirecting into account.

A good example is HTML::Mason. If you've disabled Mason's decline_dirs parameter (MasonDeclineDirs 0 in httpd.conf), and there's a dhandler in the directory /foo, then for a request for /foo, /foo/dhandler will respond. This can wreak havoc if you use relative URLs in the dhandler. What really should happen is that a request for /foo will be redirected to /foo/ before Mason ever sees it.

This is the problem that this module is designed to address. Configuration would then look something like this:

<Location /foo>
  PerlSetVar       MasonDeclineDirs 0
  PerlModule       Apache::Dir
  PerlModule       HTML::Mason::ApacheHandler
  SetHandler       perl-script
  PerlFixupHandler Apache::Dir
  PerlHandler      HTML::Mason::ApacheHandler
</Location>

Apache::Dir can also be configured to handle the request during the response cycle, if you wish. Just specify it before any other Perl handler to have it execute first:

<Location /foo>
  PerlSetVar  MasonDeclineDirs 0
  PerlModule  Apache::Dir
  PerlModule  HTML::Mason::ApacheHandler
  SetHandler  perl-script
  PerlHandler Apache::Dir HTML::Mason::ApacheHandler
</Location>

Installation

Build Status

To install this module, type the following:

perl Build.PL
./Build
./Build test
./Build install

Author

David E. Wheeler [email protected]

Copyright and License

Copyright 2004-2011 by David Wheeler. Some Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

apache-dir's People

Contributors

theory avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.