diff -Nur smeserver-phpmyadmin-4.0.10.2.old/createlinks smeserver-phpmyadmin-4.0.10.2/createlinks --- smeserver-phpmyadmin-4.0.10.2.old/createlinks 2021-02-28 00:41:06.055000000 -0500 +++ smeserver-phpmyadmin-4.0.10.2/createlinks 2021-02-28 01:57:33.742000000 -0500 @@ -19,8 +19,10 @@ templates2events("/etc/httpd/conf/httpd.conf", $event); templates2events("/etc/phpMyAdmin/config.inc.php", $event); templates2events("/etc/e-smith/sql/init/phpmyadmin", $event); + templates2events("/etc/opt/remi/php74/php-fpm.d/www.conf", $event); safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");; safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); + safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm"); } # PHP header and footer safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/template-begin"); diff -Nur smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86PhpmyadminAlias smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86PhpmyadminAlias --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86PhpmyadminAlias 2021-02-28 00:41:06.062000000 -0500 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86PhpmyadminAlias 2021-02-28 01:32:01.868000000 -0500 @@ -60,16 +60,17 @@ $OUT .= "allow from all"; } - my $version = ($phpmyadmin{'PHPVersion'} || $PHPVersion || '73'); + # we do not want people to mess with this for the moment + my $version = '74'; $OUT .= qq( Satisfy all - AddType application/x-httpd-php .php .php3 + AddType application/x-httpd-php .php SetHandler "proxy:unix:/var/run/php-fpm/php$version-phpmyadmin.sock|fcgi://localhost" - +SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=\$1 diff -Nur smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin 2021-02-28 00:41:06.063000000 -0500 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin 2021-02-28 02:01:03.246000000 -0500 @@ -7,7 +7,11 @@ my $memory_limit = ($phpmyadmin{MemoryLimit} || '512M'); $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/); my $open_basedir= $phpmyadmin{PHPBaseDir} || ''; - $open_basedir = "/usr/share/phpMyAdmin:/var/lib/php/phpmyadmin:/var/log/phpmyadmin:/dev/urandom:/proc/meminfo:$open_basedir"; + $open_basedir = "/etc/phpMyAdmin/:/usr/share/phpMyAdmin:/var/lib/php/phpmyadmin:". +"/var/lib/phpMyAdmin/temp:/var/lib/phpMyAdmin/save/:/var/lib/phpMyAdmin/upload:". +"/usr/share/php/:". +"/usr/share/phpMyAdmin/doc:". +"/var/log/php/phpmyadmin:/usr/share/php/gettext/:/dev/urandom:/proc/meminfo:$open_basedir"; my $max_children = $phpmyadmin{'PHPmaxChildren'} || 20; my $min_spare_servers = $phpmyadmin{'PHPminServers'} || 4; my $start_servers = $phpmyadmin{'PHPstartServers'} || 6; @@ -16,7 +20,7 @@ $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers; $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers; my $id = 'phpmyadmin'; # Note the package is phpMyAdmin - $OUT .=<<_EOF; + $OUT .=<<"_EOF"; [php$PHP_VERSION-$id] user = www @@ -31,20 +35,17 @@ pm.min_spare_servers = $min_spare_servers pm.max_spare_servers = $max_spare_servers pm.max_requests = $max_requests -# Used in nextcloud -#php_admin_value[session.save_path] = /var/lib/php/$id/session +; Used in nextcloud +php_admin_value[session.save_path] = /var/lib/php/$id/session php_admin_value[session.gc_maxlifetime] = 86400 -# Used in nextcloud -#php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache -# Note the cpaitalisation here - can't use $id -php_admin_value[upload_tmp_dir] = /var/lib/php/phpMyAdmin/tmp +php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache +php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp +php_admin_value[sys_temp_dir] = /var/lib/php/$id/tmp php_admin_value[error_log] = /var/log/php/$id/error.log -# Is slowlog needed? -# slowlog = /var/log/php/phpmyadmin/slow.log +slowlog = /var/log/php/$id/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] = $memory_limit php_admin_value[max_execution_time] = 3600 php_admin_value[post_max_size] = $max_upload_size @@ -57,6 +58,10 @@ php_admin_flag[allow_url_include] = off php_admin_value[session.save_handler] = files php_admin_flag[output_buffering] = off +php_admin_value[auto_prepend_file] = /usr/share/php/auth_translation.php +php_flag[session.use_trans_sid] = off +php_flag[track_vars] = on +php_flag[magic_quotes_gpc] = off _EOF diff -Nur smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/10config smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/10config --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/10config 2021-02-28 00:41:06.063000000 -0500 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/10config 2021-02-28 01:30:26.765000000 -0500 @@ -22,8 +22,14 @@ my $adminaccess = ($phpmyadmin{'adminaccess'} || 'enabled'); my $multiaccess = ($phpmyadmin{'multiaccess'} || 'disabled'); +# this one could be tricky, with fpm we need to translate the auth from httpd +# we need to have this in httpd.conf in the directory of phpmyadmin : +# SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=\$1 +# also need in the fpm pool this (and the file in the open base dir ) +# php_admin_value[auto_prepend_file] = /usr/share/php/auth_translation.php +# the line here could help debug : +# error_log("current user: REDIRECT". $_SERVER['REDIRECT_REMOTE_USER'] ."REMOTE". $_SERVER['REMOTE_USER'] . " PHP_AUTH_USER". $_SERVER['PHP_AUTH_USER'] ); if (("$adminaccess" eq "enabled")) -#|| ("$multiaccess" eq "enabled")) { $OUT .="if (\$scriptpath==\"/phpmyadmin/\" && \$_SERVER['PHP_AUTH_USER']=='admin')\n"; $OUT .="{\n"; diff -Nur smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/20Directory smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/20Directory --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/20Directory 2021-02-28 00:41:06.060000000 -0500 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/20Directory 2021-02-28 01:30:26.767000000 -0500 @@ -3,6 +3,7 @@ */ $cfg['UploadDir'] = '/var/lib/phpMyAdmin/upload'; $cfg['SaveDir'] = '/var/lib/phpMyAdmin/save'; +$cfg['SessionSavePath'] = '/var/lib/php/phpmyadmin/session'; $cfg['VersionCheck'] = false; $cfg['RetainQueryBox'] = true; $cfg['ServerDefault'] = 1; diff -Nur smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/template-begin smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/template-begin --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/template-begin 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/template-begin 2021-02-28 01:30:26.768000000 -0500 @@ -0,0 +1,14 @@ +{ + $OUT = <