{
if (($dokuwiki{'status'} || 'disabled') eq 'enabled'){
my $alias = (($dokuwiki{'AliasOnPrimary'} || 'enabled') eq 'enabled' ) ? 'Alias /dokuwiki /usr/share/dokuwiki':'';
my $allow = (($dokuwiki{'access'} || 'private') eq 'public') ? 'all':"$localAccess $externalSSLAccess";
my $auth = (($dokuwiki{'Authentication'} || 'internal') eq 'http') ? "AuthName \"Dokuwiki\"\n" .
" AuthType Basic\n" .
" AuthExternal pwauth\n" .
" Require valid-user\n" : '';
my $ssl = (($dokuwiki{'RequireSSL'} || 'enabled') =~ m/^(enabled|yes|on)$/i) ?
'SSLRequireSSL on':'# SSL is not encforced';
my $maxsize = $dokuwiki{'MaxUploadSize'} || '200';
$maxsize .= 'M' unless ($maxsize =~ m/M$/);
$OUT .=<<"EOF";
$alias
AllowOverride None
Options +FollowSymlinks
AddType application/x-httpd-php .php
Order Allow,Deny
Allow from $allow
$ssl
$auth
php_admin_value open_basedir /usr/share/dokuwiki:/var/lib/dokuwiki:/etc/dokuwiki
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize $maxsize
php_admin_value post_max_size $maxsize
php_admin_value upload_tmp_dir /var/lib/dokuwiki/data/tmp
php_admin_value session.save_path /var/lib/dokuwiki/data/tmp
Order Deny,Allow
Deny from all
Order Deny,Allow
Deny from all
## no access to the fla directory
Order allow,deny
Deny from all
## no access to the conf directory
Order allow,deny
Deny from all
Order allow,deny
Deny from all
## no access to the data directory
Order allow,deny
Deny from all
Order allow,deny
Deny from all
EOF
}
else {
$OUT .=<<'EOF';
# Dokuwiki is disabled
# You can enable it with
# db configuration setprop dokuwiki status enabled
# signal-event webapps-update
EOF
}
}