tags/smeserver-dl-0.2.1-1
Daniel Berteaud 8 years ago
parent a21a1117c2
commit e2c18a4b78
  1. 2
      root/etc/e-smith/templates/etc/e-smith/sql/init/dl
  2. 29
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98Dl
  3. 45
      root/etc/e-smith/templates/etc/opt/remi/php71/php-fpm.d/www.conf/10All

@ -11,7 +11,7 @@ if [ ! -d /var/lib/mysql/$db ]; then
/usr/bin/mysql -e 'create database $db' /usr/bin/mysql -e 'create database $db'
/usr/bin/mysql $db < $dbstruct /usr/bin/mysql $db < $dbstruct
else else
su -s /bin/bash - www -c "cd /usr/share/dl/include/scripts && /usr/bin/php ./dbupgrade.php" su -s /bin/bash - www -c "cd /usr/share/dl/include/scripts && /usr/bin/php71 ./dbupgrade.php"
fi fi
/usr/bin/mysql <<EOF /usr/bin/mysql <<EOF

@ -23,15 +23,8 @@ EOF
} }
if ($dl{'status'} eq 'enabled'){ if ($dl{'status'} eq 'enabled'){
$OUT .=<<"END" my $php =<<_EOF;
# dl Configuration
$alias
<Directory /usr/share/dl>
AllowOverride Limit
AddType application/x-httpd-php .php AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/dl:/etc/dl.php:/var/lib/dl:/var/log/dl.log
php_admin_flag file_uploads On php_admin_flag file_uploads On
php_admin_flag magic_quotes Off php_admin_flag magic_quotes Off
php_admin_flag magic_quotes_gpc Off php_admin_flag magic_quotes_gpc Off
@ -43,6 +36,26 @@ $alias
php_admin_value upload_tmp_dir /var/lib/dl/tmp php_admin_value upload_tmp_dir /var/lib/dl/tmp
php_admin_value session.save_path /var/lib/dl/tmp php_admin_value session.save_path /var/lib/dl/tmp
php_admin_value session.gc_maxlifetime 86400 php_admin_value session.gc_maxlifetime 86400
_EOF
if ($fastcgi_mod eq 'mod_fastcgi'){
$php = " AddHandler phpdl-fastcgi .php\n";
}
elsif ($fascgi_mod eq 'mod_proxy_fcgi'){
$php =<<'_EOF';
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php-fpm/php71-dl.sock|fcgi://localhost"
</FilesMatch>
_EOF
}
$OUT .=<<"END"
# dl Configuration
$alias
<Directory /usr/share/dl>
AllowOverride Limit
$php
order deny,allow order deny,allow
deny from all deny from all
allow from $allow allow from $allow

@ -0,0 +1,45 @@
{
if (($dl{status'} || 'disabled) eq 'enabled'){
$OUT .=<<_EOF;
[php71-dl]
user = www
group = www
listen.owner = root
listen.group = www
listen.mode = 0660
listen = /var/run/php-fpm/php71-dl.sock
pm = dynamic
pm.max_children = 15
pm.start_servers = 3
pm.min_spare_servers = 3
pm.max_spare_servers = 4
pm.max_requests = 5000
php_admin_value[session.save_path] = /var/lib/php/dl/session
php_admin_value[opcache.file_cache] = /var/lib/php/dl/opcache
php_admin_value[upload_tmp_dir] = /var/lib/php/dl/tmp
php_admin_value[error_log] = /var/log/php/dl/error.log
slowlog = /var/log/php/dl/slow.log
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
php_admin_flag[display_errors] = off
php_admin_flag[log_errors] = on
php_admin_value[error_log] = syslog
php_admin_value[memory_limit] = 128M
php_admin_value[max_execution_time] = 0
php_admin_value[post_max_size] = { $dl{MaxUploadSize} || '4096' }M
php_admin_value[upload_max_filesize] = { $dl{MaxUploadSize} || '4096' }M
php_admin_value[disable_functions] = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd
php_admin_value[open_basedir] = /usr/share/dl:/etc/dl.php:/var/lib/dl:/var/log/dl.log
php_admin_flag[allow_url_fopen] = off
php_admin_flag[file_upload] = on
php_admin_flag[session.cookie_httponly] = on
php_admin_flag[allow_url_include] = off
php_admin_value[session.save_handler] = files
php_admin_value[output_buffering] = off
_EOF
}
else{
$OUT .= '; Dl is disabled';
}
}
Loading…
Cancel
Save