1 |
diff -Nur --no-dereference smeserver-zoneminder-1.0.old/createlinks smeserver-zoneminder-1.0/createlinks |
2 |
--- smeserver-zoneminder-1.0.old/createlinks 2023-03-24 23:29:05.691000000 -0400 |
3 |
+++ smeserver-zoneminder-1.0/createlinks 2023-03-24 23:49:37.864000000 -0400 |
4 |
@@ -13,8 +13,10 @@ |
5 |
templates2events("/etc/e-smith/sql/init/30zoneminder", $event); |
6 |
templates2events("/etc/httpd/conf/httpd.conf", $event); |
7 |
templates2events("/etc/zm/zm.conf", $event); |
8 |
+templates2events("/etc/opt/remi/php74/php-fpm.d/www.conf", $event); |
9 |
event_link("zoneminder", $event, "10"); |
10 |
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); |
11 |
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm"); |
12 |
|
13 |
# add expand zm.conf |
14 |
foreach my $event (qw(post-upgrade bootstrap-console-save console-save remoteaccess-update php-update webapps-update)){ |
15 |
@@ -32,6 +34,7 @@ |
16 |
/etc/zm/zm.conf |
17 |
/etc/httpd/conf/httpd.conf |
18 |
/etc/e-smith/sql/init/30zoneminder |
19 |
+ /etc/opt/remi/php74/php-fpm.d/www.conf |
20 |
)) |
21 |
{ |
22 |
templates2events( $file, $event ); |
23 |
@@ -46,8 +49,9 @@ |
24 |
#services we need to restart |
25 |
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); |
26 |
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); |
27 |
-safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/zoneminder") |
28 |
-; |
29 |
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/zoneminder"); |
30 |
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm"); |
31 |
+ |
32 |
use esmith::Build::Backup qw(:all); |
33 |
backup_includes("smeserver-zoneminder", qw( |
34 |
/var/lib/zoneminder |
35 |
diff -Nur --no-dereference smeserver-zoneminder-1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86zoneminder smeserver-zoneminder-1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86zoneminder |
36 |
--- smeserver-zoneminder-1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86zoneminder 2023-03-24 23:29:05.685000000 -0400 |
37 |
+++ smeserver-zoneminder-1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86zoneminder 2023-03-24 23:41:40.633000000 -0400 |
38 |
@@ -20,7 +20,7 @@ |
39 |
Options -Indexes +MultiViews +FollowSymLinks |
40 |
#AddType application/x-httpd-php .php |
41 |
<FilesMatch .php> |
42 |
- SetHandler "proxy:unix:/var/run/php-fpm/php74.sock|fcgi://localhost" |
43 |
+ SetHandler "proxy:unix:/var/run/php-fpm/php74-zoneminder.sock|fcgi://localhost" |
44 |
</FilesMatch> |
45 |
AllowOverride All |
46 |
AuthName "Zoneminder" |
47 |
diff -Nur --no-dereference smeserver-zoneminder-1.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15zm smeserver-zoneminder-1.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15zm |
48 |
--- smeserver-zoneminder-1.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15zm 1969-12-31 19:00:00.000000000 -0500 |
49 |
+++ smeserver-zoneminder-1.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15zm 2023-03-24 23:44:04.640000000 -0400 |
50 |
@@ -0,0 +1,65 @@ |
51 |
+{ |
52 |
+ |
53 |
+if ($PHP_VERSION eq '74'){ |
54 |
+ if (($zoneminder{'status'} || 'disabled') eq 'enabled'){ |
55 |
+ my $max_upload_size = ($zoneminder{MaxUploadSize} || '4096'); |
56 |
+ $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/); |
57 |
+ my $memory_limit = ($zoneminder{MemoryLimit} || '500M'); |
58 |
+ $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/); |
59 |
+ my $open_basedir= $zoneminder{PHPBaseDir} || ''; |
60 |
+ $open_basedir = "/usr/share/zoneminder:/var/cache/zoneminder:/usr/libexec/zoneminder:/var/log/zoneminder/:/var/lib/php/zoneminder:$open_basedir"; |
61 |
+ my $id = 'zoneminder'; |
62 |
+ my $max_children = $zoneminder{'PHPmaxChildren'} || 20; |
63 |
+ my $min_spare_servers = $zoneminder{'PHPminServers'} || 4; |
64 |
+ my $start_servers = $zoneminder{'PHPstartServers'} || 6; |
65 |
+ my $max_spare_servers = $zoneminder{'PHPmaxServers'} || 8; |
66 |
+ my $max_requests = $zoneminder{'PHPmaxRequests'} || 1000; |
67 |
+ $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers; |
68 |
+ $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers; |
69 |
+ |
70 |
+ $OUT .=<<_EOF; |
71 |
+ |
72 |
+[php$PHP_VERSION-$id] |
73 |
+user = www |
74 |
+group = www |
75 |
+listen.owner = root |
76 |
+listen.group = www |
77 |
+listen.mode = 0660 |
78 |
+listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock |
79 |
+pm = dynamic |
80 |
+pm.max_children = $max_children |
81 |
+pm.start_servers = $start_servers |
82 |
+pm.min_spare_servers = $min_spare_servers |
83 |
+pm.max_spare_servers = $max_spare_servers |
84 |
+pm.max_requests = $max_requests |
85 |
+php_admin_value[session.save_path] = /var/lib/php/$id/session |
86 |
+php_admin_value[session.gc_maxlifetime] = 86400 |
87 |
+php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache |
88 |
+php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp |
89 |
+php_admin_value[error_log] = /var/log/php/$id/error.log |
90 |
+slowlog = /var/log/php/zoneminder/slow.log |
91 |
+php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName } |
92 |
+php_admin_flag[display_errors] = off |
93 |
+php_admin_flag[log_errors] = on |
94 |
+php_admin_value[error_log] = syslog |
95 |
+php_admin_value[memory_limit] = $memory_limit |
96 |
+php_admin_value[max_execution_time] = 3600 |
97 |
+php_admin_value[post_max_size] = $max_upload_size |
98 |
+php_admin_value[upload_max_filesize] = $max_upload_size |
99 |
+php_admin_value[disable_functions] = system, show_source, dl, passthru, phpinfo |
100 |
+php_admin_value[open_basedir] = $open_basedir |
101 |
+php_admin_flag[allow_url_fopen] = on |
102 |
+php_admin_flag[file_uploads] = on |
103 |
+php_admin_flag[session.cookie_httponly] = on |
104 |
+php_admin_flag[allow_url_include] = off |
105 |
+php_admin_value[session.save_handler] = files |
106 |
+php_admin_flag[output_buffering] = off |
107 |
+ |
108 |
+_EOF |
109 |
+ |
110 |
+ } |
111 |
+ else{ |
112 |
+ $OUT .= '; zoneminder is disabled'; |
113 |
+ } |
114 |
+} |
115 |
+} |