smeserver-limesurvey/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98LimeSurvey

63 lines
1.8 KiB
Plaintext
Raw Normal View History

2013-11-07 17:01:52 +01:00
{
my $access = $limesurvey{'access'} || 'private';
my $allow = ($access eq 'public') ? 'all' : "$localAccess $externalSSLAccess";
2013-11-08 10:51:54 +01:00
my $alias = (($limesurvey{'AliasOnPrimary'} || 'enabled') ne 'enabled') ?
'' : 'Alias /limesurvey /usr/share/limesurvey';
my $ver = $sysconfig{'ReleaseVersion'} || '8.1';
2013-11-08 10:51:54 +01:00
my $auth = (($limesurvey{'Authentication'} || 'http') eq 'http') ? "AuthName \"LimeSurvey\"\n" .
" AuthType Basic\n" .
" AuthExternal pwauth\n" . (($ver =~ m/^9/) ? " AuthBasicProvider external\n":'') .
2013-11-08 10:51:54 +01:00
" Require valid-user\n" : '';
2013-11-07 17:01:52 +01:00
if ($limesurvey{'status'} eq 'enabled'){
2016-12-11 21:02:43 +01:00
$OUT .=<<"END";
2013-11-07 17:01:52 +01:00
# LimeSurvey Configuration
$alias
2013-11-08 10:51:54 +01:00
<Directory /usr/share/limesurvey>
Options None
Options +FollowSymLinks
AllowOverride All
2013-11-07 17:01:52 +01:00
SSLRequireSSL on
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/limesurvey:/var/lib/limesurvey
php_admin_flag file_uploads On
php_admin_flag magic_quotes Off
php_admin_flag magic_quotes_gpc Off
php_admin_value upload_max_filesize 10M
php_admin_value post_max_size 12M
php_admin_value memory_limit 100M
php_admin_value max_execution_time 120
php_admin_value upload_tmp_dir /var/lib/limesurvey/tmp
php_admin_value session.save_path /var/lib/limesurvey/sessions
order deny,allow
deny from all
allow from $allow
Satisfy all
</Directory>
2016-12-11 20:53:57 +01:00
END
2016-12-11 21:02:43 +01:00
if ($alias ne ''){
$OUT .=<<"END";
<LocationMatch "^/limesurvey/(index\.php/)?admin">
2013-11-07 17:01:52 +01:00
SSLRequireSSL on
2013-11-08 10:51:54 +01:00
$auth
</LocationMatch>
2016-12-11 20:53:57 +01:00
END
2016-12-11 21:02:43 +01:00
}
2016-12-11 20:53:57 +01:00
$OUT .=<<'END';
2013-11-08 10:51:54 +01:00
<DirectoryMatch "/usr/share/limesurvey/(framework|console|installer/sql|locale|application/(logs|config)|docs)">
2013-11-07 17:01:52 +01:00
Deny from all
2013-11-08 10:51:54 +01:00
</DirectoryMatch>
2013-11-07 17:01:52 +01:00
END
2016-12-11 21:02:43 +01:00
2013-11-07 17:01:52 +01:00
}
else{
$OUT .= "# LimeSurvey is disabled\n";
}
}