From e590ff9746f6a5c3e5e367e4c8b1ca0efee7284b Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Sat, 23 Mar 2024 15:31:58 +1100 Subject: [PATCH] initial commit of file from CVS for smeserver-php on Sat Mar 23 15:31:58 AEDT 2024 --- .gitignore | 4 + Makefile | 21 + README.md | 19 +- contriborbase | 1 + createlinks | 140 +++ root/etc/cron.daily/tmpwatch-php | 2 + .../e-smith/db/accounts/migrate/20ibay-php | 36 + .../db/configuration/defaults/php-fpm/status | 1 + .../db/configuration/defaults/php-fpm/type | 1 + .../configuration/defaults/php/AllowUrlFopen | 1 + .../db/configuration/defaults/php/status | 1 + .../db/configuration/defaults/php/type | 1 + .../defaults/php55-php-fpm/status | 1 + .../configuration/defaults/php55-php-fpm/type | 1 + .../defaults/php55/AllowUrlFopen | 1 + .../db/configuration/defaults/php55/type | 1 + .../defaults/php56-php-fpm/status | 1 + .../configuration/defaults/php56-php-fpm/type | 1 + .../defaults/php56/AllowUrlFopen | 1 + .../db/configuration/defaults/php56/type | 1 + .../defaults/php70-php-fpm/status | 1 + .../configuration/defaults/php70-php-fpm/type | 1 + .../defaults/php70/AllowUrlFopen | 1 + .../db/configuration/defaults/php70/type | 1 + .../defaults/php71-php-fpm/status | 1 + .../configuration/defaults/php71-php-fpm/type | 1 + .../defaults/php71/AllowUrlFopen | 1 + .../db/configuration/defaults/php71/type | 1 + .../defaults/php72-php-fpm/status | 1 + .../configuration/defaults/php72-php-fpm/type | 1 + .../defaults/php72/AllowUrlFopen | 1 + .../db/configuration/defaults/php72/type | 1 + .../defaults/php73-php-fpm/status | 1 + .../configuration/defaults/php73-php-fpm/type | 1 + .../defaults/php73/AllowUrlFopen | 1 + .../db/configuration/defaults/php73/type | 1 + .../defaults/php74-php-fpm/status | 1 + .../configuration/defaults/php74-php-fpm/type | 1 + .../defaults/php74/AllowUrlFopen | 1 + .../db/configuration/defaults/php74/type | 1 + .../defaults/php80-php-fpm/status | 1 + .../configuration/defaults/php80-php-fpm/type | 1 + .../defaults/php80/AllowUrlFopen | 1 + .../db/configuration/defaults/php80/type | 1 + .../defaults/php81-php-fpm/status | 1 + .../configuration/defaults/php81-php-fpm/type | 1 + .../defaults/php81/AllowUrlFopen | 1 + .../db/configuration/defaults/php81/type | 1 + .../defaults/php82-php-fpm/status | 1 + .../configuration/defaults/php82-php-fpm/type | 1 + .../defaults/php82/AllowUrlFopen | 1 + .../db/configuration/defaults/php82/type | 1 + .../defaults/php83-php-fpm/status | 1 + .../configuration/defaults/php83-php-fpm/type | 1 + .../defaults/php83/AllowUrlFopen | 1 + .../db/configuration/defaults/php83/type | 1 + .../db/configuration/migrate/PhpMagicQuotes | 6 + .../e-smith/events/actions/php-pool-customs | 28 + root/etc/e-smith/events/actions/php-pool-dirs | 52 + .../templates-default/template-begin-ini | 11 + .../etc/cron.daily/tmpwatch-php-fpm | 1 + .../etc/opt/remi/php70/php-fpm.conf | 2 + .../etc/opt/remi/php70/php-fpm.d/custom.conf | 2 + .../etc/opt/remi/php70/php-fpm.d/ibays.conf | 2 + .../etc/opt/remi/php70/php-fpm.d/www.conf | 2 + .../etc/opt/remi/php70/php.ini | 2 + .../etc/opt/remi/php70/sysconfig/php-fpm | 2 + .../etc/opt/remi/php71/php-fpm.conf | 2 + .../etc/opt/remi/php71/php-fpm.d/custom.conf | 2 + .../etc/opt/remi/php71/php-fpm.d/ibays.conf | 2 + .../etc/opt/remi/php71/php-fpm.d/www.conf | 2 + .../etc/opt/remi/php71/php.ini | 2 + .../etc/opt/remi/php71/sysconfig/php-fpm | 2 + .../etc/opt/remi/php72/php.ini | 3 + .../etc/opt/remi/php73/php.ini | 2 + .../etc/opt/remi/php74/php.ini | 2 + .../etc/opt/remi/php80/php.ini | 1 + .../etc/opt/remi/php81/php.ini | 1 + .../etc/opt/remi/php82/php.ini | 1 + .../etc/opt/remi/php83/php.ini | 1 + .../templates.metadata/etc/php-fpm.conf | 2 + .../etc/php-fpm.d/custom.conf | 2 + .../etc/php-fpm.d/ibays.conf | 2 + .../templates.metadata/etc/php-fpm.d/www.conf | 2 + .../e-smith/templates.metadata/etc/php.ini | 2 + .../opt/remi/php55/root/etc/php.ini | 2 + .../opt/remi/php56/root/etc/php-fpm.conf | 2 + .../remi/php56/root/etc/php-fpm.d/custom.conf | 2 + .../remi/php56/root/etc/php-fpm.d/ibays.conf | 2 + .../remi/php56/root/etc/php-fpm.d/www.conf | 2 + .../opt/remi/php56/root/etc/php.ini | 2 + .../opt/remi/php56/root/etc/sysconfig/php-fpm | 2 + .../cron.daily/tmpwatch-php-fpm/10Defaults | 8 + .../etc/cron.daily/tmpwatch-php-fpm/20Ibays | 14 + .../etc/cron.daily/tmpwatch-php-fpm/20Shares | 14 + .../httpd/conf/httpd.conf/20LoadModule80PHP | 17 + .../conf/httpd.conf/20LoadModule81FastCGI | 6 + .../conf/httpd.conf/50DirectoryIndex00PHP | 10 + .../etc/httpd/conf/httpd.conf/65AddIcon00PHP | 15 + .../etc/httpd/conf/httpd.conf/81SimpleVHosts | 35 + .../conf/httpd.conf/95AddType00PHP2ibays | 92 ++ .../conf/httpd.conf/WebAppVirtualHost/00Setup | 9 + .../httpd.conf/WebAppVirtualHost/02ServerName | 1 + .../WebAppVirtualHost/03ServerAlias | 13 + .../WebAppVirtualHost/25SSLDirectives | 28 + .../WebAppVirtualHost/26RewriteTraceAndTrack | 8 + .../WebAppVirtualHost/40ApacheIconAlias | 13 + .../httpd.conf/WebAppVirtualHost/50Content | 161 ++++ .../WebAppVirtualHost/template-begin | 2 + .../httpd.conf/WebAppVirtualHost/template-end | 2 + .../templates/etc/logrotate.d/php-fpm/php-fpm | 52 + .../templates/etc/php-fpm.conf/010Include | 1 + .../templates/etc/php-fpm.conf/020Global | 1 + .../e-smith/templates/etc/php-fpm.conf/030Pid | 1 + .../e-smith/templates/etc/php-fpm.conf/040Log | 4 + .../templates/etc/php-fpm.conf/050Daemon | 1 + .../templates/etc/php-fpm.d/custom.conf/10All | 87 ++ .../etc/php-fpm.d/ibays.conf/10Ibays | 84 ++ .../etc/php-fpm.d/www.conf/00Default00Header | 22 + .../etc/php-fpm.d/www.conf/00Default10User | 2 + .../etc/php-fpm.d/www.conf/00Default20Listen | 4 + .../php-fpm.d/www.conf/00Default30Childrens | 7 + .../etc/php-fpm.d/www.conf/00Default40Paths | 11 + .../php-fpm.d/www.conf/00Default50Settings | 22 + root/etc/e-smith/templates/etc/php.ini/00PHP | 7 + .../templates/etc/php.ini/10LanguageOptions | 41 + .../e-smith/templates/etc/php.ini/15ExposePHP | 5 + .../templates/etc/php.ini/20ResourceLimits | 12 + .../templates/etc/php.ini/30ErrorHandling | 11 + .../templates/etc/php.ini/40DataHandling | 12 + .../templates/etc/php.ini/50PathsDirectories | 8 + .../templates/etc/php.ini/60FileUploads | 10 + .../templates/etc/php.ini/65FopenWrappers | 3 + .../e-smith/templates/etc/php.ini/70TimeZone | 2 + .../etc/php.ini/80ModuleSettings01Cli | 3 + .../etc/php.ini/80ModuleSettings01Syslog | 3 + .../php.ini/80ModuleSettings02mailfunction | 18 + .../etc/php.ini/80ModuleSettings04PCRE | 8 + .../etc/php.ini/80ModuleSettings05Pdo | 4 + .../etc/php.ini/80ModuleSettings06SQL | 3 + .../etc/php.ini/80ModuleSettings07Interbase | 8 + .../etc/php.ini/80ModuleSettings07ODBC | 8 + .../etc/php.ini/80ModuleSettings08MySQL | 14 + .../etc/php.ini/80ModuleSettings08MySQLi | 11 + .../etc/php.ini/80ModuleSettings08MySQLnd | 4 + .../etc/php.ini/80ModuleSettings09mSQL | 5 + .../etc/php.ini/80ModuleSettings10PostgresSQL | 8 + .../etc/php.ini/80ModuleSettings11Sybase | 8 + .../etc/php.ini/80ModuleSettings12Sybase-CT | 7 + .../etc/php.ini/80ModuleSettings13bcmath | 3 + .../etc/php.ini/80ModuleSettings14browscap | 2 + .../etc/php.ini/80ModuleSettings16Session | 49 + .../etc/php.ini/80ModuleSettings17MSSQL | 9 + .../etc/php.ini/80ModuleSettings18Assertion | 2 + .../etc/php.ini/80ModuleSettings19IngresII | 8 + .../etc/php.ini/80ModuleSettings21Sockets | 3 + .../etc/php.ini/80ModuleSettings22Tidy | 3 + .../etc/php.ini/80ModuleSettings23Soap | 6 + .../etc/php.ini/80ModuleSettings24Ldap | 3 + .../e-smith/templates/etc/rsyslog.conf/32php | 28 + .../templates/etc/sysconfig/php-fpm/10PidFile | 1 + .../usr/share/perl5/vendor_perl/esmith/php.pm | 272 ++++++ root/usr/share/php/auth_translation.php | 22 + smeserver-php.spec | 897 ++++++++++++++++++ 164 files changed, 2705 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 contriborbase create mode 100644 createlinks create mode 100644 root/etc/cron.daily/tmpwatch-php create mode 100644 root/etc/e-smith/db/accounts/migrate/20ibay-php create mode 100644 root/etc/e-smith/db/configuration/defaults/php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php55-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php55-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php55/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php55/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php56-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php56-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php56/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php56/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php70-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php70-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php70/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php70/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php71-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php71-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php71/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php71/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php72-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php72-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php72/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php72/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php73-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php73-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php73/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php73/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php74-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php74-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php74/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php74/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php80-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php80-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php80/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php80/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php81-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php81-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php81/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php81/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php82-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php82-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php82/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php82/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php83-php-fpm/status create mode 100644 root/etc/e-smith/db/configuration/defaults/php83-php-fpm/type create mode 100644 root/etc/e-smith/db/configuration/defaults/php83/AllowUrlFopen create mode 100644 root/etc/e-smith/db/configuration/defaults/php83/type create mode 100644 root/etc/e-smith/db/configuration/migrate/PhpMagicQuotes create mode 100644 root/etc/e-smith/events/actions/php-pool-customs create mode 100644 root/etc/e-smith/events/actions/php-pool-dirs create mode 100644 root/etc/e-smith/templates-default/template-begin-ini create mode 100644 root/etc/e-smith/templates.metadata/etc/cron.daily/tmpwatch-php-fpm create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/custom.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/ibays.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/www.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php70/sysconfig/php-fpm create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/custom.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/ibays.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/www.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php71/sysconfig/php-fpm create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php72/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php73/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php74/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php80/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php82/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/opt/remi/php83/php.ini create mode 100644 root/etc/e-smith/templates.metadata/etc/php-fpm.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/php-fpm.d/custom.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/php-fpm.d/ibays.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/php-fpm.d/www.conf create mode 100644 root/etc/e-smith/templates.metadata/etc/php.ini create mode 100644 root/etc/e-smith/templates.metadata/opt/remi/php55/root/etc/php.ini create mode 100644 root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.conf create mode 100644 root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/custom.conf create mode 100644 root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/ibays.conf create mode 100644 root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/www.conf create mode 100644 root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php.ini create mode 100644 root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/sysconfig/php-fpm create mode 100644 root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/10Defaults create mode 100644 root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Ibays create mode 100644 root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Shares create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule80PHP create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule81FastCGI create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/50DirectoryIndex00PHP create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/65AddIcon00PHP create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/81SimpleVHosts create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/00Setup create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/02ServerName create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/25SSLDirectives create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/26RewriteTraceAndTrack create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/40ApacheIconAlias create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/template-begin create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/template-end create mode 100644 root/etc/e-smith/templates/etc/logrotate.d/php-fpm/php-fpm create mode 100644 root/etc/e-smith/templates/etc/php-fpm.conf/010Include create mode 100644 root/etc/e-smith/templates/etc/php-fpm.conf/020Global create mode 100644 root/etc/e-smith/templates/etc/php-fpm.conf/030Pid create mode 100644 root/etc/e-smith/templates/etc/php-fpm.conf/040Log create mode 100644 root/etc/e-smith/templates/etc/php-fpm.conf/050Daemon create mode 100644 root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All create mode 100644 root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays create mode 100644 root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default00Header create mode 100644 root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default10User create mode 100644 root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default20Listen create mode 100644 root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default30Childrens create mode 100644 root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default40Paths create mode 100644 root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default50Settings create mode 100644 root/etc/e-smith/templates/etc/php.ini/00PHP create mode 100644 root/etc/e-smith/templates/etc/php.ini/10LanguageOptions create mode 100644 root/etc/e-smith/templates/etc/php.ini/15ExposePHP create mode 100644 root/etc/e-smith/templates/etc/php.ini/20ResourceLimits create mode 100644 root/etc/e-smith/templates/etc/php.ini/30ErrorHandling create mode 100644 root/etc/e-smith/templates/etc/php.ini/40DataHandling create mode 100644 root/etc/e-smith/templates/etc/php.ini/50PathsDirectories create mode 100644 root/etc/e-smith/templates/etc/php.ini/60FileUploads create mode 100644 root/etc/e-smith/templates/etc/php.ini/65FopenWrappers create mode 100644 root/etc/e-smith/templates/etc/php.ini/70TimeZone create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings01Cli create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings01Syslog create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings02mailfunction create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings04PCRE create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings05Pdo create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings06SQL create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings07Interbase create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings07ODBC create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQL create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQLi create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQLnd create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings09mSQL create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings10PostgresSQL create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings11Sybase create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings12Sybase-CT create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings13bcmath create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings14browscap create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings16Session create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings17MSSQL create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings18Assertion create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings19IngresII create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings21Sockets create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings22Tidy create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings23Soap create mode 100644 root/etc/e-smith/templates/etc/php.ini/80ModuleSettings24Ldap create mode 100644 root/etc/e-smith/templates/etc/rsyslog.conf/32php create mode 100644 root/etc/e-smith/templates/etc/sysconfig/php-fpm/10PidFile create mode 100644 root/usr/share/perl5/vendor_perl/esmith/php.pm create mode 100644 root/usr/share/php/auth_translation.php create mode 100644 smeserver-php.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbb3a13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.gz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0e01eec --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: smeserver-php +# $Id: Makefile,v 1.1 2020/01/28 19:39:21 jpp Exp $ +NAME := smeserver-php +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index c48f708..b8b8398 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ -# smeserver-php +# smeserver-php -SMEServer Koozali developed git repo for smeserver-php smeserver \ No newline at end of file +SMEServer Koozali developed git repo for smeserver-php smeserver + +## Wiki +
https://wiki.koozali.org/PHP +
https://wiki.koozali.org/PHP/fr +
https://wiki.koozali.org/Php-fpm +
https://wiki.koozali.org/PHP_Software_Collections + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-php&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..ef36a67 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +sme10 diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..4b55983 --- /dev/null +++ b/createlinks @@ -0,0 +1,140 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); +my $ver; my $service; my $file; my $event; + +#old e-smith-php +foreach $file (qw(/etc/php.ini +/opt/remi/php55/root/etc/php.ini +/opt/remi/php56/root/etc/php.ini +/etc/opt/remi/php70/php.ini +/etc/opt/remi/php71/php.ini +/etc/opt/remi/php72/php.ini +/etc/opt/remi/php73/php.ini +/etc/opt/remi/php74/php.ini +/etc/opt/remi/php80/php.ini +/etc/opt/remi/php81/php.ini +/etc/opt/remi/php82/php.ini +/etc/opt/remi/php83/php.ini +)){ + templates2events($file, qw( + console-save + bootstrap-console-save + webapps-update + smeserver-php-update + )); +} + +templates2events("/etc/rsyslog.conf","smeserver-php-update"); +safe_symlink("restart", "root/etc/e-smith/events/smeserver-php-update/services2adjust/rsyslog"); + +#new php-fpm +foreach $service (qw(php-fpm)){ + foreach $event (qw(webapps-update ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers )){ + safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/$service"); + } + $event="smeserver-php-update"; + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/$service"); +} + +for $event (qw(smeserver-php-update webapps-update)){ + $service="httpd-e-smith"; + #when moved to systemd could become a reload-or-restart + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/$service"); + $file="/etc/httpd/conf/httpd.conf"; + templates2events($file, $event); +} + +foreach $ver (qw( 55 56 70 71 72 73 74 80 81 82 83)){ +foreach $service ( "php$ver-php-fpm" ){ + foreach $event (qw(webapps-update ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers )){ + safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/$service"); + } + $event="smeserver-php-update"; + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/$service"); + } +} + +#general php-fpm +foreach $file (qw( /etc/php-fpm.conf + /etc/php-fpm.d/www.conf + /etc/php-fpm.d/ibays.conf + /etc/php-fpm.d/custom.conf)){ + templates2events($file, qw(webapps-update bootstrap-console-save ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update)); + safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin"); + } + safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates/etc/php.ini/template-begin"); + +foreach $file (qw( /etc/sysconfig/php-fpm + /etc/logrotate.d/php-fpm + /etc/logrotate.d/php55-php-fpm + /etc/logrotate.d/php56-php-fpm + /etc/logrotate.d/php70-php-fpm + /etc/logrotate.d/php70-php-fpm + /etc/logrotate.d/php71-php-fpm + /etc/logrotate.d/php72-php-fpm + /etc/logrotate.d/php73-php-fpm + /etc/logrotate.d/php74-php-fpm + /etc/logrotate.d/php80-php-fpm + /etc/logrotate.d/php81-php-fpm + /etc/logrotate.d/php82-php-fpm + /etc/logrotate.d/php83-php-fpm + )){ + templates2events($file, qw(webapps-update bootstrap-console-save smeserver-php-update)); + } + +#php5* +foreach $ver (qw( 55 56 )){ +foreach $file ( "/opt/remi/php$ver/root/etc/php-fpm.conf", + "/opt/remi/php$ver/root/etc/php-fpm.d/www.conf", + "/opt/remi/php$ver/root/etc/php-fpm.d/ibays.conf", + "/opt/remi/php$ver/root/etc/php-fpm.d/custom.conf" ){ + templates2events($file, qw(webapps-update bootstrap-console-save ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update)); + #safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin"); + } +foreach $file ( "/opt/remi/php$ver/root/etc/sysconfig/php-fpm" ){ + templates2events($file, qw(webapps-update bootstrap-console-save)); + } + +} + +#php7* +foreach $ver (qw( 70 71 72 73 74 80 81 82 83)){ +foreach $file ( "/etc/opt/remi/php$ver/php-fpm.conf", + "/etc/opt/remi/php$ver/php-fpm.d/www.conf", + "/etc/opt/remi/php$ver/php-fpm.d/ibays.conf", + "/etc/opt/remi/php$ver/php-fpm.d/custom.conf" ){ + templates2events($file, qw(webapps-update bootstrap-console-save ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update)); + #safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin"); + } +foreach $file ( "/etc/opt/remi/php$ver/sysconfig/php-fpm" ){ + templates2events($file, qw(webapps-update bootstrap-console-save smeserver-php-update)); + } +} + +safe_symlink('/etc/e-smith/templates-default/template-begin-shell', 'root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/template-begin'); + +foreach my $event (qw( ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update post-install post-upgrade)) { + event_link( "php-pool-dirs", $event, "90"); +} + +foreach my $event (qw( ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update console-save post-upgrade post-install )) { + event_link( "php-pool-customs", $event, "90"); +} + + +# systemd units +#foreach $ver (qw( 55 56 70 71 72 73 74 )){ +#$service = "php$ver-php-fpm.service"; +#safe_symlink("../$service", "root/usr/lib/systemd/system/multi-user.target.wants/$service"); +#safe_symlink("../$service", "root/usr/lib/systemd/system/sme-server.target.wants/$service"); +#} +#$service = "php-fpm.service"; +#safe_symlink("../$service", "root/usr/lib/systemd/system/multi-user.target.wants/$service"); +#safe_symlink("../$service", "root/usr/lib/systemd/system/sme-server.target.wants/$service"); + +#webapps +$event = 'webapps-update'; +templates2events("/etc/my.cnf", $event); + +safe_symlink("start", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); diff --git a/root/etc/cron.daily/tmpwatch-php b/root/etc/cron.daily/tmpwatch-php new file mode 100644 index 0000000..8234e2c --- /dev/null +++ b/root/etc/cron.daily/tmpwatch-php @@ -0,0 +1,2 @@ +[ -d /var/lib/php ] && /usr/sbin/tmpwatch --nodirs -f 8 /var/lib/php +[ -d /var/cache/e-smith/files/ibays ] && /usr/sbin/tmpwatch --nodirs -f 8 /var/cache/e-smith/files/ibays diff --git a/root/etc/e-smith/db/accounts/migrate/20ibay-php b/root/etc/e-smith/db/accounts/migrate/20ibay-php new file mode 100644 index 0000000..f66b129 --- /dev/null +++ b/root/etc/e-smith/db/accounts/migrate/20ibay-php @@ -0,0 +1,36 @@ +{ + my %old2new = ( + UpMaxFileSize => "UploadMaxFilesize", + PHPUploadMaxFilesize => "UploadMaxFilesize", + PHPPostMaxSize => "PostMaxSize", + PHPMaxExecutionTime => "MaxExecutionTime", + PHPMemoryLimit => "MemoryLimit", + PHPAllowUrlfOpen => "AllowUrlFopen", + PHPFileUpload => "FileUpload", + PHPDisabledFunctions => "DisabledFunctions", + PHPAutoPrependFile => "AutoPrependFile", + PHPCustomPool => "CustomPool", + PHPMaxInputTime => "MaxInputTime", + MaxExecTime => "MaxExecutionTime", + ); + + foreach my $ibay ($DB->get_all_by_prop(type => 'ibay')) + { + for my $key (keys %old2new) + { + next unless (defined $ibay->prop($key)); + my $value = $DB->get_prop_and_delete($ibay->key, $key); + next if (defined $ibay->prop($old2new{$key}) ); + $DB->set_prop($ibay->key, $old2new{$key}, $value); + } + for my $key (qw(MemoryLimit UploadMaxFilesize PostMaxSize MaxExecutionTime)) + { + next unless (defined $ibay->prop($key)); + my $value = $DB->get_prop_and_delete($ibay->key, $key) if ($ibay->prop($key) eq "disabled"); + next unless $key eq "MaxExecutionTime"; + $DB->set_prop($ibay->key,MaxExecutionTime,0) if ($ibay->prop($key) eq "unlimited"); + } + + } +} + diff --git a/root/etc/e-smith/db/configuration/defaults/php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php/status b/root/etc/e-smith/db/configuration/defaults/php/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php/type b/root/etc/e-smith/db/configuration/defaults/php/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php55-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php55-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php55-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php55-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php55-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php55-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php55/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php55/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php55/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php55/type b/root/etc/e-smith/db/configuration/defaults/php55/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php55/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php56-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php56-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php56-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php56-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php56-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php56-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php56/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php56/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php56/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php56/type b/root/etc/e-smith/db/configuration/defaults/php56/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php56/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php70-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php70-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php70-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php70-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php70-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php70-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php70/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php70/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php70/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php70/type b/root/etc/e-smith/db/configuration/defaults/php70/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php70/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php71-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php71-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php71-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php71-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php71-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php71-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php71/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php71/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php71/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php71/type b/root/etc/e-smith/db/configuration/defaults/php71/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php71/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php72-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php72-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php72-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php72-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php72-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php72-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php72/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php72/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php72/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php72/type b/root/etc/e-smith/db/configuration/defaults/php72/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php72/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php73-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php73-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php73-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php73-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php73-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php73-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php73/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php73/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php73/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php73/type b/root/etc/e-smith/db/configuration/defaults/php73/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php73/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php74-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php74-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php74-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php74-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php74-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php74-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php74/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php74/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php74/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php74/type b/root/etc/e-smith/db/configuration/defaults/php74/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php74/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php80-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php80-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php80-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php80-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php80-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php80-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php80/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php80/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php80/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php80/type b/root/etc/e-smith/db/configuration/defaults/php80/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php80/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php81-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php81-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php81-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php81-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php81-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php81-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php81/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php81/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php81/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php81/type b/root/etc/e-smith/db/configuration/defaults/php81/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php81/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php82-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php82-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php82-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php82-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php82-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php82-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php82/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php82/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php82/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php82/type b/root/etc/e-smith/db/configuration/defaults/php82/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php82/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/php83-php-fpm/status b/root/etc/e-smith/db/configuration/defaults/php83-php-fpm/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php83-php-fpm/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/php83-php-fpm/type b/root/etc/e-smith/db/configuration/defaults/php83-php-fpm/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php83-php-fpm/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/php83/AllowUrlFopen b/root/etc/e-smith/db/configuration/defaults/php83/AllowUrlFopen new file mode 100644 index 0000000..ce76936 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php83/AllowUrlFopen @@ -0,0 +1 @@ +Off diff --git a/root/etc/e-smith/db/configuration/defaults/php83/type b/root/etc/e-smith/db/configuration/defaults/php83/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/php83/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/migrate/PhpMagicQuotes b/root/etc/e-smith/db/configuration/migrate/PhpMagicQuotes new file mode 100644 index 0000000..ba24250 --- /dev/null +++ b/root/etc/e-smith/db/configuration/migrate/PhpMagicQuotes @@ -0,0 +1,6 @@ +{ + + $DB->get_prop_and_delete ('php', 'MagicQuotes'); + +} + diff --git a/root/etc/e-smith/events/actions/php-pool-customs b/root/etc/e-smith/events/actions/php-pool-customs new file mode 100644 index 0000000..d18d4d2 --- /dev/null +++ b/root/etc/e-smith/events/actions/php-pool-customs @@ -0,0 +1,28 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use File::Path qw(make_path remove_tree); +use esmith::ConfigDB; +use esmith::util; + +my $pool_db = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php'); + +foreach my $pool ($pool_db->get_all_by_prop(type => 'pool')){ + my $status = $pool->prop('status') || 'enabled'; + next unless ($status eq 'enabled'); + my $key = $pool->key; + my @dirs = ( "/var/log/php/$key", + "/var/lib/php/$key/session", + "/var/lib/php/$key/wsdlcache", + "/var/lib/php/$key/opcache", + "/var/lib/php/$key/tmp" ); + for (@dirs){ + esmith::util::chownFile("root", "www", $_) if -e $_; + make_path( $_, { + owner => 'root', + group => 'www' + }) unless -e $_; + } + chmod 0770, @dirs; +} diff --git a/root/etc/e-smith/events/actions/php-pool-dirs b/root/etc/e-smith/events/actions/php-pool-dirs new file mode 100644 index 0000000..4e74548 --- /dev/null +++ b/root/etc/e-smith/events/actions/php-pool-dirs @@ -0,0 +1,52 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use esmith::AccountsDB; +use File::Path qw(make_path remove_tree); +use esmith::util; + +my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n"; + +my $event = shift; +my $apool = shift; + +my @pools = (defined $apool && $a->get($apool) ) ? map { $a->get($_); } $apool : ( $a->get_all_by_prop(type => "ibay" ) , $a->get_all_by_prop(type => "share" ));# unless $acc; + +foreach my $acc (@pools){ + my $pool = $acc->key; + my $type = $acc->prop('type'); + my $dyn = 'disabled'; + if ( $type eq "ibay") { + $dyn = $acc->prop('CgiBin') || 'disabled'; + } + else { + $dyn = $acc->prop('DynamicContent') || 'disabled'; + } + + if ($dyn =~ m/^enabled|on|1|yes$/ && $event ne 'share-delete' && $event ne 'ibay-delete'){ + my @dirs = ( "/var/log/php/$pool", + "/var/lib/php/$pool/session", + "/var/lib/php/$pool/wsdlcache", + "/var/lib/php/$pool/opcache", + "/var/lib/php/$pool/tmp" ); + # create dir if does not exist; set owner and group if create it + # does not change ownership if folder already exists + for (@dirs){ + esmith::util::chownFile("root", "www", $_) if -e $_; + make_path( $_, { + owner => 'root', + group => 'www' + }) unless -e $_; + } + chmod 0770, @dirs; + } +} + +if ( defined $event && defined $apool && ($event eq 'share-delete' || $event eq 'ibay-delete') ) { + my $acc = $a->get($apool); + die "$apool not found in the account database\n" unless $acc; + remove_tree( "/var/log/php/$apool", + "/var/lib/php/$apool" ); +} + diff --git a/root/etc/e-smith/templates-default/template-begin-ini b/root/etc/e-smith/templates-default/template-begin-ini new file mode 100644 index 0000000..b36bcab --- /dev/null +++ b/root/etc/e-smith/templates-default/template-begin-ini @@ -0,0 +1,11 @@ +;------------------------------------------------------------ +; !!DO NOT MODIFY THIS FILE!! +; +; Manual changes will be lost when this file is regenerated. +; +; Please read the developer's guide, which is available +; at http://www.contribs.org/development/ +; +; Copyright (C) 1999-2006 Mitel Networks Corporation +;------------------------------------------------------------ + diff --git a/root/etc/e-smith/templates.metadata/etc/cron.daily/tmpwatch-php-fpm b/root/etc/e-smith/templates.metadata/etc/cron.daily/tmpwatch-php-fpm new file mode 100644 index 0000000..6bbf39b --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/cron.daily/tmpwatch-php-fpm @@ -0,0 +1 @@ +PERMS=0755 diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.conf b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.conf new file mode 100644 index 0000000..87418d0 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.conf" +MORE_DATA={ PHP_VERSION => 70, FPM_POOL_DIR => "/etc/opt/remi/php70/php-fpm.d" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/custom.conf b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/custom.conf new file mode 100644 index 0000000..4a4c2aa --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/custom.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/custom.conf" +MORE_DATA={ PHP_VERSION => 70 } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/ibays.conf b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/ibays.conf new file mode 100644 index 0000000..e9f2291 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/ibays.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/ibays.conf" +MORE_DATA={ PHP_VERSION => 70 } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/www.conf b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/www.conf new file mode 100644 index 0000000..ae55624 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/www.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/www.conf" +MORE_DATA={ PHP_VERSION => 70 } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php.ini new file mode 100644 index 0000000..ae869da --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php.ini @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php.ini" +MORE_DATA={ PHP_VERSION => 70, INCLUDE_PATH => ".:/opt/remi/php70/root/usr/share/pear:/opt/remi/php70/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php70/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/sysconfig/php-fpm b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/sysconfig/php-fpm new file mode 100644 index 0000000..daaeef2 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/sysconfig/php-fpm @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/sysconfig/php-fpm" +MORE_DATA={ PHP_VERSION => 70 } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.conf b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.conf new file mode 100644 index 0000000..e0ce9d1 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.conf" +MORE_DATA={ PHP_VERSION => 71, FPM_POOL_DIR => "/etc/opt/remi/php71/php-fpm.d" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/custom.conf b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/custom.conf new file mode 100644 index 0000000..953140e --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/custom.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/custom.conf" +MORE_DATA={ PHP_VERSION => 71 } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/ibays.conf b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/ibays.conf new file mode 100644 index 0000000..ff23235 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/ibays.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/ibays.conf" +MORE_DATA={ PHP_VERSION => 71 } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/www.conf b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/www.conf new file mode 100644 index 0000000..8790dd3 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/www.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/www.conf" +MORE_DATA={ PHP_VERSION => 71 } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php.ini new file mode 100644 index 0000000..5f7f5f1 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php.ini @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php.ini" +MORE_DATA={ PHP_VERSION => 71, INCLUDE_PATH => ".:/opt/remi/php70/root/usr/share/pear:/opt/remi/php71/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php71/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/sysconfig/php-fpm b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/sysconfig/php-fpm new file mode 100644 index 0000000..7fa3731 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/sysconfig/php-fpm @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/sysconfig/php-fpm" +MORE_DATA={ PHP_VERSION => 71 } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php72/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php72/php.ini new file mode 100644 index 0000000..8af1185 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php72/php.ini @@ -0,0 +1,3 @@ +TEMPLATE_PATH="/etc/php.ini" +MORE_DATA={ PHP_VERSION => 72, INCLUDE_PATH => ".:/opt/remi/php72/root/usr/share/pear:/opt/remi/php72/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php72/root/usr/lib64/php/modules" } + diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php73/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php73/php.ini new file mode 100644 index 0000000..0d074c8 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php73/php.ini @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php.ini" +MORE_DATA={ PHP_VERSION => 73, INCLUDE_PATH => ".:/opt/remi/php73/root/usr/share/pear:/opt/remi/php73/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php73/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php74/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php74/php.ini new file mode 100644 index 0000000..49e808f --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php74/php.ini @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php.ini" +MORE_DATA={ PHP_VERSION => 74, INCLUDE_PATH => ".:/opt/remi/php74/root/usr/share/pear:/opt/remi/php74/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php74/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php80/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php80/php.ini new file mode 100644 index 0000000..28f22dc --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php80/php.ini @@ -0,0 +1 @@ +MORE_DATA={ PHP_VERSION => 80, INCLUDE_PATH => ".:/opt/remi/php80/root/usr/share/pear:/opt/remi/php80/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php80/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php.ini new file mode 100644 index 0000000..31ef3c9 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php.ini @@ -0,0 +1 @@ +MORE_DATA={ PHP_VERSION => 81, INCLUDE_PATH => ".:/opt/remi/php81/root/usr/share/pear:/opt/remi/php81/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php81/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php82/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php82/php.ini new file mode 100644 index 0000000..1b2dfe3 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php82/php.ini @@ -0,0 +1 @@ +MORE_DATA={ PHP_VERSION => 82, INCLUDE_PATH => ".:/opt/remi/php82/root/usr/share/pear:/opt/remi/php82/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php82/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/etc/opt/remi/php83/php.ini b/root/etc/e-smith/templates.metadata/etc/opt/remi/php83/php.ini new file mode 100644 index 0000000..884a56d --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/opt/remi/php83/php.ini @@ -0,0 +1 @@ +MORE_DATA={ PHP_VERSION => 83, INCLUDE_PATH => ".:/opt/remi/php83/root/usr/share/pear:/opt/remi/php83/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php83/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/etc/php-fpm.conf b/root/etc/e-smith/templates.metadata/etc/php-fpm.conf new file mode 100644 index 0000000..9afef20 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/php-fpm.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.conf" +MORE_DATA={ PHP_VERSION => '', FPM_POOL_DIR => "/etc/php-fpm.d" } diff --git a/root/etc/e-smith/templates.metadata/etc/php-fpm.d/custom.conf b/root/etc/e-smith/templates.metadata/etc/php-fpm.d/custom.conf new file mode 100644 index 0000000..cfa7cdb --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/php-fpm.d/custom.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/custom.conf" +MORE_DATA={ PHP_VERSION => '' } diff --git a/root/etc/e-smith/templates.metadata/etc/php-fpm.d/ibays.conf b/root/etc/e-smith/templates.metadata/etc/php-fpm.d/ibays.conf new file mode 100644 index 0000000..0c1d444 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/php-fpm.d/ibays.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/ibays.conf" +MORE_DATA={ PHP_VERSION => '' } diff --git a/root/etc/e-smith/templates.metadata/etc/php-fpm.d/www.conf b/root/etc/e-smith/templates.metadata/etc/php-fpm.d/www.conf new file mode 100644 index 0000000..a8498d2 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/php-fpm.d/www.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/www.conf" +MORE_DATA={ PHP_VERSION => '' } diff --git a/root/etc/e-smith/templates.metadata/etc/php.ini b/root/etc/e-smith/templates.metadata/etc/php.ini new file mode 100644 index 0000000..a3d123a --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/php.ini @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php.ini" +MORE_DATA={ PHP_VERSION => '', INCLUDE_PATH => ".:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "" } diff --git a/root/etc/e-smith/templates.metadata/opt/remi/php55/root/etc/php.ini b/root/etc/e-smith/templates.metadata/opt/remi/php55/root/etc/php.ini new file mode 100644 index 0000000..e6cf4b0 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/opt/remi/php55/root/etc/php.ini @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php.ini" +MORE_DATA={ PHP_VERSION => 55, INCLUDE_PATH => ".:/opt/remi/php55/root/usr/share/pear:/opt/remi/php55/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php55/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.conf b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.conf new file mode 100644 index 0000000..ca5a61d --- /dev/null +++ b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.conf" +MORE_DATA={ PHP_VERSION => 56, FPM_POOL_DIR => "/opt/remi/php56/root/etc/php-fpm.d" } diff --git a/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/custom.conf b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/custom.conf new file mode 100644 index 0000000..789eee1 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/custom.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/custom.conf" +MORE_DATA={ PHP_VERSION => 56 } diff --git a/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/ibays.conf b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/ibays.conf new file mode 100644 index 0000000..9561518 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/ibays.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/ibays.conf" +MORE_DATA={ PHP_VERSION => 56 } diff --git a/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/www.conf b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/www.conf new file mode 100644 index 0000000..f4382e7 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/www.conf @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php-fpm.d/www.conf" +MORE_DATA={ PHP_VERSION => 56 } diff --git a/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php.ini b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php.ini new file mode 100644 index 0000000..de5f4ba --- /dev/null +++ b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php.ini @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/php.ini" +MORE_DATA={ PHP_VERSION => 56, INCLUDE_PATH => ".:/opt/remi/php56/root/usr/share/pear:/opt/remi/php56/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php56/root/usr/lib64/php/modules" } diff --git a/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/sysconfig/php-fpm b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/sysconfig/php-fpm new file mode 100644 index 0000000..59f6a8b --- /dev/null +++ b/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/sysconfig/php-fpm @@ -0,0 +1,2 @@ +TEMPLATE_PATH="/etc/sysconfig/php-fpm" +MORE_DATA={ PHP_VERSION => 56 } diff --git a/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/10Defaults b/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/10Defaults new file mode 100644 index 0000000..922a08f --- /dev/null +++ b/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/10Defaults @@ -0,0 +1,8 @@ + +for VER in php php55 php56 php70 php71 php72 php73 php74 php80 php81 php82 php83; do + /usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/tmp + /usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/opcache + /usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/wsdlcache + /usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/opcache +done + diff --git a/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Ibays b/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Ibays new file mode 100644 index 0000000..72424b3 --- /dev/null +++ b/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Ibays @@ -0,0 +1,14 @@ +{ +use esmith::AccountsDB; +my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n"; +foreach my $ibay ($a->get_all_by_prop(type => 'ibay')){ + next unless (($ibay->prop('CgiBin') || 'disabled') =~ m/^enabled|on|yes|1$/); + my $key = $ibay->key; + $OUT .=_EOF; +/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/tmp +/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache +/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/wsdlcache +/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache +_EOF +} +} diff --git a/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Shares b/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Shares new file mode 100644 index 0000000..301fc42 --- /dev/null +++ b/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/20Shares @@ -0,0 +1,14 @@ +{ +use esmith::AccountsDB; +my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n"; +foreach my $share ($a->get_all_by_prop(type => 'share')){ + next unless (($share->prop('DynamicContent') || 'disabled') =~ m/^enabled|on|yes|1$/); + my $key = $share->key; + $OUT .=_EOF; +/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/tmp +/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache +/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/wsdlcache +/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache +_EOF +} +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule80PHP b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule80PHP new file mode 100644 index 0000000..f114827 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule80PHP @@ -0,0 +1,17 @@ +{ + $phpModule = $php{phpModule} || 'disabled'; + # default we return with nothing activated + return "#PHP mod is disabled by default, please use PHP-fpm" unless (exists $php{status} and $php{status} eq "enabled" and $phpModule eq "enabled"); + + use esmith::php; + our $PHPVersion = PHPdefault(1); + my $phpMR = substr($PHPVersion,0,1) || ''; + #php7 software collection libphp72.so + return "LoadModule php$\{phpMR\}_module modules/libphp$PHPVersion.so\n" if (-r "/usr/lib64/httpd/modules/libphp$PHPVersion.so"); + #php5 software collection libphp56-php5.so + return "LoadModule php$\{phpMR\}_module modules/libphp$PHPVersion-php$phpMR.so\n" if (-r "/usr/lib64/httpd/modules/libphp$PHPVersion-php$phpMR.so"); + # else we default to base php + return "LoadModule php5_module modules/libphp5.so" if ( -r "/usr/lib/httpd/modules/libphp5.so" || + -r "/usr/lib64/httpd/modules/libphp5.so" ); + return "#no PHP module found"; +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule81FastCGI b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule81FastCGI new file mode 100644 index 0000000..a21bfd4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule81FastCGI @@ -0,0 +1,6 @@ +{ +$fastcgi_mod = 'mod_proxy_fcgi'; + $OUT .=<<_EOF; +LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so +_EOF +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/50DirectoryIndex00PHP b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/50DirectoryIndex00PHP new file mode 100644 index 0000000..ec66cf4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/50DirectoryIndex00PHP @@ -0,0 +1,10 @@ +{ + return "" unless (defined $php{'status'} and $php{'status'} eq 'enabled'); + + my @directives = qw( + index.htm index.html index.shtml index.cgi + index.php index.phtml + ); + + $OUT = "DirectoryIndex @directives\n"; +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/65AddIcon00PHP b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/65AddIcon00PHP new file mode 100644 index 0000000..6407d5b --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/65AddIcon00PHP @@ -0,0 +1,15 @@ +{ + return "" unless (exists $php{status} and $php{status} eq "enabled"); + + $OUT =< + AddIcon /icons/php.gif .phps .php .phtml + + + + AddIcon /icons/php.gif .phps .php .phtml + + +HERE +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/81SimpleVHosts b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/81SimpleVHosts new file mode 100644 index 0000000..c030403 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/81SimpleVHosts @@ -0,0 +1,35 @@ +{ + $OUT = ''; + + use esmith::DomainsDB; + + my $db = esmith::DomainsDB->open_ro; + unless ($db){ + warn "Couldn't open domains DB in VirtualHosts template fragment"; + return; + } + + my @vhosts = $db->get_all_by_prop('type' => 'vhost'); + foreach my $vhost (@vhosts) { + my $templatePath = $vhost->prop('TemplatePath') || 'WebAppVirtualHost'; + foreach my $port ($httpPort, $httpsPort){ + my %virtualHost = ( + ipAddress => '0.0.0.0', + port => $port, + localAccess => $localAccess, + externalSSLAccess => $externalSSLAccess, + domain => $vhost, + httpPort => $httpPort, + httpsPort => $httpsPort + ); + + $OUT .= esmith::templates::processTemplate ( + { + MORE_DATA => \%virtualHost, + TEMPLATE_PATH => + "/etc/httpd/conf/httpd.conf/$templatePath", + OUTPUT_TYPE => 'string', + }); + } + } +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays new file mode 100644 index 0000000..023ec49 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays @@ -0,0 +1,92 @@ +{ + use esmith::php; + my $status = $php{status} || 'disabled'; + if ($status eq 'enabled') + { + use esmith::AccountsDB; + my $adb = esmith::AccountsDB->open_ro(); + foreach my $ibay ($adb->ibays) + { + my %properties = $ibay->props; + my $key = $ibay->key; + local $dynamicContent = $ibay->prop('CgiBin') || 'disabled'; + if ($dynamicContent eq 'enabled') + { + $OUT .= "\nkey . "/html>\n"; + # configuration to enable php-fpm for the ibay + my $version = PhpFpmVersionToUse($ibay); + if ($fastcgi_mod eq 'mod_proxy_fcgi') + { + my $name = lc $key; + my $FilesMathes = ( ($ibay->prop('AllowPHTML') || $defaultPHPproperties{'AllowPHTML'}) eq 'enabled' ) ? '(xml|phtml|html|htm|php|phar)': '(phar|php)'; + + $OUT .=<<"_EOF"; + SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=\$1 + + + SetHandler "proxy:unix:/var/run/php-fpm/php$version-$name.sock|fcgi://localhost" + + +_EOF + } + else + { + my $FilesMathes = ( ($ibay->prop('AllowPHTML') || $defaultPHPproperties{'AllowPHTML'}) eq 'enabled' ) ? '.xml .phtml .html .htm ': ''; + $OUT .= " AddType application/x-httpd-php .php .phar $FilesMathes\n"; + $OUT .= " AddType application/x-httpd-php-source .phps\n"; + + # the following block is only in case phpmodule is enabled. + if (exists $php{status} and $php{status} eq "enabled" and $phpModule eq "enabled") + { + my $allow_url_fopen = $properties{'AllowUrlFopen'} || $defaultPHPproperties{'AllowUrlFopen'} ; + my $memoryLimit = $properties{'MemoryLimit'} || $defaultPHPproperties{'MemoryLimit'}; + my $upmaxfileSize = $properties{'UploadMaxFilesize'} || $defaultPHPproperties{'UploadMaxFilesize'}; + my $postmaxSize = $properties{'PostMaxSize'} || $defaultPHPproperties{'PostMaxSize'}; + my $file_upload = $properties{'FileUpload'} || $defaultPHPproperties{'FileUpload'}; + my $maxexecutionTime = (defined $properties{'MaxExecutionTime'}) ? $properties{'MaxExecutionTime'} : $defaultPHPproperties{'MaxExecutionTime'}; + my $max_input_time = (defined $properties{'MaxInputTime'}) ? $properties{'MaxInputTime'} : $defaultPHPproperties{'MaxInputTime'}; + my $display_errors = $properties{'DisplayErrors'} || 'off'; + my $error_reporting = $properties{'ErrorReporting'} || 'E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT'; + + $maxexecutionTime = '0' if $maxexecutionTime eq 'unlimited'; + $file_upload = ($file_upload =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $allow_url_fopen = ($allow_url_fopen =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $display_errors = ($display_errors =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $error_reporting = ($error_reporting eq 'E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT') ? '; default error_reporting' : "php_value[error_reporting] = $error_reporting"; + + $OUT .= " php_admin_flag allow_url_fopen $allow_url_fopen\n"; + $OUT .= " php_admin_value memory_limit $memoryLimit\n"; + $OUT .= " php_admin_value upload_max_filesize $upmaxfileSize\n"; + $OUT .= " php_admin_value post_max_size $postmaxSize\n" ; + $OUT .= " php_admin_flag file_upload $file_upload\n"; + $OUT .= " php_admin_value max_input_time $max_input_time\n"; + $OUT .= " php_admin_value max_execution_time $maxexecutionTime\n"; + $OUT .= " php_flag display_errors $display_errors\n"; + $OUT .= " $error_reporting\n"; + + # Set upload_tmp_dir and sys_temp_dir where php can upload files or write tmp files + $tmpdir= "/var/lib/php/$key/tmp"; + $OUT .= " php_admin_value upload_tmp_dir $tmpdir\n"; + $OUT .= " php_admin_value sys_temp_dir $tmpdir\n"; + + # Set the session folder where php can store its session instead of in global dir + $sessdir = "/var/lib/php/$key/session"; + $OUT .= " php_admin_value session.save_path $sessdir\n"; + + # Set the sandbox within which PHP is confined to play + my $basedir = $ibay->prop('PHPBaseDir') + || ("/home/e-smith/files/ibays/$key/"); + $basedir .= ":/var/lib/php/$key/"; + $basedir .= ":/usr/share/php/:/usr/share/pear/"; + if ( -d "/opt/remi/php$version/root/usr/share/pear/" && -d "/opt/remi/php$version/root/usr/share/php/") + { + $basedir .= ":/opt/remi/php$version/root/usr/share/pear/:/opt/remi/php$version/root/usr/share/php/"; + } + $OUT .= " php_admin_value open_basedir $basedir\n"; + } + } + $OUT .= "\n"; + } + } + } +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/00Setup b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/00Setup new file mode 100644 index 0000000..e5db207 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/00Setup @@ -0,0 +1,9 @@ +{ + use esmith::DomainsDB; + # Convert the passed hash for the domain object back into an object. + $domain = bless \%domain, 'esmith::DB::db::Record'; + + # Make scalars from some of the properties of the domain + $virtualHost = $domain->key; + $OUT = ""; +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/02ServerName b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/02ServerName new file mode 100644 index 0000000..38f4ddf --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/02ServerName @@ -0,0 +1 @@ + ServerName {$virtualHost} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias new file mode 100644 index 0000000..480dba0 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias @@ -0,0 +1,13 @@ + ServerAlias { + + use esmith::HostsDB; + use esmith::DomainsDB; + my $hdb = esmith::HostsDB->open_ro(); + my %domains = map { $_->key => 1 } esmith::DomainsDB->open_ro->domains; + my @hosts = grep { + my $h = $_; + ($h->prop('HostType') eq 'Self') && !$domains{$h->key} + } $hdb->get_hosts_by_domain($virtualHost); + $OUT = join " ", map { $_->key } @hosts; +} + diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/25SSLDirectives b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/25SSLDirectives new file mode 100644 index 0000000..c730af3 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/25SSLDirectives @@ -0,0 +1,28 @@ +{ + my $ssl = $domain->prop('RequireSSL') || 'disabled'; + my $auth = $domain->prop('Authentication') || 'none'; + + if ($httpsPort eq $port){ + $OUT .= " SSLEngine on\n"; + } + elsif (($ssl =~ m/^enabled|yes|on|1$/i) || ($auth =~ /^LemonLDAP/)){ + $OUT .=<<'EOF'; + RewriteEngine on + RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.* + RewriteRule ^/(.*|$) https://%{HTTP_HOST}/$1 [L,R] + +EOF + } + elsif ($ssl =~ m#/#){ + $OUT .= " RewriteEngine on\n"; + foreach my $loc (split(/[;,]/, $ssl)){ + $OUT .= " # Rewriting $loc to use SSL\n"; + $loc =~ s#^/##; + $OUT .= " RewriteRule ^/$loc(/.*|\$) https://%\{HTTP_HOST\}/$loc\$1 \[L,R\]\n"; + } + } + else{ + $OUT .= ''; + } +} + diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/26RewriteTraceAndTrack b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/26RewriteTraceAndTrack new file mode 100644 index 0000000..2d3653d --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/26RewriteTraceAndTrack @@ -0,0 +1,8 @@ +{ + $OUT =<<'HERE'; + RewriteEngine on + RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) + RewriteRule .* - [F] +HERE +} + diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/40ApacheIconAlias b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/40ApacheIconAlias new file mode 100644 index 0000000..980503c --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/40ApacheIconAlias @@ -0,0 +1,13 @@ +{ +my $alias = $domain->prop('IconAlias') || 'enabled'; +$OUT .= ''; + +unless ($alias =~ m/disabled|off|no|0/i){ + $OUT .=<<'EOF'; + + # alias for Apache icons + Alias /icons/ /var/www/icons/ + +EOF +} +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content new file mode 100644 index 0000000..0b2c06a --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content @@ -0,0 +1,161 @@ +{ + +use esmith::util; +my $base = esmith::util::ldapBase($DomainName); + +my $name = $domain->key; +my $target = $domain->prop('ProxyPassTarget') || ''; +my $proxy_acme = $domain->prop('ProxyPassACMEChallenges') || 'disabled'; +my $redirect = $domain->prop('Redirect') || ''; +my $rewrite = $domain->prop('Rewrite') || ''; +my $allow = $domain->prop('AllowHosts') || ''; +my $preserve = $domain->prop('ProxyPreserveHost') || 'no'; +my $keepalive = $domain->prop('ProxyNoKeepAlive') || 'no'; +my $timeout = $domain->prop('Timeout') || ''; +my $index = $domain->prop('DirectoryIndex') || ''; +my @alias = split /[,;]/, ($domain->prop('Alias') || ''); +my @env = split(/[;,]/, ($domain->prop('SetEnv') || '')); +my $auth = $domain->prop('Authentication') || 'none'; +my @groups = split(/[;,]/, ($domain->prop('AllowGroups') || '')); +my $ssl_port = $httpsPort; +my $proto = ($port eq $ssl_port ) ? 'https' : 'http'; +my $socketio = $domain->prop('ProxySocketIO') || 'disabled'; +my @proxyrules = split /[,;]/, ($domain->prop('ProxyPassRules') || ''); + +# Custom proxypass rules +foreach my $rule (@proxyrules){ + my ($from, $to) = split /=/, $rule; + $OUT .= " ProxyPass $from $to\n"; +} + +if (@proxyrules > 0 || $target =~ m|https?://[\d\w\.\-/]*|){ + $OUT .= " ProxyPreserveHost on\n" if ($preserve eq 'yes'); + $OUT .= " RequestHeader set X-Forwarded-Proto \"$proto\"\n"; +} + +# ProxyPass ? +if ($target =~ m|https?://[\d\w\.\-/]*|){ + $OUT .= " SetEnv proxy-nokeepalive 1\n" if ($keepalive eq 'yes'); + if ($proxy_acme eq 'only'){ + $OUT .= " ProxyPass /.well-known/acme-challenge/ $target" . ".well-known/acme-challenge/\n"; + $OUT .= " ProxyPassReverse / $target" . ".well-known/acme-challenge/\n"; + } + else{ + if ($proxy_acme eq 'disabled'){ + $OUT .= " ProxyPass /.well-known/acme-challenge/ !\n"; + } + if ($socketio eq 'enabled'){ + # Try to handle Socket.IO + my $wstarget = $target; + $wstarget =~ s/^http:/ws:/; + $wstarget =~ s/^https:/wss:/; + $OUT .=<<"_EOF" + + + RewriteCond %{QUERY_STRING} transport=polling [NC] + RewriteRule /socket.io/(.*) ${target}socket.io/\$1 [P,L] + + ProxyPass /socket.io/socket.io.js ${target}socket.io/socket.io.js + ProxyPassReverse /socket.io/socket.io.js ${target}socket.io/socket.io.js + + ProxyPass /socket.io/ ${wstarget}socket.io/ + ProxyPassReverse /socket.io/ ${wstarget}socket.io/ + + +_EOF + } + $OUT .= " ProxyPass / $target\n"; + $OUT .= " ProxyPassReverse / $target\n"; + } +} +# Rewrite ? +elsif ($rewrite =~ m|https?://[\d\w\.\-/]*|){ + $OUT .=<<"HERE"; + + RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.* + RewriteRule /(.*|\$) $rewrite/\$1 [L,R] + +HERE +} +# Redirect ? +elsif ($redirect =~ m|https?://[\d\w\.\-/]*|){ + $OUT .=<<"HERE"; + + RedirectMatch permanent ^/(.*|\$) $redirect/\$1 + +HERE +} +else{ + my $root = $domain->prop('DocumentRoot') || + '/home/e-smith/files/ibays/Primary/html'; + + $OUT .= " DocumentRoot $root\n"; +} + +if ($timeout =~ m/^\d+$/){ + $OUT .= " Timeout $timeout\n"; +} + +if ($index ne ''){ + $OUT .= " DirectoryIndex $index\n"; +} + +foreach (@alias){ + next unless $_ =~ m/^(\/\w+)=(\/.*)/; + my ($al, $targ) = ($1, $2); + next unless (-e $2); + $OUT .= " Alias $al $targ\n"; +} + +foreach (@env){ + next unless (m/^(.*)=(.*)$/); + $OUT .= " SetEnv $1 $2\n"; +} + +if ($allow ne ''){ + if ($allow eq 'local'){ + $allow = "$localAccess $externalSSLAccess"; + } + else{ + $allow =~ s/[,;]/ /g; + } + $OUT .=<<"EOF"; + + + Require ip $allow + + + + Require all granted + + +EOF +} + +if ($auth =~ m/^Basic$/i){ + my $require = "Require valid-user"; + if (scalar(@groups) > 0){ + $require = "Require ldap-group "; + $require .= "cn=$_,ou=Groups,$base " foreach(@groups); + } + + $OUT .=<<"EOF"; + SetEnvIf %{Request_URI} "^/\.well\-known/acme\-challenge" granted + + + Require env granted + AuthType basic + AuthName "$name" + AuthBasicProvider ldap + AuthLDAPURL ldap://localhost/ou=Users,$base?uid + AuthLDAPGroupAttribute memberUid + AuthLDAPGroupAttributeIsDN off + $require + + +EOF + +} + +} + diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/template-begin b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/template-begin new file mode 100644 index 0000000..b050035 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/template-begin @@ -0,0 +1,2 @@ + + diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/template-end b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/template-end new file mode 100644 index 0000000..50d3d92 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/template-end @@ -0,0 +1,2 @@ + + diff --git a/root/etc/e-smith/templates/etc/logrotate.d/php-fpm/php-fpm b/root/etc/e-smith/templates/etc/logrotate.d/php-fpm/php-fpm new file mode 100644 index 0000000..8d6665f --- /dev/null +++ b/root/etc/e-smith/templates/etc/logrotate.d/php-fpm/php-fpm @@ -0,0 +1,52 @@ +{ + +return "# all versions in php-fpm file" unless $PHP_VERSION eq ""; + +$OUT = "/var/log/php/*/php*fpm.log { + missingok + notifempty + sharedscripts + delaycompress + su root root + create 600 root root + postrotate + /sbin/e-smith/service php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php55-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php56-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php70-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php71-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php72-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php73-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php74-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php80-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php81-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php82-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php83-php-fpm reload >/dev/null 2>&1 || true + endscript +} + +/var/log/php/*/[!php]*.log { + missingok + notifempty + sharedscripts + delaycompress + su www www + create 600 www www + postrotate + /sbin/e-smith/service php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php55-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php56-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php70-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php71-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php72-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php73-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php74-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php80-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php81-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php82-php-fpm reload >/dev/null 2>&1 || true + /sbin/e-smith/service php83-php-fpm reload >/dev/null 2>&1 || true + endscript +} +"; + +} diff --git a/root/etc/e-smith/templates/etc/php-fpm.conf/010Include b/root/etc/e-smith/templates/etc/php-fpm.conf/010Include new file mode 100644 index 0000000..c5b3020 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.conf/010Include @@ -0,0 +1 @@ +include={ $FPM_POOL_DIR }/*.conf diff --git a/root/etc/e-smith/templates/etc/php-fpm.conf/020Global b/root/etc/e-smith/templates/etc/php-fpm.conf/020Global new file mode 100644 index 0000000..488f610 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.conf/020Global @@ -0,0 +1 @@ +[global] diff --git a/root/etc/e-smith/templates/etc/php-fpm.conf/030Pid b/root/etc/e-smith/templates/etc/php-fpm.conf/030Pid new file mode 100644 index 0000000..58e7be6 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.conf/030Pid @@ -0,0 +1 @@ +pid = /var/run/php-fpm/php{ $PHP_VERSION }-fpm.pid diff --git a/root/etc/e-smith/templates/etc/php-fpm.conf/040Log b/root/etc/e-smith/templates/etc/php-fpm.conf/040Log new file mode 100644 index 0000000..8dd3188 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.conf/040Log @@ -0,0 +1,4 @@ +error_log = syslog +syslog.facility = daemon +syslog.ident = php{ $PHP_VERSION }-fpm + diff --git a/root/etc/e-smith/templates/etc/php-fpm.conf/050Daemon b/root/etc/e-smith/templates/etc/php-fpm.conf/050Daemon new file mode 100644 index 0000000..21d3e4a --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.conf/050Daemon @@ -0,0 +1 @@ +daemonize = yes diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All b/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All new file mode 100644 index 0000000..e12afff --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All @@ -0,0 +1,87 @@ +{ + +use esmith::ConfigDB; + +my $pool_db = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php'); + +foreach my $pool ($pool_db->get_all_by_prop(type => 'pool')){ + my $version = $pool->prop('Version') || ''; + my $status = $pool->prop('status') || 'enabled'; + next unless ($version eq $PHP_VERSION && $status eq 'enabled'); + + my $key = $pool->key; + my $pool_name = 'php' . $version . '-' . $key; + my $memory_limit = $pool->prop('MemoryLimit') || '128M'; + my $max_execution_time = $pool->prop('MaxExecutionTime') || '30'; + my $max_input_time = $pool->prop('MaxInputTime') || '60'; + my $allow_url_fopen = $pool->prop('AllowUrlFopen') || 'disabled'; + my $post_max_size = $pool->prop('PostMaxSize') || '10M'; + my $upload_max_filesize = $pool->prop('UploadMaxFilesize') || '10M'; + my $file_upload = $pool->prop('FileUpload') || 'enabled'; + my $open_basedir = $pool->prop('BaseDir') || undef; + my $disabled_functions = $pool->prop('DisabledFunctions') || 'system,show_source,' . + 'symlink,exec,dl,shell_exec,' . + 'passthru,phpinfo,' . + 'escapeshellarg,escapeshellcmd'; + my $user = $pool->prop('User') || 'www'; + my $group = $pool->prop('Group') || $user; + my $max_children = $pool->prop('MaxChildren') || '15'; + my $display_errors = $pool->prop('DisplayErrors') || 'disabled'; + my $log_errors = $pool->prop('LogErrors') || 'disabled'; + my $autoprepend = $pool->prop('AutoPrependFile') || 'enabled'; + my $MailForceSender = $pool->prop('MailForceSender') || "php\@$DomainName"; + + # Format vars + my $autoprep = ( $autoprepend eq "disabled") ? "" : "/usr/share/php/auth_translation.php"; + my $autoprepath = ( $autoprepend eq "disabled") ? "" : ",/usr/share/php/"; + $file_upload = ($file_upload =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $allow_url_fopen = ($allow_url_fopen =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $display_errors = ($display_errors =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $log_errors = ($log_errors =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $disabled_functions = join(', ', split /[,;:]/, $disabled_functions); + $open_basedir = (defined $open_basedir) ? 'php_admin_value[open_basedir] = ' . join(':', split(/[,;:]/, $open_basedir . $autoprepath)) : + '; open_basedir is not set'; + + $OUT .=<<"_EOF"; + +[$pool_name] +user = $user +group = $group +listen.owner = root +listen.group = www +listen.mode = 0660 +listen = /var/run/php-fpm/$pool_name.sock +pm = dynamic +pm.max_children = $max_children +pm.start_servers = 3 +pm.min_spare_servers = 3 +pm.max_spare_servers = 4 +pm.max_requests = 1000 +slowlog = /var/log/php/$key/slow.log +php_admin_value[session.save_path] = /var/lib/php/$key/session +php_admin_value[opcache.file_cache] = /var/lib/php/$key/opcache +php_admin_value[upload_tmp_dir] = /var/lib/php/$key/tmp +php_admin_value[sys_temp_dir] = /var/lib/php/$key/tmp +php_admin_value[mail.force_extra_parameters] = '-f $MailForceSender' +php_admin_flag[display_errors] = $display_errors +php_admin_flag[log_errors] = $log_errors +php_admin_value[error_log] = /var/log/php/$key/error.log +php_admin_value[memory_limit] = $memory_limit +php_admin_value[max_execution_time] = $max_execution_time +php_admin_value[post_max_size] = $post_max_size +php_admin_value[upload_max_filesize] = $upload_max_filesize +php_admin_value[max_input_time] = $max_input_time +php_admin_value[disable_functions] = $disabled_functions +php_admin_flag[allow_url_fopen] = $allow_url_fopen +php_admin_flag[file_upload] = $file_upload +php_admin_flag[session.cookie_httponly] = on +php_admin_flag[allow_url_include] = off +php_admin_value[auto_prepend_file] = $autoprep +php_value[session.save_handler] = files +$open_basedir + +_EOF + +} + +} diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays b/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays new file mode 100644 index 0000000..949187d --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays @@ -0,0 +1,84 @@ +{ + +use esmith::AccountsDB; +use esmith::php; +my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database"; + +foreach my $ibay ($a->get_all_by_prop(type => 'ibay')){ + my $version = PhpFpmVersionToUse($ibay); + my $dynamic = $ibay->prop('CgiBin') || 'disabled'; + my $custom = $ibay->prop('CustomPool') || undef; + next unless ($dynamic eq 'enabled' && $version eq $PHP_VERSION && !$custom); + my $key = $ibay->key; + my $name = lc $key; + my $pool_name = 'php' . $version . '-' . $name; + my $memory_limit = $ibay->prop('MemoryLimit') || $defaultPHPproperties{'MemoryLimit'}; + my $max_execution_time = (defined $ibay->prop('MaxExecutionTime') ) ? $ibay->prop('MaxExecutionTime') : $defaultPHPproperties{'MaxExecutionTime'}; + my $max_input_time = (defined $ibay->prop('MaxInputTime'))? $ibay->prop('MaxInputTime') : $defaultPHPproperties{'MaxInputTime'}; + my $allow_url_fopen = $ibay->prop('AllowUrlFopen') || $defaultPHPproperties{'AllowUrlFopen'}; + my $post_max_size = $ibay->prop('PostMaxSize') || $defaultPHPproperties{'PostMaxSize'}; + my $upload_max_filesize = $ibay->prop('UploadMaxFilesize') || $defaultPHPproperties{'UploadMaxFilesize'}; + my $file_upload = $ibay->prop('FileUpload') || $defaultPHPproperties{'FileUpload'}; + my $display_errors = $ibay->prop('DisplayErrors') || 'off'; #we do not set this one at php level to avoid to have a whole server displaying errors and security issues + my $error_reporting = $ibay->prop('ErrorReporting') || 'E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT'; #same reason, we hardcoded the default + my $open_basedir = $ibay->prop('PHPBaseDir') || '/home/e-smith/files/ibays/' . $key . '/' . ':/var/lib/php/' . $key . '/'; + + my $disabled_functions = (defined $ibay->prop('DisabledFunctions')) ? $ibay->prop('DisabledFunctions') : $defaultPHPproperties{'DisabledFunctions'}; + my $autoprepend = $ibay->prop('AutoPrependFile') || $defaultPHPproperties{'AutoPrependFile'}; + my $MailForceSender = $ibay->prop('MailForceSender') || "$name\@$DomainName"; # TODO => check ibay associated domains. + my $limitExtensions = ( ($ibay->prop('AllowPHTML') || $defaultPHPproperties{'AllowPHTML'} ) eq 'enabled' ) ? "security.limit_extensions= .php .htm .html .phar .phtml .xml " : ""; + + # Format vars + my $autoprep = ( $autoprepend eq "disabled") ? "" : "/usr/share/php/auth_translation.php"; + my $autoprepath = ( -d "/opt/remi/php$version/root/usr/share/pear/" && -d "/opt/remi/php$version/root/usr/share/php/" ) ? ":/usr/share/php/:/usr/share/pear/:/opt/remi/php$version/root/usr/share/pear/:/opt/remi/php$version/root/usr/share/php/" : ":/usr/share/php/:/usr/share/pear/"; + $file_upload = ($file_upload =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $allow_url_fopen = ($allow_url_fopen =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $disabled_functions = join(', ', split /[,;:]/, $disabled_functions); + $display_errors = ($display_errors =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; + $error_reporting = ($error_reporting eq 'E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT') ? '; default error_reporting' : "php_value[error_reporting] = $error_reporting"; + $open_basedir = join(':', split(/[,;:]/, $open_basedir . $autoprepath)); + + $OUT .=<<"_EOF" if ($version eq $PHP_VERSION); + +[$pool_name] +user = www +group = www +listen.owner = root +listen.group = www +listen.mode = 0660 +listen = /var/run/php-fpm/$pool_name.sock +pm = dynamic +pm.max_children = 15 +pm.start_servers = 3 +pm.min_spare_servers = 3 +pm.max_spare_servers = 4 +pm.max_requests = 1000 +$limitExtensions +slowlog = /var/log/php/$key/slow.log +php_admin_value[session.save_path] = /var/lib/php/$key/session +php_admin_value[opcache.file_cache] = /var/lib/php/$key/opcache +php_admin_value[upload_tmp_dir] = /var/lib/php/$key/tmp +php_admin_value[sys_temp_dir] = /var/lib/php/$key/tmp +php_admin_value[mail.force_extra_parameters] = '-f $MailForceSender' +php_flag[display_errors] = $display_errors +$error_reporting +php_admin_flag[log_errors] = on +php_admin_value[error_log] = /var/log/php/$key/error.log +php_admin_value[memory_limit] = $memory_limit +php_admin_value[max_execution_time] = $max_execution_time +php_admin_value[post_max_size] = $post_max_size +php_admin_value[upload_max_filesize] = $upload_max_filesize +php_admin_value[max_input_time] = $max_input_time +php_admin_value[disable_functions] = $disabled_functions +php_admin_flag[allow_url_fopen] = $allow_url_fopen +php_admin_flag[file_upload] = $file_upload +php_admin_flag[session.cookie_httponly] = on +php_admin_flag[allow_url_include] = off +php_value[session.save_handler] = files +php_admin_value[auto_prepend_file] = $autoprep +php_admin_value[open_basedir] = $open_basedir + +_EOF +} + +} diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default00Header b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default00Header new file mode 100644 index 0000000..c1ded8b --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default00Header @@ -0,0 +1,22 @@ +{ +use esmith::ConfigDB; +my $c = esmith::ConfigDB->open_ro || die "Couldn't opeen the configuration database\n"; +my $srv = ( $PHP_VERSION ne '') ? 'php' . $PHP_VERSION . '-php-fpm' : 'php-fpm'; +my $php = $c->get( $srv ); +if ($php){ + $MemoryLimit = $php->prop('MemoryLimit') || '128M'; + $MaxExecutionTime = $php->prop('MaxExecutionTime') || '30'; + $MaxInputTime = $php->prop('MaxInputTime') || '60'; + $AllowUrlFopen = $php->prop('AllowUrlFopen') || 'off'; + $MaxChildren = $php->prop('MaxChildren') || '15'; + $PostMaxSize = $php->prop('PostMaxSize') || '10M'; + $UploadMaxFilesize = $php->prop('UploadMaxFilesize') || '10M'; + $OpenBasedir = $php->prop('OpenBasedir') || undef; + $DisableFunctions = $php->prop('DisableFunctions') || 'system,show_source,' . + 'symlink,exec,dl,shell_exec,' . + 'passthru,phpinfo,' . + 'escapeshellarg,escapeshellcmd'; +} +return ""; +} +[php{ $PHP_VERSION }] diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default10User b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default10User new file mode 100644 index 0000000..80259cf --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default10User @@ -0,0 +1,2 @@ +user = www +group = www diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default20Listen b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default20Listen new file mode 100644 index 0000000..77363da --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default20Listen @@ -0,0 +1,4 @@ +listen.owner = root +listen.group = www +listen.mode = 0660 +listen = /var/run/php-fpm/php{ $PHP_VERSION }.sock diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default30Childrens b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default30Childrens new file mode 100644 index 0000000..5c34300 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default30Childrens @@ -0,0 +1,7 @@ +pm = dynamic +pm.max_children = { $MaxChildren } +pm.start_servers = 3 +pm.min_spare_servers = 3 +pm.max_spare_servers = 4 +pm.max_requests = 5000 +request_terminate_timeout = { $MaxExecutionTime } diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default40Paths b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default40Paths new file mode 100644 index 0000000..4ac51fe --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default40Paths @@ -0,0 +1,11 @@ +{ +$OUT .=<<_EOF; +php_admin_value[session.save_path] = /var/lib/php/php$PHP_VERSION/session +php_admin_value[soap.wsdl_cache_dir] = /var/lib/php/php$PHP_VERSION/wsdlcache +php_admin_value[opcache.file_cache] = /var/lib/php/php$PHP_VERSION/opcache +php_admin_value[upload_tmp_dir] = /var/lib/php/php$PHP_VERSION/tmp +php_admin_value[sys_temp_dir] = /var/lib/php/php$PHP_VERSION/tmp +_EOF +} +php_admin_value[error_log] = /var/log/php/php{ $PHP_VERSION }/error.log +slowlog = /var/log/php/php{ $PHP_VERSION }/slow.log diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default50Settings b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default50Settings new file mode 100644 index 0000000..087c1ba --- /dev/null +++ b/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default50Settings @@ -0,0 +1,22 @@ +php_admin_value[mail.force_extra_parameters] = '-f { "php\@$DomainName" }' +php_admin_flag[display_errors] = off +php_admin_flag[log_errors] = on +php_admin_value[memory_limit] = { $MemoryLimit } +php_admin_value[max_execution_time] = { $MaxExecutionTime } +php_admin_value[post_max_size] = { $PostMaxSize } +php_admin_value[upload_max_filesize] = { $UploadMaxFilesize } +php_admin_value[max_input_time] = { $MaxInputTime } +{ +if ($OpenBasedir){ + $OUT .= "php_admin_value[open_basedir] = " . join( ':', (split(/[;,:]/, "$OpenBasedir,/usr/share/php/")) ) . "\n"; +} +if ($DisableFunctions){ + $OUT .= "php_admin_value[disable_functions] = " . join( ', ', (split(/[;,:]/, $DisableFunctions)) ) . "\n"; +} +} +php_admin_flag[allow_url_fopen] = { $AllowUrlFopen } +php_admin_flag[file_upload] = { $FileUpload } +php_admin_flag[session.cookie_httponly] = on +php_admin_flag[allow_url_include] = off +php_admin_value[auto_prepend_file] = /usr/share/php/auth_translation.php +php_admin_value[session.save_handler] = files diff --git a/root/etc/e-smith/templates/etc/php.ini/00PHP b/root/etc/e-smith/templates/etc/php.ini/00PHP new file mode 100644 index 0000000..33c34c8 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/00PHP @@ -0,0 +1,7 @@ +[PHP]{ +use esmith::ConfigDB; +my $c = esmith::ConfigDB->open_ro || die "Couldn't open the configuration database\n"; +my $srv = ( $PHP_VERSION ne '') ? 'php' . $PHP_VERSION : 'php'; +our $phpcur = $c->get( $srv ); +$OUT .= ''; +} diff --git a/root/etc/e-smith/templates/etc/php.ini/10LanguageOptions b/root/etc/e-smith/templates/etc/php.ini/10LanguageOptions new file mode 100644 index 0000000..7601816 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/10LanguageOptions @@ -0,0 +1,41 @@ +{#;;;;;;;;;;;;;;;;;; +# Language Options ; +#;;;;;;;;;;;;;;;;;;;} +engine = On +short_open_tag = { + my $short = $phpcur->prop(ShortOpenTag) || $php{ShortOpenTag} || "On"; + $OUT .= "$short"; +} +asp_tags = Off +precision = 14 +output_buffering = 4096 +output_handler = +zlib.output_compression = Off +implicit_flush = Off +unserialize_callback_func = +serialize_precision = 17 +disable_functions = +disable_classes = +safe_mode = Off +safe_mode_exec_dir = +safe_mode_allowed_env_vars = PHP_ +safe_mode_protected_env_vars = LD_LIBRARY_PATH +disable_functions = +highlight.string = #DD0000 +highlight.comment = #FF8000 +highlight.keyword = #007700 +highlight.bg = #FFFFFF +highlight.default = #0000BB +highlight.html = #000000 +zend.enable_gc = On +{ +return "" if $PHP_VERSION eq ""; +if ( $PHP_VERSION >= 70) + { +$OUT .="zend.assertions = -1\n"; + } +if ( $PHP_VERSION >= 74) + { +$OUT .="zend.exception_ignore_args = On\n"; + } +} diff --git a/root/etc/e-smith/templates/etc/php.ini/15ExposePHP b/root/etc/e-smith/templates/etc/php.ini/15ExposePHP new file mode 100644 index 0000000..fedb62e --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/15ExposePHP @@ -0,0 +1,5 @@ +; Default expose_php to Off for security reasons +expose_php = { + my $ep = $phpcur->prop(ExposePHP) || $php{ExposePHP} || "Off"; + $OUT .= "$ep"; +} diff --git a/root/etc/e-smith/templates/etc/php.ini/20ResourceLimits b/root/etc/e-smith/templates/etc/php.ini/20ResourceLimits new file mode 100644 index 0000000..729c71d --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/20ResourceLimits @@ -0,0 +1,12 @@ +max_execution_time = { + my $et = $phpcur->prop(MaxExecutionTime) || $php{MaxExecutionTime} || "30"; + $OUT .= "$et"; +} +max_input_time = { + my $it = $phpcur->prop(MaxInputTime) || $php{MaxInputTime} || "60"; + $OUT .= "$it"; +} +memory_limit = { + my $ml = $phpcur->prop(MemoryLimit) || $php{MemoryLimit} || "128M"; + $OUT .= "$ml"; +} diff --git a/root/etc/e-smith/templates/etc/php.ini/30ErrorHandling b/root/etc/e-smith/templates/etc/php.ini/30ErrorHandling new file mode 100644 index 0000000..d0d4ceb --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/30ErrorHandling @@ -0,0 +1,11 @@ +error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT +display_errors = Off +display_startup_errors = Off +log_errors = On +log_errors_max_len = 1024 +ignore_repeated_errors = Off +ignore_repeated_source = Off +report_memleaks = On +track_errors = Off +html_errors = On +error_log = syslog diff --git a/root/etc/e-smith/templates/etc/php.ini/40DataHandling b/root/etc/e-smith/templates/etc/php.ini/40DataHandling new file mode 100644 index 0000000..e120bb1 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/40DataHandling @@ -0,0 +1,12 @@ +variables_order = "EGPCS" +request_order = "GP" +register_argc_argv = On +auto_globals_jit = On +post_max_size = { + my $ms = $phpcur->prop(PostMaxSize) || $php{PostMaxSize} || "20M"; + $OUT .= "$ms"; +} +auto_prepend_file = +auto_append_file = +default_mimetype = "text/html" +default_charset = "UTF-8" diff --git a/root/etc/e-smith/templates/etc/php.ini/50PathsDirectories b/root/etc/e-smith/templates/etc/php.ini/50PathsDirectories new file mode 100644 index 0000000..1ac764b --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/50PathsDirectories @@ -0,0 +1,8 @@ +include_path = {($phpcur->prop(IncludePath)||$php{IncludePath}||$INCLUDE_PATH)} +doc_root = +user_dir = +extension_dir = { return "$EXTENSION_DIR" if ("$EXTENSION_DIR" ne "" && -d "$EXTENSION_DIR"); + return "/usr/lib64/php/modules" if -d "/usr/lib64/php/modules"; + return "/usr/lib/php/modules" if -d "/usr/lib/php/modules"; + return "/usr/lib/php"; } +enable_dl = On diff --git a/root/etc/e-smith/templates/etc/php.ini/60FileUploads b/root/etc/e-smith/templates/etc/php.ini/60FileUploads new file mode 100644 index 0000000..2b5de22 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/60FileUploads @@ -0,0 +1,10 @@ +file_uploads = On +upload_max_filesize = { + my $mf = $phpcur->prop(UploadMaxFilesize) || $php{UploadMaxFilesize} || "10M"; + $OUT .= "$mf"; +} +upload_tmp_dir = {"/var/lib/php/php$PHP_VERSION/tmp"} +max_file_uploads = { + my $mfu = $phpcur->prop(MaxFileUpload) || $php{MaxFileUpload} || "20"; + $OUT .= "$mfu"; +} diff --git a/root/etc/e-smith/templates/etc/php.ini/65FopenWrappers b/root/etc/e-smith/templates/etc/php.ini/65FopenWrappers new file mode 100644 index 0000000..8c076b4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/65FopenWrappers @@ -0,0 +1,3 @@ +allow_url_fopen = {($phpcur->prop(AllowUrlFopen) || $php{AllowUrlFopen} || 'Off')} +allow_url_include = Off +default_socket_timeout = 60 diff --git a/root/etc/e-smith/templates/etc/php.ini/70TimeZone b/root/etc/e-smith/templates/etc/php.ini/70TimeZone new file mode 100644 index 0000000..1216081 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/70TimeZone @@ -0,0 +1,2 @@ +date.timezone = "{$TimeZone}" + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings01Cli b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings01Cli new file mode 100644 index 0000000..96f1fcf --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings01Cli @@ -0,0 +1,3 @@ +[ Server] +cli_server.color = On + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings01Syslog b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings01Syslog new file mode 100644 index 0000000..9dae4cb --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings01Syslog @@ -0,0 +1,3 @@ +[Syslog] +define_syslog_variables = Off + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings02mailfunction b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings02mailfunction new file mode 100644 index 0000000..f7ae3b1 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings02mailfunction @@ -0,0 +1,18 @@ +[mail function] +SMTP = localhost +smtp_port = {($qpsmtpd{TCPPort} || '25')} +; windows setting, but in case : +sendmail_from = '{$phpcur->prop(MailForceSender)|| $php{'MailForceSender'} || "root\@$DomainName" }' +sendmail_path = {($phpcur->prop(SendmailPath) || $php{"SendmailPath"} || '/usr/sbin/sendmail -t -i')} +mail.force_extra_parameters = '-f {$phpcur->prop(MailForceSender)|| $php{'MailForceSender'} || "root\@$DomainName" }' +mail.log = { + my $mailog = $phpcur->prop(MailLog) || $php{"MailLog"} || "disabled"; + my $mlog = ($mailog eq "enabled")? "/var/log/php/php$PHP_VERSION/mail.log" : ""; + $OUT .= "$mlog"; +} +mail.add_x_header = { + my $axh = $php{MailAddXHeader} || "disabled"; + my $ax = ($axh eq "enabled") ? "Yes" : "No"; + $OUT .= "$ax"; +} + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings04PCRE b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings04PCRE new file mode 100644 index 0000000..6d02788 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings04PCRE @@ -0,0 +1,8 @@ +[Pcre] +{ +return "" if $PHP_VERSION eq ""; +if ( $PHP_VERSION >= 70) + { +$OUT .="pcre.jit = Off\n"; + } +} diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings05Pdo b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings05Pdo new file mode 100644 index 0000000..03b0e84 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings05Pdo @@ -0,0 +1,4 @@ +[Pdo_mysql] +pdo_mysql.cache_size = 2000 +pdo_mysql.default_socket = + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings06SQL b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings06SQL new file mode 100644 index 0000000..c7eefb3 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings06SQL @@ -0,0 +1,3 @@ +[SQL] +sql.safe_mode = Off + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings07Interbase b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings07Interbase new file mode 100644 index 0000000..157200a --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings07Interbase @@ -0,0 +1,8 @@ +[Interbase] +ibase.allow_persistent = On +ibase.max_persistent = -1 +ibase.max_links = -1 +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" +ibase.dateformat = "%Y-%m-%d" +ibase.timeformat = "%H:%M:%S" + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings07ODBC b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings07ODBC new file mode 100644 index 0000000..2bcecd1 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings07ODBC @@ -0,0 +1,8 @@ +[ODBC] +odbc.allow_persistent = On +odbc.check_persistent = On +odbc.max_persistent = -1 +odbc.max_links = -1 +odbc.defaultlrl = 4096 +odbc.defaultbinmode = 1 + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQL b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQL new file mode 100644 index 0000000..29b5db2 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQL @@ -0,0 +1,14 @@ +[MySQL] +mysql.allow_local_infile = On +mysql.allow_persistent = On +mysql.cache_size = 2000 +mysql.max_persistent = -1 +mysql.max_links = -1 +mysql.default_port = +mysql.default_socket = +mysql.default_host = +mysql.default_user = +mysql.default_password = +mysql.connect_timeout = 60 +mysql.trace_mode = Off + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQLi b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQLi new file mode 100644 index 0000000..77a1246 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQLi @@ -0,0 +1,11 @@ +[MySQLi] +mysqli.allow_persistent = On +mysqli.cache_size = 2000 +mysqli.max_persistent = -1 +mysqli.max_links = -1 +mysqli.default_port = +mysqli.default_socket = +mysqli.default_host = +mysqli.default_user = +mysqli.default_pw = +mysqli.reconnect = Off diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQLnd b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQLnd new file mode 100644 index 0000000..a40f73b --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings08MySQLnd @@ -0,0 +1,4 @@ +[mysqlnd] +mysqlnd.collect_statistics = On +mysqlnd.collect_memory_statistics = Off + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings09mSQL b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings09mSQL new file mode 100644 index 0000000..1cc935c --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings09mSQL @@ -0,0 +1,5 @@ +[mSQL] +msql.allow_persistent = On +msql.max_persistent = -1 +msql.max_links = -1 + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings10PostgresSQL b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings10PostgresSQL new file mode 100644 index 0000000..45fac78 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings10PostgresSQL @@ -0,0 +1,8 @@ +[PostgresSQL] +pgsql.allow_persistent = On +pgsql.auto_reset_persistent = Off +pgsql.max_persistent = -1 +pgsql.max_links = -1 +pgsql.ignore_notice = Off +pgsql.log_notice = Off + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings11Sybase b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings11Sybase new file mode 100644 index 0000000..edb18dd --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings11Sybase @@ -0,0 +1,8 @@ +[Sybase] +sybase.allow_persistent = On +sybase.max_persistent = -1 +sybase.max_links = -1 +sybase.min_error_severity = 10 +sybase.min_message_severity = 10 +sybase.compatability_mode = Off + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings12Sybase-CT b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings12Sybase-CT new file mode 100644 index 0000000..1c9a677 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings12Sybase-CT @@ -0,0 +1,7 @@ +[Sybase-CT] +sybct.allow_persistent = On +sybct.max_persistent = -1 +sybct.max_links = -1 +sybct.min_server_severity = 10 +sybct.min_client_severity = 10 + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings13bcmath b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings13bcmath new file mode 100644 index 0000000..5b800f4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings13bcmath @@ -0,0 +1,3 @@ +[bcmath] +bcmath.scale = 0 + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings14browscap b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings14browscap new file mode 100644 index 0000000..32e11f6 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings14browscap @@ -0,0 +1,2 @@ +[browscap] + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings16Session b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings16Session new file mode 100644 index 0000000..70b1783 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings16Session @@ -0,0 +1,49 @@ +[Session] +session.save_handler = files +session.save_path = {"/var/lib/php/php$PHP_VERSION/session"} +session.use_cookies = On +session.use_only_cookies = On +session.name = PHPSESSID +session.auto_start = Off +session.cookie_lifetime = 0 +session.cookie_path = / +session.cookie_domain = +session.cookie_httponly = +session.serialize_handler = php +session.gc_probability = 1 +session.gc_divisor = 1000 +session.gc_maxlifetime = 1440 +session.bug_compat_42 = Off +session.bug_compat_warn = Off +session.referer_check = +session.entropy_length = 0 +session.entropy_file = +session.cache_limiter = nocache +session.cache_expire = 180 +session.use_trans_sid = On +url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" +{ +return "" if $PHP_VERSION eq ""; +if ( $PHP_VERSION >= 55) + { + $OUT .= "session.use_strict_mode = Off\n"; + $OUT .= "sys_temp_dir = /var/lib/php/php$PHP_VERSION/tmp\n"; + } +if ( $PHP_VERSION < 71) + { + $OUT .= "session.hash_bits_per_character = 5 +session.hash_function = 0 +session.entropy_file = +session.entropy_length = 0\n"; + } +if ( $PHP_VERSION >= 71) + { + $OUT .= "session.sid_bits_per_character = 4 +session.sid_length = 32 +session.trans_sid_tags = \"a=href,area=href,frame=src,form=\"\n"; + } +if ( $PHP_VERSION >= 73) + { + $OUT .= "session.cookie_samesite = \"Strict\"\n"; + } +} diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings17MSSQL b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings17MSSQL new file mode 100644 index 0000000..dc191b7 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings17MSSQL @@ -0,0 +1,9 @@ +[MSSQL] +mssql.allow_persistent = On +mssql.max_persistent = -1 +mssql.max_links = -1 +mssql.min_error_severity = 10 +mssql.min_message_severity = 10 +mssql.compatability_mode = Off +mssql.secure_connection = Off + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings18Assertion b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings18Assertion new file mode 100644 index 0000000..8c8a6ea --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings18Assertion @@ -0,0 +1,2 @@ +[Assertion] + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings19IngresII b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings19IngresII new file mode 100644 index 0000000..e6be239 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings19IngresII @@ -0,0 +1,8 @@ +[Ingres II] +ingres.allow_persistent = On +ingres.max_persistent = -1 +ingres.max_links = -1 +ingres.default_database = +ingres.default_user = +ingres.default_password = + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings21Sockets b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings21Sockets new file mode 100644 index 0000000..4156bb3 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings21Sockets @@ -0,0 +1,3 @@ +[Sockets] +sockets.use_system_read = On + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings22Tidy b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings22Tidy new file mode 100644 index 0000000..ab876d8 --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings22Tidy @@ -0,0 +1,3 @@ +[Tidy] +tidy.clean_output = Off + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings23Soap b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings23Soap new file mode 100644 index 0000000..1ffbc4e --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings23Soap @@ -0,0 +1,6 @@ +[soap] +soap.wsdl_cache_enabled = On +soap.wsdl_cache_dir = {"/var/lib/php/php$PHP_VERSION/wsdlcache"} +soap.wsdl_cache_ttl = 86400 +soap.wsdl_cache_limit = 5 + diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings24Ldap b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings24Ldap new file mode 100644 index 0000000..3316f0b --- /dev/null +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings24Ldap @@ -0,0 +1,3 @@ +[ldap] +ldap.max_links = -1 + diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32php b/root/etc/e-smith/templates/etc/rsyslog.conf/32php new file mode 100644 index 0000000..8daaccc --- /dev/null +++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32php @@ -0,0 +1,28 @@ +#php logging + +:programname, isequal, "php" /var/log/php/php/error.log +& stop +:programname, startswith, "php-fpm" /var/log/php/php/php-fpm.log +& stop +:programname, startswith, "php55-fpm" /var/log/php/php55/php55-fpm.log +& stop +:programname, startswith, "php56-fpm" /var/log/php/php56/php56-fpm.log +& stop +:programname, startswith, "php70-fpm" /var/log/php/php70/php70-fpm.log +& stop +:programname, startswith, "php71-fpm" /var/log/php/php71/php71-fpm.log +& stop +:programname, startswith, "php72-fpm" /var/log/php/php72/php72-fpm.log +& stop +:programname, startswith, "php73-fpm" /var/log/php/php73/php73-fpm.log +& stop +:programname, startswith, "php74-fpm" /var/log/php/php74/php74-fpm.log +& stop +:programname, startswith, "php80-fpm" /var/log/php/php80/php80-fpm.log +& stop +:programname, startswith, "php81-fpm" /var/log/php/php81/php81-fpm.log +& stop +:programname, startswith, "php82-fpm" /var/log/php/php82/php82-fpm.log +& stop +:programname, startswith, "php83-fpm" /var/log/php/php83/php83-fpm.log +& stop \ No newline at end of file diff --git a/root/etc/e-smith/templates/etc/sysconfig/php-fpm/10PidFile b/root/etc/e-smith/templates/etc/sysconfig/php-fpm/10PidFile new file mode 100644 index 0000000..b47df87 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sysconfig/php-fpm/10PidFile @@ -0,0 +1 @@ +PIDFILE=/var/run/php-fpm/php{ $PHP_VERSION }-fpm.pid diff --git a/root/usr/share/perl5/vendor_perl/esmith/php.pm b/root/usr/share/perl5/vendor_perl/esmith/php.pm new file mode 100644 index 0000000..1695313 --- /dev/null +++ b/root/usr/share/perl5/vendor_perl/esmith/php.pm @@ -0,0 +1,272 @@ +package esmith::php; + +use strict; +use warnings; +use esmith::ConfigDB; + +our $PHPDEFAULT = 74; +our $BASEPHP = 54; + +our @ISA = qw(Exporter); +our @EXPORT = qw( listPHPVersionFPM listPHPVersionShort listPHPVersionHash listPHPVersionHashShort PHPdefault PHPbase VersionToUse PhpFpmVersionToUse $defaultdisabledfunc %defaultPHPproperties); + +our $defaultdisabledfunc='system,show_source,' . + 'symlink,exec,dl,shell_exec,' . + 'passthru,phpinfo,' . + 'escapeshellarg,escapeshellcmd'; +my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db"; +our %defaultPHPproperties = ( + MemoryLimit => '128M', + MaxExecutionTime => '30', + MaxInputTime => '60', + AllowUrlFopen => 'disabled', + PostMaxSize => '20M', + UploadMaxFilesize => '10M', + FileUpload => 'enabled', + PHPBaseDir => '/home/e-smith/files/ibays/$key:/var/lib/php/$key', + DisabledFunctions => $defaultdisabledfunc, + MailForceSender => "admin@".$configdb->get_value('DomainName'), + AllowPHTML => 'disabled', + AutoPrependFile => 'enabled', +); + +=head1 NAME + +esmith::php - A few tools to help with php-fpm installed versions + +=head1 SYNOPSIS + + use esmith::php; + + my @phps=listPHPVersionFPM('enabled'); + +=head1 DESCRIPTION + +This is intended to help playing with installed php versions. + +=head1 Methods + + +=head2 listPHPVersionFPM +param = (enabled, disabled, all) , if empty default to all +this will return you an array of php-fpm versions available php version +print "'$_'\n" for listPHPVersionFPM('all'); +'php-fpm' +'php55-php-fpm' +'php56-php-fpm' +'php70-php-fpm' +'php71-php-fpm' +'php72-php-fpm' +'php73-php-fpm' +'php74-php-fpm' +'php80-php-fpm' +'php81-php-fpm' +'php82-php-fpm' +'php83-php-fpm' + +this will return only available and enabled +print "'$_'\n" for listPHPVersionFPM('enabled'); +=cut +sub listPHPVersionFPM { + my $status = shift || 'all'; + my $conf = esmith::ConfigDB->open_ro or die "Could not open accounts db"; + my @list = $conf->get_all_by_prop( type => 'service' ); + my @keys = map {$_->key; } @list; + my @FPM; + foreach my $service ( grep(/^(php[0-9]{2}-)?php-fpm$/,@keys) ) { + my $s = $conf->get($service); + next unless ($s) ; + next unless (-f "/usr/lib/systemd/system/$service.service") ; + next unless ( $status eq "all" || ($s->prop('status') || "disabled") eq $status ); + push @FPM, $service; + } + return @FPM +} + +=head2 listPHPVersionShort +param1 = (enabled, disabled, all) , if empty default to all +param2 = will use "" as output for base php + +this will return you an array of numerical available php version +print "'$_'\n" for listPHPVersionShort('all'); +'54' +'55' +'56' +'70' +'71' +'72' +'73' +'74' +'80' +'81' +'82' +'83' + +this will returnonly available and enabled +print "'$_'\n" for listPHPVersionShort('enabled'); +=cut +sub listPHPVersionShort { + my $status = shift || 'all'; + my $emptyforbase = shift; + my @FPM = listPHPVersionFPM($status); + s/^php([0-9]{2})-php-fpm$/$1/ for @FPM ; + my $base= (defined $emptyforbase) ? "" : $BASEPHP; + s/^php-fpm$/$base/ for @FPM ; + return @FPM; +} + +=head2 listPHPVersionHash +param1 = (enabled, disabled, all) , if empty default to all +param2 = if defined will use "" as key for php-fpm +this will return you a hash order by version +my %list= listPHPVersionHash(); +print "$_ => $list{$_}\n" for (sort keys %list); +54 => php-fpm +55 => php55-php-fpm +56 => php56-php-fpm +70 => php70-php-fpm +71 => php71-php-fpm +72 => php72-php-fpm +73 => php73-php-fpm +74 => php74-php-fpm +80 => php80-php-fpm +81 => php81-php-fpm +82 => php82-php-fpm +83 => php83-php-fpm + +=cut +sub listPHPVersionHash { + my $status = shift || 'all'; + my $emptyforbase = shift; + my @FPM = listPHPVersionFPM($status); + my %myfpm; + my $base= (defined $emptyforbase) ? "" : $BASEPHP; + for my $php ( @FPM) { + $myfpm{$base}="$php" for ( $php=~/^php-fpm$/); + $myfpm{$_}="$php" for ( $php=~/^php([0-9]{2})-php-fpm$/); + } + return %myfpm; +} + +=head2 listPHPVersionHashShort +param1 = (enabled, disabled, all) , if empty default to all +param2 = if defined will use "" as key for php-fpm + +this will return you a hash order by version +my %list= listPHPVersionHashShort(); +print "$_ => $list{$_}\n" for (sort keys %list); +54 => php +55 => php55 +56 => php56 +70 => php70 +71 => php71 +72 => php72 +73 => php73 +74 => php74 +80 => php80 +81 => php81 +82 => php82 +83 => php83 + +=cut +sub listPHPVersionHashShort { + my $status = shift || 'all'; + my $emptyforbase = shift; + my %myfpm = listPHPVersionHash($status, $emptyforbase); + my %rfpm; + foreach my $key (keys %myfpm) { + my $php = $myfpm{$key}; + ($rfpm{$key}= $php)=~s/(^php[0-9]{0,2}).*/$1/; + } + return %rfpm; +} + +=head2 PHPdefault + return the php default version for the system, i.e. default chosen by rpm or the one overrided by the admin in php PHPVersion property. + one optional argument is to display 54 as empty string (i.e. base php-fpm) + +=cut +sub PHPdefault { + my $emptyforbase = shift; + my $conf = esmith::ConfigDB->open_ro or die "Could not open accounts db"; + my $php = $conf->get('php') ; + my $PHPVersion = ( defined $php->prop('PHPVersion') ) ? $php->prop('PHPVersion') : $PHPDEFAULT; + $PHPVersion = ($PHPVersion eq "") ? $BASEPHP : $PHPVersion; + $PHPVersion = ($PHPVersion =~ /([0-9]{2})/) ? $1 : $PHPDEFAULT; + return $PHPVersion unless defined $emptyforbase; + $PHPVersion = ( $PHPVersion eq $BASEPHP ) ? "" : $PHPVersion; + return $PHPVersion; +} + +=head2 PHPbase +return the php base, i.e. 54 for php-fpm provided by CentOS 7. + +=cut +sub PHPbase { + return $BASEPHP; +} + +=head2 VersionToUse +argument 1 : output from $account->get('ibayname') or similar (shares,custom) + it is expected to find in this entry a property PHPVersion +artgument 2 : optional, a locally forced PHP version, if you do not want to trust globally prefered one. + +output : a two digit php version : 74 for php 7.4 . 54 will be for php-fpm 5.4 as default php on CentOS 7 /SME 9 + + my $ibay=$account->get('ibayname'); + my $version = VersionToUse($ibay,'80'); + +logic: +# if not defined => $PHPDEFAULT +# if defined and empty strin => $BASEPHP +# if defined and not empty => its value + +# defined entry (e.g. ibay) PHPVersion property override + - defined forced PHPVersion provided (2nd argument, if provided) which override + - php PHPVersion property which override + - default $PHPDEFAULT + +=cut +sub VersionToUse { + my $entry = shift or return "need a db entry"; + my $conf = esmith::ConfigDB->open_ro or die "Could not open accounts db"; + + my $PHPVersion = PHPdefault(); + + my $forcedefault = shift ; + $forcedefault = ( defined $forcedefault ) ? $forcedefault : $PHPVersion; + $forcedefault = ($forcedefault eq "") ? $BASEPHP : $forcedefault; + $forcedefault = ($forcedefault =~ /([0-9]{2})/) ? $1 : $PHPVersion; + + my $entryPHPVersion = (defined $entry->prop('PHPVersion') ) ? $entry->prop('PHPVersion') : $forcedefault; + $entryPHPVersion = ($entryPHPVersion eq "") ? $BASEPHP : $entryPHPVersion; + $entryPHPVersion = ($entryPHPVersion =~ /([0-9]{2})/) ? $1 : $forcedefault; + + # we currently assume that it is installed and enabled, but could test it here + + my $version= $entryPHPVersion ; + #$version = " $PHPDEFAULT - $PHPVersion - $forcedefault - $entryPHPVersion"; + + return $version; +} + +=head2 PhpFpmVersionToUse +same as VersionToUse except it will return null string in place of $BASEPHP (i.e. "" in place of 54) + +argument 1 : output from $account->get('ibayname') or similar (shares,custom) + it is expected to find in this entry a property PHPVersion +artgument 2 : optional, a locally forced PHP version, if you do not want to trust globally prefered one. + +output : a two digit php version : 74 for php 7.4 or empty string, as '' will take place of 54 for php-fpm 5.4 as default php on CentOS 7 /SME 9 + +=cut +sub PhpFpmVersionToUse { + #my $entry = shift or return "need a db entry"; + #my $forcedefault = shift ; + my $version ; + $version = VersionToUse(@_) ;#$entry,$forcedefault);# if defined $forcedefault; + #$version = VersionToUse($entry) unless defined $forcedefault; + # here we convert $BASEPHP to empty string + $version = ( $version eq $BASEPHP ) ? "" : $version; + return $version; +} diff --git a/root/usr/share/php/auth_translation.php b/root/usr/share/php/auth_translation.php new file mode 100644 index 0000000..5fe744b --- /dev/null +++ b/root/usr/share/php/auth_translation.php @@ -0,0 +1,22 @@ + diff --git a/smeserver-php.spec b/smeserver-php.spec new file mode 100644 index 0000000..a6744d8 --- /dev/null +++ b/smeserver-php.spec @@ -0,0 +1,897 @@ +%define version 3.0.0 +%define release 49 +%define name smeserver-php + + +Summary: PHP FPM pools and more on SME Server +Name: %{name} +Version: %{version} +Release: %{release}%{?dist} +License: MIT +Group: Applications/System +Source: %{name}-%{version}.tar.xz + +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArch: x86_64 +BuildRequires: e-smith-devtools + +Requires: e-smith-base >= 5.6.0 +Provides: e-smith-php = %{version}-%{release} +Obsoletes: e-smith-php < %{version} +Provides: smeserver-webapps-common +Provides: php(language) = 7.0 +Provides: php(language) = 7.1 +Provides: php(language) = 7.2 +Provides: php(language) = 7.3 +Provides: php(language) = 7.4 +Provides: php(language) = 8.0 +Provides: php(language) = 8.1 +Provides: php(language) = 8.2 +Provides: php(language) = 8.3 +Requires: tmpwatch +Requires: logrotate + +# Stock PHP +Requires: php-cli +Requires: php-ldap +Requires: php-imap +Requires: php-gd +Requires: php-xml +Requires: php-xmlrpc +Requires: php-soap +Requires: php-opcache +Requires: php-fpm +Requires: php-mbstring +Requires: php-mysql +Requires: php-json +Requires: php-bcmath +Requires: php-intl +Requires: php-mcrypt +Requires: php-pear +Requires: php-process +Requires: php-snmp + + +# PHP 5.5 +Requires: php55-php-cli +Requires: php55-php-ldap +Requires: php55-php-imap +Requires: php55-php-gd +Requires: php55-php-xml +Requires: php55-php-xmlrpc +Requires: php55-php-soap +Requires: php55-php-opcache +Requires: php55-php-fpm +Requires: php55-php-mbstring +Requires: php55-php-mysql +Requires: php55-php-json +Requires: php55-php-bcmath +Requires: php55-php-intl +Requires: php55-php-mcrypt +Requires: php55-php-pear +Requires: php55-php-process +Requires: php55-php-snmp +Requires: php55-php, php55-php-enchant , php55-php-pdo php55-php-tidy , php55-php-mysqlnd php55-php-pecl-zip + +# PHP 5.6 +Requires: php56-php-cli +Requires: php56-php-ldap +Requires: php56-php-imap +Requires: php56-php-gd +Requires: php56-php-xml +Requires: php56-php-xmlrpc +Requires: php56-php-soap +Requires: php56-php-opcache +Requires: php56-php-fpm +Requires: php56-php-mbstring +Requires: php56-php-mysql +Requires: php56-php-json +Requires: php56-php-bcmath +Requires: php56-php-intl +Requires: php56-php-mcrypt +Requires: php56-php-pear +Requires: php56-php-process +Requires: php56-php-snmp +Requires: php56-php, php56-php-enchant , php56-php-pdo php56-php-tidy , php56-php-mysqlnd php56-php-pecl-zip + +# PHP 7.0 +Requires: php70-php-cli +Requires: php70-php-ldap +Requires: php70-php-imap +Requires: php70-php-gd +Requires: php70-php-xml +Requires: php70-php-xmlrpc +Requires: php70-php-soap +Requires: php70-php-opcache +Requires: php70-php-fpm +Requires: php70-php-mbstring +Requires: php70-php-mysql +Requires: php70-php-json +Requires: php70-php-bcmath +Requires: php70-php-intl +Requires: php70-php-mcrypt +Requires: php70-php-pear +Requires: php70-php-process +Requires: php70-php-snmp +Requires: php70-php, php70-php-enchant , php70-php-pdo php70-php-tidy , php70-php-mysqlnd php70-php-pecl-zip + +# PHP 7.1 +Requires: php71-php-cli +Requires: php71-php-ldap +Requires: php71-php-imap +Requires: php71-php-gd +Requires: php71-php-xml +Requires: php71-php-xmlrpc +Requires: php71-php-soap +Requires: php71-php-opcache +Requires: php71-php-fpm +Requires: php71-php-mbstring +Requires: php71-php-mysql +Requires: php71-php-json +Requires: php71-php-bcmath +Requires: php71-php-intl +Requires: php71-php-mcrypt +Requires: php71-php-pear +Requires: php71-php-process +Requires: php71-php-snmp +Requires: php71-php, php71-php-enchant , php71-php-pdo php71-php-tidy , php71-php-mysqlnd php71-php-pecl-zip + +# PHP 7.2 +Requires: php72-php-cli +Requires: php72-php-ldap +Requires: php72-php-imap +Requires: php72-php-gd +Requires: php72-php-xml +Requires: php72-php-xmlrpc +Requires: php72-php-soap +Requires: php72-php-opcache +Requires: php72-php-fpm +Requires: php72-php-mbstring +Requires: php72-php-mysql +Requires: php72-php-json +Requires: php72-php-bcmath +Requires: php72-php-intl +Requires: php72-php-mcrypt +Requires: php72-php-pear +Requires: php72-php-process +Requires: php72-php-snmp +Requires: php72-php, php72-php-enchant , php72-php-pdo php72-php-tidy , php72-php-mysqlnd php72-php-pecl-zip + +# PHP 7.3 +Requires: php73-php-cli +Requires: php73-php-ldap +Requires: php73-php-imap +Requires: php73-php-gd +Requires: php73-php-xml +Requires: php73-php-xmlrpc +Requires: php73-php-soap +Requires: php73-php-opcache +Requires: php73-php-fpm +Requires: php73-php-mbstring +Requires: php73-php-mysql +Requires: php73-php-json +Requires: php73-php-bcmath +Requires: php73-php-intl +Requires: php73-php-pear +Requires: php73-php-process +Requires: php73-php-snmp +Requires: php73-php, php73-php-enchant , php73-php-pdo php73-php-tidy , php73-php-mysqlnd php73-php-pecl-zip + +# PHP 7.4 +Requires: php74-php-cli +Requires: php74-php-ldap +Requires: php74-php-imap +Requires: php74-php-gd +Requires: php74-php-xml +Requires: php74-php-xmlrpc +Requires: php74-php-soap +Requires: php74-php-opcache +Requires: php74-php-fpm +Requires: php74-php-mbstring +Requires: php74-php-json +Requires: php74-php-bcmath +Requires: php74-php-intl +Requires: php74-php-pear +Requires: php74-php-process +Requires: php74-php-snmp +Requires: php74-php, php74-php-enchant , php74-php-pdo php74-php-tidy , php74-php-mysqlnd php74-php-pecl-zip + +# PHP 8.0 +Requires: php80-php-cli +Requires: php80-php-ldap +Requires: php80-php-imap +Requires: php80-php-gd +Requires: php80-php-xml +Requires: php80-php-xmlrpc +Requires: php80-php-soap +Requires: php80-php-opcache +Requires: php80-php-fpm +Requires: php80-php-mbstring +Requires: php80-php-json +Requires: php80-php-bcmath +Requires: php80-php-intl +Requires: php80-php-pear +Requires: php80-php-process +Requires: php80-php-snmp +Requires: php80-php, php80-php-enchant , php80-php-pdo php80-php-tidy , php80-php-mysqlnd php80-php-pecl-zip + +# PHP 8.1 +Requires: php81-php-cli +Requires: php81-php-ldap +Requires: php81-php-imap +Requires: php81-php-gd +Requires: php81-php-xml +Requires: php81-php-xmlrpc +Requires: php81-php-soap +Requires: php81-php-opcache +Requires: php81-php-fpm +Requires: php81-php-mbstring +Requires: php81-php-json +Requires: php81-php-bcmath +Requires: php81-php-intl +Requires: php81-php-pear +Requires: php81-php-process +Requires: php81-php-snmp +Requires: php81-php, php81-php-enchant , php81-php-pdo php81-php-tidy , php81-php-mysqlnd php81-php-pecl-zip + +# PHP 8.2 +Requires: php82-php-cli +Requires: php82-php-ldap +Requires: php82-php-imap +Requires: php82-php-gd +Requires: php82-php-xml +Requires: php82-php-xmlrpc +Requires: php82-php-soap +Requires: php82-php-opcache +Requires: php82-php-fpm +Requires: php82-php-mbstring +Requires: php82-php-json +Requires: php82-php-bcmath +Requires: php82-php-intl +Requires: php82-php-pear +Requires: php82-php-process +Requires: php82-php-snmp +Requires: php82-php, php82-php-enchant , php82-php-pdo php82-php-tidy , php82-php-mysqlnd php82-php-pecl-zip + +# PHP 8.3 +Requires: php83-php-cli +Requires: php83-php-ldap +Requires: php83-php-imap +Requires: php83-php-gd +Requires: php83-php-xml +Requires: php83-php-xmlrpc +Requires: php83-php-soap +Requires: php83-php-opcache +Requires: php83-php-fpm +Requires: php83-php-mbstring +Requires: php83-php-json +Requires: php83-php-bcmath +Requires: php83-php-intl +Requires: php83-php-pear +Requires: php83-php-process +Requires: php83-php-snmp +Requires: php83-php, php83-php-enchant , php83-php-pdo php83-php-tidy , php83-php-mysqlnd php83-php-pecl-zip + +%description +Manage PHP FPM pools, and switch between PHP versions easily + +%prep +%setup -q -n %{name}-%{version} + +%build +perl createlinks +%{__mkdir_p} root/var/www/php-cgi-bin/ +%{__mkdir_p} root/var/log/php/php/ +%{__mkdir_p} root/var/lib/php/php/{session,tmp,opcache,wsdlcache} +#create service configuration for SME Seerver +#%{__mkdir_p} root/%{_unitdir}/php-fpm.service.d/ +#echo '' > root/%{_unitdir}/php-fpm.service.d/php-fpm.conf +#enable by default +#%{__mkdir_p} root/%{_presetdir} +#echo 'enable php-fpm.service' >root/%{_presetdir}/80-koozali-php.preset + +#drop in systemd file +%{__mkdir_p} root/usr/lib/systemd/system/php-fpm.service.d +echo "[Install]" > root/usr/lib/systemd/system/php-fpm.service.d/51koozali.conf +echo "WantedBy=sme-server.target" >> root/usr/lib/systemd/system/php-fpm.service.d/51koozali.conf + +%{__mkdir_p} root/etc/e-smith/templates.metadata/etc/logrotate.d/ +for phpver in "55" "56" "70" "71" "72" "73" "74" "80" "81" "82" "83"; do +#needed folder +%{__mkdir_p} root/var/log/php/php$phpver/ +%{__mkdir_p} root/var/lib/php/php$phpver/{session,tmp,opcache,wsdlcache} + +#db configuration +%{__mkdir_p} root/etc/e-smith/db/configuration/defaults/php$phpver-php-fpm +%{__mkdir_p} root/etc/e-smith/db/configuration/defaults/php$phpver +echo 'enabled' > root/etc/e-smith/db/configuration/defaults/php$phpver-php-fpm/status +echo 'service'> root/etc/e-smith/db/configuration/defaults/php$phpver-php-fpm/type + +echo 'configuration'> root/etc/e-smith/db/configuration/defaults/php$phpver/type +echo 'Off'> root/etc/e-smith/db/configuration/defaults/php$phpver/AllowUrlFopen + +#logrotate templates +echo 'TEMPLATE_PATH="/etc/logrotate.d/php-fpm" +MORE_DATA={ PHP_VERSION => '$phpver'}' > root/etc/e-smith/templates.metadata/etc/logrotate.d/php$phpver-php-fpm + +#drop in systemd file +%{__mkdir_p} root/usr/lib/systemd/system/php$phpver-php-fpm.service.d +echo "[Install]" > root/usr/lib/systemd/system/php$phpver-php-fpm.service.d/51koozali.conf +echo "WantedBy=sme-server.target" >> root/usr/lib/systemd/system/php$phpver-php-fpm.service.d/51koozali.conf + +done + +#to add a new php version +#php5* +for phpver in "55" ; do +#cp php56 metadata +mkdir -p root/etc/e-smith/templates.metadata/opt/remi/php$phpver +cp -a root/etc/e-smith/templates.metadata/opt/remi/php56/* root/etc/e-smith/templates.metadata/opt/remi/php$phpver +#sed inplace +find root/etc/e-smith/templates.metadata/opt/remi/php$phpver -type f -print0 | xargs -0 sed -i 's/56/'$phpver'/g' +done + +# php7* +for phpver in "72" "73" "74" "80" "81" "82" "83"; do +#cp ph70 metada +mkdir -p root/etc/e-smith/templates.metadata/etc/opt/remi/php$phpver/ +cp -a root/etc/e-smith/templates.metadata/etc/opt/remi/php70/* root/etc/e-smith/templates.metadata/etc/opt/remi/php$phpver/ +#sed inplace +find root/etc/e-smith/templates.metadata/etc/opt/remi/php$phpver -type f -print0 | xargs -0 sed -i 's/70/'$phpver'/g' +done + +# then patch the following files +### TODO +### fix those files so we do not have to patch them, but generate them or sed them to change a known WORDTODOGENERIC +#smeserver-php-3.0.0/createlinks +#smeserver-php-3.0.0/root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/10Defaults +#smeserver-php-3.0.0/root/etc/e-smith/templates/etc/logrotate.d/php-fpm/php-fpm +#smeserver-php-3.0.0/root/etc/e-smith/templates/etc/rsyslog.conf/32php # this one could be cut in fragments per version +#smeserver-php-3.0.0/root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php.ini + +%install +/bin/rm -rf $RPM_BUILD_ROOT +(cd root; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) +/bin/rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + --dir /var/log/php/php 'attr(0770,root,www)' \ + --dir /var/lib/php/php/session 'attr(0770,root,www)' \ + --dir /var/lib/php/php/tmp 'attr(0770,root,www)' \ + --dir /var/lib/php/php/opcache 'attr(0770,root,www)' \ + --dir /var/lib/php/php/wsdlcache 'attr(0770,root,www)' \ +`for phpver in "54" "55" "56" "70" "71" "72" "73" "74" "80" "81" "82" "83"; do echo -n "--dir /var/log/php/php$phpver attr(0770,root,www) --dir /var/lib/php/php$phpver/session attr(0770,root,www) --dir /var/lib/php/php$phpver/tmp attr(0770,root,www) --dir /var/lib/php/php$phpver/opcache attr(0770,root,www) --dir /var/lib/php/php$phpver/wsdlcache attr(0770,root,www) ";done ` \ + > %{name}-%{version}-filelist + + + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) + +%pre + +%post +# %systemd_post %{pkgname}.service + +%preun + +%changelog +* Sat Mar 23 2024 cvs2git.sh aka Brian Read 3.0.0-49.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Mar 23 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Wed Mar 20 2024 Zsolt Vasarhelyi 3.0.0-48.sme +- PHP 8.3 logs to 8.2 logdir [SME:12514] + +* Mon Sep 04 2023 John Crisp 3.0.0-47.sme +- Add php83 support [SME:12405] + +* Sat Aug 26 2023 John Crisp 3.0.0-46.sme +- fix missing php 81 settings +- Add php82 support [SME:12403] + +* Sat Feb 04 2023 Jean-Philippe Pialasse 3.0.0-45.sme +- fix session.save_handler forced without any way to change it [SME: 12303] + +* Wed Dec 14 2022 Jean-Philippe Pialasse 3.0.0-44.sme +- fix tkt auth not propagated to php pool [SME: 12269] + +* Sun Apr 17 2022 Jean-Philippe Pialasse 3.0.0-43.sme +- update to httpd 2.4 Require usage [SME: 11943] + +* Mon Dec 20 2021 Jean-Philippe Pialasse 3.0.0-42.sme +- fix missing section in php-fpm dropin file [SME: 11814] + +* Sun Oct 24 2021 Jean-Philippe Pialasse 3.0.0-41.sme +- add php81 support [SME: 11717] + +* Fri Sep 24 2021 John Crisp 3.0.0-40.sme +- Fix incorrect commenting for error reporting + +* Fri Sep 17 2021 Jean-Philippe Pialasse 3.0.0-39.sme +- add ErrorReporting and DisplayErrors properties [SME: 8077] + only per ibays (php defaults still hardcoded) +- fix typo in AllowUrlFopen, was using AllowUrlfOpen for ibays in httpd [SME: 11666] + +* Wed Jun 30 2021 Jean-Philippe Pialasse 3.0.0-37.sme +- fix typo in 25SSLDirectives fragment for WebAppVirtualHost [SME: 11641] + +* Thu Jun 03 2021 Terry Fage 3.0.0-35.sme +- fix syntax error "> - >>" in spec file for systemd drop in [SME: 11612] + +* Wed Apr 21 2021 Jean-Philippe Pialasse 3.0.0-34.sme +- fix open_basedir for pool missing /var/lib/php/$ibay/ [SME: 11573] + +* Tue Mar 16 2021 Jean-Philippe Pialasse 3.0.0-33.sme +- clean rsyslog syntax for php [SME: 11422] + +* Tue Mar 16 2021 Jean-Philippe Pialasse 3.0.0-32.sme +- add /usr/share/pear and /usr/share/php to basedir [SME: 5759] +- fix last big differences between module setting and fpm [SME: 11452] + +* Mon Mar 08 2021 Jean-Philipe Pialasse 3.0.0-31.sme +- move from e-smith-ibays handling of temps dirs [SME: 11412] +- improve httpd fragment [SME: 11401] + +* Mon Mar 08 2021 Jean-Philipe Pialasse 3.0.0-30.sme +- uniformize php related properties between ibays and php [SME: 11411] + tidy fragments for php-fpm and ibays +- revert patch for timeouts [SME: 11427] + +* Mon Mar 08 2021 Jean-Philipe Pialasse 3.0.0-28.sme +- filter non existing php script [SME: 10907] +- allow php embded files per ibay using AllowPHTML [SME: 10890] +- add timeout property in case of need for long running script [SME: 11427] + e.g. upgrade of a wiki + +* Mon Mar 08 2021 Jean-Philipe Pialasse 3.0.0-27.sme +- String not honoured as php-fpm but as default [SME: 11401] + +* Sat Mar 06 2021 Jean-Philipe Pialasse 3.0.0-26.sme +- improve sendmail parameter, force sender [SME: 11410] + MailForceSender as property for php versions, ibays and pools +- add perl module to help handling fpm version available [SME: 11413] + +* Mon Feb 22 2021 Jean-Philipe Pialasse 3.0.0-25.sme +- add missing default db configuration for php80* [SME: 11378] + +* Sun Feb 21 2021 Jean-Philipe Pialasse 3.0.0-24.sme +- allow php-pool-dirs to run from generik event [SME: 11287] +- add php80 support [SME: 11295] + +* Wed Jan 27 2021 Jean-Philipe Pialasse 3.0.0-23.sme +- fix php55 logrotate [SME: 11325] +- cleanup remove services in sme-server.target.wants [SME: 10956] +- remove usr/lib preset file from rpm [SME: 10958] + +* Fri Dec 25 2020 Jean-Philipe Pialasse 3.0.0-22.sme +- add WantedBy=sme-server.target for all php-fpm service files [SME: 11294] + +* Mon Dec 21 2020 John Crisp 3.0.0.21.sme +- Fix createlinks typo missing event links [SME: 11287] +- Fix typo + +* Thu Dec 17 2020 John Crisp 3.0.0.20.sme +- Fix individual PHP version for ibay [SME: 11267] + +* Sun Dec 13 2020 Jean-Philipe Pialasse 3.0.0-18.sme +- fix logrotate error because parent directory has insecure permissions [SME: 11173] + +* Wed Nov 18 2020 Jean-Philipe Pialasse 3.0.0-17.sme +- fix warning: ~ action is deprecated with rsyslog [SME: 11015] +- fix logrotate error because parent directory has insecure permissions [SME: 11173] + +* Mon Nov 09 2020 Jean-Philipe Pialasse 3.0.0-16.sme +- fix typo for upload_tmp_dir [SME: 11092] + +* Sun Nov 08 2020 Jean-Philipe Pialasse 3.0.0-15.sme +- improve integration of webapps : virtualhost and event [SME: 11087] + +* Wed Sep 30 2020 Jean-Philipe Pialasse 3.0.0-14.sme +- enable php services for sme-server.target [SME: 11014] + +* Tue Jun 23 2020 Jean-Philipe Pialasse 3.0.0-13.sme +- move and fix link to start services units [SME: 10960] + +* Fri Mar 27 2020 Jean-Philipe Pialasse 3.0.0-12.sme +- fix typo in smeserver-php-3.0.0-bz10904-pass-auth-token-to-fpm.patch [SME: 10904] + +* Thu Mar 26 2020 Jean-Philipe Pialasse 3.0.0-11.sme +- help monitoring email sent by php [SME: 8787] + +* Thu Mar 26 2020 Jean-Philipe Pialasse 3.0.0-9.sme +- move auto_prepend_file from php.ini to php-fpm.d [SME: 10904] + add /usr/share/php in open_basedir if dfined to allow execution of auto_prepend_file +- fix templates-metadata path fot php 55 72 73 74 + +* Tue Mar 24 2020 Jean-Philipe Pialasse 3.0.0-8.sme +- transfer SERVER auth variables from httpd server to php-fpm pool [SME: 10904] + this allow easy auth for php app using httpd auth as if using php module + +* Tue Mar 24 2020 Jean-Philipe Pialasse 3.0.0-7.sme +- templating all php.ini for all available version [SME: 10891] + expanded using webapps-update, smeserver-php-update, console-save and bootstrap-console-save + Values are those from php configuration key, unless defined for the php$VERSION key. + only one template for all, using templates.metadata and conditions vhen needed. + reworked the content of the php.ini to have it uptodate + +* Wed Mar 11 2020 Jean-Philipe Pialasse 3.0.0-6.sme +- enable units for php-fpm services [SME: 10335] + +* Tue Mar 10 2020 Jean-Philipe Pialasse 3.0.0-5.sme +- set sys_temp_dir for php-fpm and ibays [SME: 10888] +- set restart for php-fpm services in the smeserver-php-update event [SME: 10335] + +* Mon Mar 09 2020 Jean-Philipe Pialasse 3.0.0-3.sme +- fix typos and logic in scripts [SME: 10335] +- only set php admin values if php module is enabled [SME: 10871] +- redirect php*-php-fpm services logs to /var/log/php/php*/php-fpm.log [SME: 10879] +- pool logs in /var/log/php/*/error.log [SME: 10877] + +* Sat Feb 01 2020 Jean-Philipe Pialasse 3.0.0-2.sme +- modification for ibays php-fpm support in httpd.conf [SME: 10871] + +* Tue Jan 28 2020 Jean-Philipe Pialasse 3.0.0-1.sme +- initial release of smeserver-php from smeserver-php-fpm [SME: 10335] + added support for ibays, remove references to shares (should move to smeserver-share-folders) +- merge and Obsoletes e-smith-php [SME: 10335] +- remove reference to php3 and php4 files [SME: 10865] + +* Thu Jul 27 2017 Daniel Berteaud - 0.1.1-1.sme +- Fix closing parenthesis on prop method in httpd template + +* Wed Jul 26 2017 Daniel Berteaud - 0.1.0-1.sme +- Initial release + + Sun Jun 26 2016 Jean-Philipe Pialasse 2.6.0-4.sme +- clean daily session and tmp folders [SME: 9626] +- updated path for ibays' session and tmp folders to /var/cache + +* Thu Jun 23 2016 Jean-Philipe Pialasse 2.6.0-3.sme +- add tmp folder to ibays [SME: 7011] +- add session folder to ibays [SME: 9620] +- change global session folder from /tmp to /var/lib/php/session/ [SME: 139] + +* Thu Mar 31 2016 Jean-Philipe Pialasse 2.6.0-2.sme +- remove deprecated allow_call_time_pass_reference from php.ini [SME: 9416] + +* Fri Feb 05 2016 stephane de Labrusse 2.6.0-1.sme +- Initial release to sme10 + +* Mon Jun 29 2015 stephane de Labrusse 2.4.0-5 +- revert the e-smith-php-2.4.0_add_upload_tmp_folder.patch [SME: 7011] + +* Fri Nov 14 2014 Charlie Brady 2.4.0-4.sme +- Remove obsolete gpc_order setting from php.ini. [SME: 8652] + +* Sun May 4 2014 stephane de Labrusse 2.4.0-3.sme +- Add an upload_tmp_folder setting by db command [SME: 7011] +- Thanks to Michael McCarn and Jean-philippe Pialasse + +* Sun May 19 2013 Ian Wells 2.4.0-2.sme +- Force magic_quotes Off [SME: 7605] + +* Wed Feb 13 2013 Shad L. Lords 2.4.0-1.sme +- Roll new stream for sme9 + +* Mon Sep 19 2011 Jonathan Martens 2.2.0-6.sme +- Remove PHP version check from migrate script [SME: 6727] + +* Mon Sep 19 2011 Jonathan Martens 2.2.0-5.sme +- Obsolete magic_quotes settings [SME: 6725] + +* Sat Sep 17 2011 Jonathan Martens 2.2.0-4.sme +- Set default timezone [SME: 6716] + +* Mon Jul 19 2010 Ian Wells 2.2.0-3.sme +- Default expose_php in php.ini to Off [SME: 6136] + +* Sun Mar 14 2010 Jonathan Martens 2.2.0-2.sme +- Prepare for obsoletion of magic_quotes* when we supply PHP 5.3.0+ [SME: 5843] + +* Tue Oct 7 2008 Shad L. Lords 2.2.0-1.sme +- Roll new stream to separate sme7/sme8 trees [SME: 4633] + +* Wed Aug 20 2008 Jonathan Martens 1.12.0-8 +- Fix latest patches to prevent .orig file [SME: 4513] + +* Wed Aug 20 2008 Jonathan Martens 1.12.0-7 +- Fix some minor layout issues introduced by fixes in [SME: 4513] + +* Tue Aug 19 2008 Jonathan Martens 1.12.0-6 +- Fix whiteline and spacing issues [SME: 4513] + +* Fri Apr 18 2008 Jonathan Martens 1.12.0-5 +- Split 80ModuleSettings template fragmenent to have one frament per module [SME: 3282] + +* Fri May 18 2007 Shad L. Lords 1.12.0-4 +- Use correct lib for modules + +* Sun Apr 29 2007 Shad L. Lords +- Clean up spec so package can be built by koji/plague + +* Thu Dec 07 2006 Shad L. Lords +- Update to new release naming. No functional changes. +- Make Packager generic + +* Fri Oct 13 2006 Shad L. Lords 1.12.0-02 +- Add support for php5 [SME: 1120] + +* Fri Mar 17 2006 Gordon Rowell 1.12.0-01 +- Roll stable stream version. [SME: 1016] + +* Mon Jan 30 2006 Charlie Brady 1.11.0-10 +- Remove all pre/post/preun/postun scriptlets. [SME: 469] + +* Wed Nov 30 2005 Gordon Rowell 1.11.0-09 +- Bump release number only + +* Tue Oct 18 2005 Charlie Brady +- [1.11.0-08] +- Prevent i-bay name aliasing in default open_basedir restriction. + [SF: 1330228] + +* Tue Sep 6 2005 Tony Clayton +- [1.11.0-07] +- Turn register_globals off by default [SF: 1271218] + +* Tue Jul 19 2005 Charlie Brady +- [1.11.0-06] +- Update to current db access APIs, in readiness for move of dbs to private + directory. [SF: 1216546 (Shad)] + +* Sun May 1 2005 Charlie Brady +- [1.11.0-05] +- Update include_path in php.ini, to base and add-on pear directories. + +* Tue Jan 25 2005 Charlie Brady +- [1.11.0-04] +- Use generic_template_expand action to expand /etc/php.ini. + Add e-smith-lib dependency. Add e-smith-devtools dependency. [MN00064130] +- Remove anachronisms in /etc/php.ini templates. +- Fix loss of AllowUrlFopen property during post-install. [MN00064752] + +* Wed Nov 10 2004 Charlie Brady +- [1.11.0-03] +- Convert apache config fragments to apache2 format. [charlieb MN00051144] + +* Fri Nov 5 2004 Charlie Brady +- [1.11.0-02] +- Remove specification of dynamic extensions, as that is done with newer + php via /etc/php.d/. [charlieb MN00051515] +- Replace deprecated Copyright header with License header. +- Remove bogus WARNING text from spec file. [charlieb] + +* Mon Jan 26 2004 Michael Soulier +- [1.11.0-01] +- rolling to dev - 1.11.0 + +* Thu Jun 26 2003 Charlie Brady +- [1.10.0-01] +- Changing version to stable stream number - 1.10.0 + +* Wed May 28 2003 Michael Soulier +- [1.9.0-13] +- Fixed a typo in the previous version. [msoulier 8852] + +* Wed May 28 2003 Michael Soulier +- [1.9.0-12] +- Wrappered the restart of the e-smith web server so that it is conditional on + e-smith-apache being installed. [msoulier 8852] + +* Tue May 27 2003 Michael Soulier +- [1.9.0-11] +- Remembered that we can't query the rpm database during rpm installs. + [msoulier 8852] + +* Tue May 27 2003 Michael Soulier +- [1.9.0-10] +- Wrappered the restart of the e-smith web server so that it is conditional on + e-smith-apache being installed. [msoulier 8852] + +* Tue May 27 2003 Michael Soulier +- [1.9.0-09] +- Added a type default fragment. [msoulier 3299] + +* Wed Apr 23 2003 Gordon Rowell +- [1.9.0-08] +- Increase limits to allow webmail attachments of 10MB, rather than 2MB + MemoryLimit 8M -> 32M, PostMaxSize 8M -> 20M, UploadMaxFilesize 2M -> 10M [gordonr 8478] + +* Wed Apr 2 2003 Gordon Rowell +- [1.9.0-07] +- set allow_url_fopen = Off by default, tunable in config db [gordonr 4970] + +* Tue Apr 1 2003 Gordon Rowell +- [1.9.0-06] +- And back out last change - not a bug [gordonr 7836] + +* Tue Apr 1 2003 Gordon Rowell +- [1.9.0-05] +- Fix include_path in php.ini [gordonr 7836] + +* Fri Mar 7 2003 Gordon Rowell +- [1.9.0-04] +- Update more httpd.conf fragments to new interface [gordonr 7600] + +* Fri Mar 7 2003 Gordon Rowell +- [1.9.0-03] +- Update httpd.conf fragment to new interface [gordonr 7600] + +* Thu Jan 23 2003 Michael Soulier +- [1.9.0-02] +- Adding .phtml extension. [msoulier 6543] + +* Thu Jan 23 2003 Michael Soulier +- [1.9.0-01] +- rolling to development stream to 1.9.0 + +* Thu Jan 23 2003 Michael Soulier +- [1.8.0-05] +- Backing out changes since 1.8.0-01, as they belong in a development stream. + [msoulier 6543] + +* Thu Jan 23 2003 Michael Soulier +- [1.8.0-04] +- Fixed a syntax error that I should have caught before committing the last + version. [msoulier 6543] + +* Thu Jan 23 2003 Michael Soulier +- [1.8.0-03] +- Bringing the api up to the modern version. [msoulier 6543] + +* Thu Jan 23 2003 Michael Soulier +- [1.8.0-02] +- Added index.phtml to the DirectoryIndex directive, and made the code a + little nicer to look at. [msoulier 6543] + +* Fri Oct 11 2002 Charlie Brady +- [1.8.0-01] +- Roll to maintained version number to 1.8.0 + +* Mon Jul 22 2002 Charlie Brady +- [1.7.1-01] +- Add conf-php link to bootstrap-console-save event [charlieb 1939] + +* Wed Jun 5 2002 Charlie Brady +- [1.7.0-01] +- Changing version to development stream number to 1.7.0 + +* Fri May 31 2002 Charlie Brady +- [1.6.0-01] +- Changing version to maintained stream number to 1.6.0 + +* Thu May 23 2002 Gordon Rowell +- [1.5.5-01] +- RPM rebuild forced by cvsroot2rpm + +* Fri Mar 15 2002 Gordon Rowell +- [1.5.4-01] +- Turned off display_errors, use error_log -> syslog instead, as per + Dan Brown's PHP upgrade HOWTO +- Tidied up formatting in that fragment [gordonr 3019] + +* Fri Mar 15 2002 Gordon Rowell +- [1.5.3-01] +- Imported into CVS + +* Fri Mar 15 2002 Gordon Rowell +- [1.5.1-01] +- rollRPM: Rolled version number to 1.5.1-01. Includes patches up to 1.5.0-03. + +* Mon Feb 04 2002 Charlie Brady +- [1.5.0-03] +- Remove all comments from php.ini template fragments. +- Allow some resource limits to be set by properties of the php service + in the config db. + +* Mon Feb 04 2002 Charlie Brady +- [1.5.0-02] +- Template /etc/php.ini, and expand template during conf-php action. +- Make some simplifications to the conf-php script, and remove a + potential error case (php is not in config db and event is neither + post-install or post-upgrade). + +* Mon Feb 4 2002 Charlie Brady +- [1.5.0-01] +- rollRPM: Rolled version number to 1.5.0-01. Includes patches up to 1.4.0-03. + +* Thu Sep 6 2001 Charlie Brady +- [1.4.0-03] +- Restrict PHP programs residing in an i-bay to only be able to open files + which reside in the same i-bay. An i-bay property PHPBaseDir is available + to override this restriction. + +* Fri Aug 17 2001 gordonr +- [1.4.0-02] +- Autorebuild by rebuildRPM + +* Wed Aug 8 2001 Charlie Brady +- [1.4.0-01] +- Rolled version number to 1.4.0-01. Includes patches upto 1.3.0-02. + +* Wed Aug 8 2001 Charlie Brady +- [1.3.0-02] +- Load PHP modules late, not first. This corrects a compatibility problem + with RedHat 7.1 RPMS. + +* Wed Aug 8 2001 Charlie Brady +- [1.3.0-01] +- Rolled version number to 1.3.0-01. Includes patches upto 1.2.0-05. + +* Fri Jul 6 2001 Peter Samuel +- [1.2.0-05] +- Changed license to GPL + +* Fri Mar 23 2001 Charlie Brady +- [1.2.0-04] +- Disable PHP MIME type by default +- Enable PHP MIME type for each i-bay for which dynamic content is enabled. + +* Thu Feb 8 2001 Adrian Chung +- [1.2.0-03] +- Rolling release number for GPG signing. + +* Thu Jan 25 2001 Adrian Chung +- [1.2.0-02] +- changed action to run at 50, instead of 55. + +* Thu Jan 25 2001 Peter Samuel +- [1.2.0-01] +- Rolled version number to 1.2.0-01. Includes patches upto 1.1.0-10. + +* Wed Jan 17 2001 Adrian Chung +- [1.1.0-10] +- PHP is enabled by default. + +* Fri Jan 12 2001 Adrian Chung +- [1.1.0-9] +- rolling to 9, 8 is missing. +- pulling expand httpd.conf, we'll leave conf-httpd + to do it. + +* Thu Jan 11 2001 Tony Clayton +- [1.1.0-8] +- pulled restarting apache - just expand httpd.conf + +* Thu Jan 11 2001 Tony Clayton +- [1.1.0-7] +- apache now restarts whenever php's status changes + +* Thu Jan 11 2001 Tony Clayton +- [1.1.0-6] +- expand httpd.conf template from conf-php + +* Thu Jan 11 2001 Tony Clayton +- [1.1.0-5] +- add apache restart code to conf-php + +* Sat Jan 6 2001 Charlie Brady +- [1.1.0-4] +- Only run %post actions in runlevel 7 + +* Fri Jan 5 2001 Adrian Chung +- [1.1.0-3] +- put createlinks back in. + +* Fri Jan 5 2001 Adrian Chung +- [1.1.0-2] +- expand PHP httpd.conf fragments conditionally based on + service status. +- add PHP to the services database and default to disabled. + +* Wed Dec 06 2000 Peter Samuel +- [1.1.0-1] +- Rolled version to 1.1.0-1. Inlcudes patches up to 0.1-1. + +* Tue Nov 14 2000 Adrian Chung +- initial release