diff -Nur smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays smeserver-php-3.0.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays --- smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays 2020-01-28 14:25:30.000000000 -0500 +++ smeserver-php-3.0.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays 2020-02-01 21:51:32.193000000 -0500 @@ -6,29 +6,44 @@ 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"; - $OUT .= " AddType application/x-httpd-php .php .phtml\n"; - $OUT .= " AddType application/x-httpd-php-source .phps\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 .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/' . $ibay->key . '/tmp') if $tmpdir eq 'enabled'; - $OUT .= " php_admin_value upload_tmp_dir $tmpdir\n" unless ($tmpdir eq 'disabled' || ! -d $tmpdir); + # 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/' . $ibay->key . '/session') if $sessdir eq 'enabled'; - $OUT .= " php_admin_value session.save_path $sessdir\n" unless ($sessdir eq 'disabled' || ! -d $sessdir); + # 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/" . $ibay->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"; + # 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"; } }