{ 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$/); my $php =<<_EOF; AddType application/x-httpd-php .php php_admin_value open_basedir /usr/share/dokuwiki:/var/lib/dokuwiki:/etc/dokuwiki:/dev/urandom php_admin_value memory_limit 128M 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 _EOF if ($fastcgi_mod eq 'mod_fastcgi'){ $php = "AddHandler phpdokuwiki-fastcgi .php\n"; } elsif ($fastcgi_mod eq 'mod_proxy_fcgi'){ $php =<<_EOF; SetHandler "proxy:unix:/var/run/php-fpm/php__PHP_VERSION__-dokuwiki.sock|fcgi://localhost" _EOF } $OUT .=<<"EOF"; $alias AllowOverride None Options +FollowSymlinks Order Allow,Deny Allow from $allow $ssl $auth $php 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 } }