Apache2-Layer

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

dist.ini
lib/Apache2/Layer.pm
t/00-compile.t
t/apache2-layer.t
t/htdocs/delivery.html
t/htdocs/index.html
t/htdocs/layered/christmas/delivery.html
t/htdocs/layered/christmas/index.html
t/htdocs/layered/dev/beta/beta.html
t/htdocs/layered/dev/css/style.css
t/htdocs/layered/dev/images/pix.png
t/htdocs/layered/dev/images/pix2.png
t/htdocs/layered/dev/index.html
t/htdocs/layered/dev/new_images/pix.png
t/htdocs/layered/dev/php-ng/form.php
t/htdocs/layered/dev/php/form.php
t/htdocs/layered/dev/rc1/rc1.html
t/htdocs/layered/dev/rc2/rc2.html
t/htdocs/layered/newyearseve/delivery.html
t/htdocs/layered/newyearseve/index.html
t/htdocs/layered/newyearseve/new_product.html
t/htdocs/layered/newyearseve/promotions.html
t/htdocs/layered/noargs/noargs.php
t/htdocs/product.html

README  view on Meta::CPAN

            # layers enabled for this vhost
        </VirtualHost>

        <VirtualHost *:80>
            ...
            DocumentRoot "/usr/local/vhost2"

            # disabled by default
            EnableDocumentRootLayers Off

            <LocationMatch "\.png$">
                # layer images only
                EnableDocumentRootLayers On
                DocumentRootLayers images_v3 images_v2
            </LocationMatch>


            <Location "/images">
                DocumentRootLayersStripLocation On
            </Location>

README  view on Meta::CPAN

        <Location "/images/company1">
            DocumentRootLayers company1/images default/images
        </Location>

        <Location "/images/company2">
            DocumentRootLayers company2/images default/images
        </Location>

    for following requests:

        /images/company1/headers/top.png 

        /images/company2/headers/top.png

    those paths would be searched:

       company1/images/headers/top.png default/images/headers/top.png 

       company2/images/headers/top.png default/images/headers/top.png

    but with "DocumentRootLayersStripLocation Off":

       company1/images/images/company1/headers/top.png default/images/images/company1/headers/top.png

       company2/images/images/company2/headers/top.png default/images/images/company2/headers/top.png

  DocumentRootLayers
        Syntax:   DocumentRootLayers dir-path1 [dir-path2 ... dir-pathN]
        Context:  server config, virtual host, <Location*

    Specify content layers to be used on top of "DocumentRoot".

    If the *dir-path** is not absolute it is assumed to be relative to
    "DocumentRoot".

lib/Apache2/Layer.pm  view on Meta::CPAN

        # layers enabled for this vhost
    </VirtualHost>

    <VirtualHost *:80>
        ...
        DocumentRoot "/usr/local/vhost2"

        # disabled by default
        EnableDocumentRootLayers Off

        <LocationMatch "\.png$">
            # layer images only
            EnableDocumentRootLayers On
            DocumentRootLayers images_v3 images_v2
        </LocationMatch>


        <Location "/images">
            DocumentRootLayersStripLocation On
        </Location>

lib/Apache2/Layer.pm  view on Meta::CPAN

    <Location "/images/company1">
        DocumentRootLayers company1/images default/images
    </Location>

    <Location "/images/company2">
        DocumentRootLayers company2/images default/images
    </Location>

for following requests:

    /images/company1/headers/top.png 

    /images/company2/headers/top.png 

those paths would be searched:

   company1/images/headers/top.png default/images/headers/top.png 

   company2/images/headers/top.png default/images/headers/top.png 

but with C<DocumentRootLayersStripLocation Off>:

   company1/images/images/company1/headers/top.png default/images/images/company1/headers/top.png

   company2/images/images/company2/headers/top.png default/images/images/company2/headers/top.png

=head2 DocumentRootLayers

    Syntax:   DocumentRootLayers dir-path1 [dir-path2 ... dir-pathN]
    Context:  server config, virtual host, <Location*

Specify content layers to be used on top of C<DocumentRoot>.

If the I<dir-path*> is not absolute it is assumed to be relative to
C<DocumentRoot>.

t/apache2-layer.t  view on Meta::CPAN

            rc1 => 'htdocs/layered/dev/rc1',
            rc2 => 'htdocs/layered/dev/rc2',
        },
        php => {
            'forms/form' => 'htdocs/layered/dev/php',
            'forms/ng/form' => 'htdocs/layered/dev/php-ng',
        },
        css => {
            'css/style' => 'htdocs/layered/dev',
        },
        png => {
            pix => 'htdocs/layered/dev/new_images',
            pix2 => 'htdocs/layered/dev/images',
        },
    },
    'other-trans-handler.localdomain' => {
        raw => {
            'noargs.php?a=b' => 'htdocs/layered/noargs',
        },
    },
);

t/apache2-layer.t  view on Meta::CPAN


        <Location "/forms/">
            DocumentRootLayersStripLocation On
            DocumentRootLayers php
        </Location>

        <Location "/forms/ng">
            DocumentRootLayers php-ng
        </Location>

        <LocationMatch "\.png\$">
            DocumentRootLayers new_images images
        </LocationMatch>

        <Location "/css/">
            EnableDocumentRootLayers Off
        </Location>

    </VirtualHost>

    <VirtualHost $HOSTPORT>



( run in 0.804 second using v1.01-cache-2.11-cpan-df04353d9ac )