1 |
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 |
2 |
--- 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 |
3 |
+++ 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 |
4 |
@@ -0,0 +1,49 @@ |
5 |
+{ |
6 |
+ my $status = $php{status} || 'disabled'; |
7 |
+ if ($status eq 'enabled') |
8 |
+ { |
9 |
+ use esmith::AccountsDB; |
10 |
+ my $adb = esmith::AccountsDB->open_ro(); |
11 |
+ foreach my $ibay ($adb->ibays) |
12 |
+ { |
13 |
+ my $key = $ibay->key; |
14 |
+ local $dynamicContent = $ibay->prop('CgiBin') || 'disabled'; |
15 |
+ if ($dynamicContent eq 'enabled') |
16 |
+ { |
17 |
+ $OUT .= "\n<Directory /home/e-smith/files/ibays/" . $ibay->key . "/html>\n"; |
18 |
+ if ($fastcgi_mod eq 'mod_proxy_fcgi'){ |
19 |
+ my $version = $properties{'PHPVersion'} || $PHPVersion || ''; |
20 |
+ ($version) = $version =~ /([0-9]{2})/ unless $version eq ''; |
21 |
+ my $name = lc $key; |
22 |
+ $OUT .=<<"_EOF"; |
23 |
+ <FilesMatch \.php\$> |
24 |
+ SetHandler "proxy:unix:/var/run/php-fpm/php$version-$name.sock|fcgi://localhost" |
25 |
+ </FilesMatch> |
26 |
+_EOF |
27 |
+ } |
28 |
+ else { |
29 |
+ $OUT .= " AddType application/x-httpd-php .php .php3 .phtml\n"; |
30 |
+ $OUT .= " AddType application/x-httpd-php-source .phps\n"; |
31 |
+ |
32 |
+ # Set the upload_tmp_folder where php can upload files |
33 |
+ my $tmpdir = $ibay->prop('PHPTmpDir') || 'enabled'; |
34 |
+ $tmpdir = ("/var/cache/e-smith/files/ibays/$key/tmp") if $tmpdir eq 'enabled'; |
35 |
+ $OUT .= " php_admin_value upload_tmp_dir $tmpdir\n" unless ($tmpdir eq 'disabled' || ! -d $tmpdir); |
36 |
+ |
37 |
+ # Set the session folder where php can store its session instead of in global dir |
38 |
+ my $sessdir = $ibay->prop('PHPSessionDir') || 'enabled'; |
39 |
+ $sessdir = ("/var/cache/e-smith/files/ibays/$key/session") if $sessdir eq 'enabled'; |
40 |
+ $OUT .= " php_admin_value session.save_path $sessdir\n" unless ($sessdir eq 'disabled' || ! -d $sessdir); |
41 |
+ |
42 |
+ # Set the sandbox within which PHP is confined to play |
43 |
+ my $basedir = $ibay->prop('PHPBaseDir') |
44 |
+ || ("/home/e-smith/files/ibays/$key/"); |
45 |
+ $basedir = $tmpdir . ":" . $basedir unless ($tmpdir eq 'disabled' || ! -d $tmpdir); |
46 |
+ $basedir = $sessdir . ":" . $basedir unless ($sessdir eq 'disabled' || ! -d $sessdir); |
47 |
+ $OUT .= " php_admin_value open_basedir $basedir\n"; |
48 |
+ } |
49 |
+ $OUT .= "</Directory>\n"; |
50 |
+ } |
51 |
+ } |
52 |
+ } |
53 |
+} |