/[smecontribs]/rpms/smeserver-phpmyadmin/contribs10/smeserver-phpmyadmin-4.0.10.2-bz11043-configure-php-pool.patch
ViewVC logotype

Annotation of /rpms/smeserver-phpmyadmin/contribs10/smeserver-phpmyadmin-4.0.10.2-bz11043-configure-php-pool.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Tue Dec 22 13:51:37 2020 UTC (3 years, 11 months ago) by jcrisp
Branch: MAIN
CVS Tags: smeserver-phpmyadmin-4_0_10_2-9_el7_sme
Changes since 1.1: +52 -13 lines
* Tue Dec 22 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 4.0.10.2-8.sme
- add php pool template, disable unit.ini, restore httpauth [SME: 11043]
- Fix version to PHP73 - any higher needs a newer version of phpMyAdmin

1 jcrisp 1.1 diff -ruN smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86PhpmyadminAlias smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86PhpmyadminAlias
2     --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86PhpmyadminAlias 2020-12-18 12:50:59.934881670 +0100
3 jcrisp 1.2 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86PhpmyadminAlias 2020-12-22 14:43:20.167546078 +0100
4     @@ -1,14 +1,15 @@
5     +# 86PhpmyadminAlias Start
6 jcrisp 1.1 {
7 jcrisp 1.2 -# phpmyadmin
8     +
9 jcrisp 1.1 my $status = $phpmyadmin{'status'} || 'disabled';
10     -
11     +
12     if ($status eq 'enabled')
13     {
14     $OUT .="#-------------------------------------------------\n";
15     $OUT .="# phpMyAdmin settings from smeserver-phpmyadmin\n";
16     $OUT .="#-------------------------------------------------\n";
17     $OUT .="\n";
18     -
19     +
20     my $adminaccess = ($phpmyadmin{'adminaccess'} || 'enabled');
21     my $multiaccess = ($phpmyadmin{'multiaccess'} || 'disabled');
22     if (("$adminaccess" eq "enabled") || ("$multiaccess" eq "enabled"))
23 jcrisp 1.2 @@ -29,7 +30,6 @@
24     $OUT .= "# phpMyAdmin Multiuser access disabled\n";
25     }
26    
27     -
28     $OUT .= qq(
29     <Location /phpmyadmin>
30     AuthName "phpmyadmin"
31     @@ -41,6 +41,7 @@
32    
33     $OUT .= qq(
34     <Directory /usr/share/phpMyAdmin>
35     + SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=\$1
36     SSLRequireSSL
37     Options -Indexes
38     AllowOverride None
39     @@ -48,7 +49,6 @@
40     deny from all
41     );
42    
43     -
44     my $access = ($phpmyadmin{'access'} || 'private');
45    
46     if ("$access" eq "private")
47 jcrisp 1.1 @@ -60,27 +60,16 @@
48     $OUT .= "allow from all";
49     }
50    
51     - my $postmaxsize = ($phpmyadmin{'PostMaxSize'} || '100M');
52     - my $uploadmaxsize = ($phpmyadmin{'UploadMaxSize'} || '100M');
53     - my $memorylimit = ($phpmyadmin{'MemoryLimit'} || '500M');
54     + my $version = ($phpmyadmin{'PHPVersion'} || $PHPVersion || '73');
55    
56     $OUT .= qq(
57     Satisfy all
58     AddType application/x-httpd-php .php .php3
59    
60     <FilesMatch .php\$\>
61     - SetHandler "proxy:unix:/var/run/php-fpm/php71.sock|fcgi://localhost"
62     + SetHandler "proxy:unix:/var/run/php-fpm/php$version-phpmyadmin.sock|fcgi://localhost"
63     </FilesMatch>
64    
65     - #php_flag magic_quotes_gpc on
66     - #php_flag track_vars on
67     - #php_admin_value open_basedir /usr/share/php:/usr/share/phpMyAdmin:/etc/phpMyAdmin:/var/lib/phpMyAdmin
68     - #php_admin_value session.save_path /var/lib/phpMyAdmin/tmp
69     - #php_admin_value post_max_size $postmaxsize
70     - #php_admin_value upload_max_filesize $uploadmaxsize
71     - #php_admin_value memory_limit $memorylimit
72     - #php_admin_flag session.use_trans_sid 0
73     - #php_admin_value upload_tmp_dir /var/lib/phpMyAdmin/tmp
74     </Directory>
75    
76    
77 jcrisp 1.2 @@ -118,4 +107,4 @@
78     $OUT .= "# phpmyadmin is disabled";
79     }
80     }
81     -
82     +# 86PhpmyadminAlias End
83 jcrisp 1.1 diff -ruN smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/30PhpmyadminAlias smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/30PhpmyadminAlias
84     --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/30PhpmyadminAlias 2020-12-18 12:50:59.934881670 +0100
85 jcrisp 1.2 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/30PhpmyadminAlias 2020-12-22 14:43:33.375754951 +0100
86     @@ -1,7 +1,8 @@
87     +# 30phpmyadmin start
88 jcrisp 1.1 {
89     $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no';
90     -my $adminaccess = ($phpmyadmin{'adminaccess'} || 'enabled');
91     -my $multiaccess = ($phpmyadmin{'multiaccess'} || 'disabled');
92     + my $adminaccess = ($phpmyadmin{'adminaccess'} || 'enabled');
93     + my $multiaccess = ($phpmyadmin{'multiaccess'} || 'disabled');
94    
95     if (($port eq "80") && ($haveSSL eq 'yes') && ("$adminaccess" eq "enabled" || "$multiaccess" eq "enabled"))
96     {
97 jcrisp 1.2 @@ -14,4 +15,4 @@
98     $OUT .= " RewriteRule ^/phpmyadmin-multi(/.*|\$) https://%{HTTP_HOST}/phpmyadmin-multi\$1 [L,R]\n";
99     }
100     }
101     -
102     +# 30phpmyadmin end
103 jcrisp 1.1 diff -ruN smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin
104     --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin 1970-01-01 01:00:00.000000000 +0100
105 jcrisp 1.2 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin 2020-12-22 14:11:13.590207009 +0100
106     @@ -0,0 +1,74 @@
107 jcrisp 1.1 +{
108     +
109     +if ($PHP_VERSION eq '73'){
110     + if (($phpmyadmin{'status'} || 'disabled') eq 'enabled'){
111     + my $max_upload_size = ($phpmyadmin{MaxUploadSize} || '100M');# 104857600 bytes
112     + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
113     + my $memory_limit = ($phpmyadmin{MemoryLimit} || '512M');
114     + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/);
115     + my $open_basedir= $phpmyadmin{PHPBaseDir} || '';
116     + $open_basedir = "/etc/phpMyAdmin:/usr/share/phpMyAdmin:/usr/share/phpMyAdmin/doc/html:/usr/share/php:/var/lib/php/phpmyadmin:/var/log/phpmyadmin:/dev/urandom:/proc/meminfo:$open_basedir";
117     + my $max_children = $phpmyadmin{'PHPmaxChildren'} || 20;
118     + my $min_spare_servers = $phpmyadmin{'PHPminServers'} || 4;
119     + my $start_servers = $phpmyadmin{'PHPstartServers'} || 6;
120     + my $max_spare_servers = $phpmyadmin{'PHPmaxServers'} || 8;
121     + my $max_requests = $phpmyadmin{'PHPmaxRequests'} || 1000;
122     + $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers;
123     + $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers;
124     + my $id = 'phpmyadmin'; # Note the package is phpMyAdmin
125     + $OUT .=<<_EOF;
126     +
127     +[php$PHP_VERSION-$id]
128     +user = www
129     +group = www
130     +listen.owner = root
131     +listen.group = www
132     +listen.mode = 0660
133     +listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock
134     +pm = dynamic
135     +pm.max_children = $max_children
136     +pm.start_servers = $start_servers
137     +pm.min_spare_servers = $min_spare_servers
138     +pm.max_spare_servers = $max_spare_servers
139     +pm.max_requests = $max_requests
140     +; Used in nextcloud
141     +;php_admin_value[session.save_path] = /var/lib/php/$id/session
142     +; Deprecated
143     +;php_admin_value[session.gc_maxlifetime] = 86400
144     +; Used in nextcloud
145     +;php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache
146     +; Note the capitalisation here - can't use $id
147     +php_admin_value[upload_tmp_dir] = /var/lib/php/phpMyAdmin/tmp
148     +php_admin_value[error_log] = /var/log/php/$id/error.log
149     +; Is slowlog needed?
150     +; slowlog = /var/log/php/phpmyadmin/slow.log
151     +php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
152     +php_admin_flag[display_errors] = off
153     +php_admin_flag[log_errors] = on
154     +php_admin_value[error_log] = syslog
155     +php_admin_value[memory_limit] = $memory_limit
156     +php_admin_value[max_execution_time] = 3600
157     +php_admin_value[post_max_size] = $max_upload_size
158     +php_admin_value[upload_max_filesize] = $max_upload_size
159     +php_admin_value[disable_functions] = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd
160     +php_admin_value[open_basedir] = $open_basedir
161     +php_admin_flag[allow_url_fopen] = on
162     +php_admin_flag[file_upload] = on
163     +php_admin_flag[session.cookie_httponly] = on
164     +php_admin_flag[allow_url_include] = off
165     +php_admin_value[session.save_handler] = files
166     +php_admin_flag[output_buffering] = off
167     +
168 jcrisp 1.2 +; For HTTP AUTH
169     +; disabled for now
170     +;php_admin_value[auto_prepend_file] = /usr/share/php/auth_translation.php
171     +
172 jcrisp 1.1 +_EOF
173     +
174     + }
175     + else{
176     + $OUT .= '; phpmyadmin is disabled';
177     + }
178     +}
179     +}
180     +
181     diff -ruN smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/10config smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/10config
182     --- smeserver-phpmyadmin-4.0.10.2.old/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/10config 2020-12-18 12:50:59.934881670 +0100
183 jcrisp 1.2 +++ smeserver-phpmyadmin-4.0.10.2/root/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/10config 2020-12-18 16:42:50.631355859 +0100
184 jcrisp 1.1 @@ -39,7 +39,7 @@
185     }
186     else
187     {
188     - $OUT .="# standelaone admin configuration disabled";
189     + $OUT .="# standalone admin configuration disabled";
190     }
191     }
192     # end of standalone login part
193     diff -ruN smeserver-phpmyadmin-4.0.10.2.old/root/usr/share/phpMyAdmin/.unit.ini smeserver-phpmyadmin-4.0.10.2/root/usr/share/phpMyAdmin/.unit.ini
194     --- smeserver-phpmyadmin-4.0.10.2.old/root/usr/share/phpMyAdmin/.unit.ini 2020-12-18 12:50:59.934881670 +0100
195 jcrisp 1.2 +++ smeserver-phpmyadmin-4.0.10.2/root/usr/share/phpMyAdmin/.unit.ini 2020-12-18 16:42:50.631355859 +0100
196 jcrisp 1.1 @@ -1,10 +1,11 @@
197     -magic_quotes_gpc= on
198     -track_vars= on
199     +#Moved to php pool
200     +#magic_quotes_gpc= on
201     +#track_vars= on
202     #open_basedir=/usr/share/php:/usr/share/phpMyAdmin:/etc/phpMyAdmin:/var/lib/phpMyAdmin
203     -session.save_path=/var/lib/phpMyAdmin/tmp
204     -post_max_size=100M
205     -upload_max_filesize=100M
206     -memory_limit=500M
207     -session.use_trans_sid=0
208     -upload_tmp_dir=/var/lib/phpMyAdmin/tmp
209     +#session.save_path=/var/lib/phpMyAdmin/tmp
210     +#post_max_size=100M
211     +#upload_max_filesize=100M
212     +#memory_limit=500M
213     +#session.use_trans_sid=0
214     +#upload_tmp_dir=/var/lib/phpMyAdmin/tmp
215    

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed