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