LogLevel info
LimitInternalRecursion 4

# redirect HTTP to HTTPS,
# only needed for HTTP configuration, do not use this at HTTPS configuration(!)
# Redirect permanent /agenda/planung https://${domain}/agenda/planung

Define domain      localhost
Define base_dir    /home/calcms/racalmas
Define web_dir     /home/calcms/racalmas/website/
Define perl_lib    /home/calcms/racalmas/lib
Define archive_dir /home/radio/archive/

# Redirect permanent /agenda/planung https://${domain}/agenda/planung
# ^ remove comment to redirect HTTP to HTTPS
# (enabling this in HTTPS templates results in endless routing loop)!

# calcms endpoints for your website
# frontend
Alias /programm      ${web_dir}/programm

# backend
Alias /agenda        ${web_dir}/agenda

# image base
Alias /media         ${base_dir}/media

# thumbs
Alias /thumbs        ${base_dir}/media/thumbs

# icons
Alias /icons         ${base_dir}/media/icons

# audio upload
Alias /recordings    ${base_dir}/recordings

# audio download
Alias /listen        ${archive_dir}/${domain}

# upload playout status
ScriptAlias /agenda/planung/upload  ${archive_dir}/${domain}/agenda/planung/upload

<Directory ${web_dir}/agenda>
    AllowOverride All
    Options -Indexes +FollowSymLinks +MultiViews +ExecCGI
    Require all granted
</Directory>

<Directory ${web_dir}/programm>
    AllowOverride All
    Options -Indexes +FollowSymLinks -MultiViews -ExecCGI
    Require all granted
</Directory>

<Directory ${base_dir}/media>
    AllowOverride All
    Options -Indexes -FollowSymLinks -MultiViews -ExecCGI
    Require all granted
</Directory>

<IfModule mod_perl.c>
    PerlSetEnv LC_ALL   en_US.UTF-8
    PerlSetEnv LANGUAGE en_US.UTF-8

    PerlWarn On
    PerlModule ModPerl::RegistryPrefork

    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload

    # set local tmp dir
    SetEnv TMPDIR ${base_dir}/tmp/

    # set library directory
    PerlSetEnv PERL5LIB ${base_dir}/lib/calcms/

    # preload libraries
    PerlPostConfigRequire ${base_dir}/lib/calcms/startup.pl
</IfModule>
