# This -*- Apache -*- configuration enables the example Mason components in /var/www/mason_example

<IfModule mod_perl.c>
    PerlModule CGI::Cookie
    <Directory /var/www/mason_example>
        SetHandler perl-script
        PerlResponsehandler HTML::Mason::ApacheHandler
        PerlSetVar MasonArgsMethod CGI
        # CGI was previously required for Mason to work in Apache2
    </Directory>

     # This chunk allows concurrent use with mod_perl *or* CGI:
     <IfModule mod_rewrite.c>
          RewriteEngine On
          RewriteRule ^/mason_example_cgi/$ /usr/lib/cgi-bin/mason_example.cgi [E=PATH_INFO:/mason_example/index.html,T=application/x-httpd-cgi]
          RewriteRule ^/mason_example_cgi/(.+)/$ /usr/lib/cgi-bin/mason_example.cgi [E=PATH_INFO:/mason_example/$1/index.html,T=application/x-httpd-cgi]
          RewriteRule ^/mason_example_cgi/(.+) /usr/lib/cgi-bin/mason_example.cgi [E=PATH_INFO:/mason_example/$1,T=application/x-httpd-cgi]
     </IfModule>
     # And so http://localhost/mason_example/     uses mod_perl, and
     #        http://localhost/mason_example_cgi/ uses CGI
     # This is *not* the way you would normally use mason-with-cgi, see below for an easier way!
</IfModule>

<IfModule !mod_perl.c>

    # No mod_perl available, just use CGI
    # We need wither mod_actions or mod_rewrite enabled to do this. What
    # to do if the user has neither enabled?
    # (in any case, don't present the user with a broken config)
    <IfModule mod_actions.c>
        Action mason_example http://localhost/cgi-bin/mason_example.cgi
        <Directory /var/www/mason_example>
            SetHandler mason_example
        </Directory>
    </IfModule>
    # mod_actions.c

</IfModule>
# !mod_perl.c

# 2004-03-08 araqnid
