diff -Nur e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays --- e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays 2020-01-28 15:43:08.401000000 -0500 @@ -0,0 +1,49 @@ +{ + my $status = $php{status} || 'disabled'; + if ($status eq 'enabled') + { + use esmith::AccountsDB; + my $adb = esmith::AccountsDB->open_ro(); + foreach my $ibay ($adb->ibays) + { + my $key = $ibay->key; + local $dynamicContent = $ibay->prop('CgiBin') || 'disabled'; + if ($dynamicContent eq 'enabled') + { + $OUT .= "\nkey . "/html>\n"; + if ($fastcgi_mod eq 'mod_proxy_fcgi'){ + my $version = $properties{'PHPVersion'} || $PHPVersion || ''; + ($version) = $version =~ /([0-9]{2})/ unless $version eq ''; + my $name = lc $key; + $OUT .=<<"_EOF"; + + SetHandler "proxy:unix:/var/run/php-fpm/php$version-$name.sock|fcgi://localhost" + +_EOF + } + else { + $OUT .= " AddType application/x-httpd-php .php .php3 .phtml\n"; + $OUT .= " AddType application/x-httpd-php-source .phps\n"; + + # Set the upload_tmp_folder where php can upload files + my $tmpdir = $ibay->prop('PHPTmpDir') || 'enabled'; + $tmpdir = ("/var/cache/e-smith/files/ibays/$key/tmp") if $tmpdir eq 'enabled'; + $OUT .= " php_admin_value upload_tmp_dir $tmpdir\n" unless ($tmpdir eq 'disabled' || ! -d $tmpdir); + + # Set the session folder where php can store its session instead of in global dir + my $sessdir = $ibay->prop('PHPSessionDir') || 'enabled'; + $sessdir = ("/var/cache/e-smith/files/ibays/$key/session") if $sessdir eq 'enabled'; + $OUT .= " php_admin_value session.save_path $sessdir\n" unless ($sessdir eq 'disabled' || ! -d $sessdir); + + # Set the sandbox within which PHP is confined to play + my $basedir = $ibay->prop('PHPBaseDir') + || ("/home/e-smith/files/ibays/$key/"); + $basedir = $tmpdir . ":" . $basedir unless ($tmpdir eq 'disabled' || ! -d $tmpdir); + $basedir = $sessdir . ":" . $basedir unless ($sessdir eq 'disabled' || ! -d $sessdir); + $OUT .= " php_admin_value open_basedir $basedir\n"; + } + $OUT .= "\n"; + } + } + } +}