diff --git a/actions/admin/settings/136.phpfpm.php b/actions/admin/settings/136.phpfpm.php index 7edca760..61bfd624 100644 --- a/actions/admin/settings/136.phpfpm.php +++ b/actions/admin/settings/136.phpfpm.php @@ -185,6 +185,15 @@ return array( 'default' => 30, 'save_method' => 'storeSettingField' ), + 'system_phpfpm_use_mod_proxy' => array( + 'label' => $lng['phpfpm']['use_mod_proxy'], + 'settinggroup' => 'phpfpm', + 'varname' => 'use_mod_proxy', + 'type' => 'bool', + 'default' => false, + 'visible' => Settings::Get('system.apache24'), + 'save_method' => 'storeSettingField' + ), ), ), ), diff --git a/install/froxlor.sql b/install/froxlor.sql index 65497507..57e25af9 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -404,6 +404,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'defaultini', '1'), ('phpfpm', 'vhost_defaultini', '2'), ('phpfpm', 'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'), + ('phpfpm', 'use_mod_proxy', '0'), ('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'), ('system', 'lastaccountnumber', '0'), ('system', 'lastguid', '9999'), diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index e0caac93..aed65181 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2803,5 +2803,9 @@ if (isFroxlorVersion('0.9.33-dev2')) { Settings::AddNew("panel.password_special_char", '!?<>ยง$%&+#=@'); lastStepStatus(0); + showUpdateStep("Adding settings for fpm-apache2.4-mod_proxy integration"); + Settings::AddNew("phpfpm.use_mod_proxy", '0'); + lastStepStatus(0); + updateToVersion('0.9.33-dev3'); } diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 0669d55d..83ae59e6 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -51,6 +51,6 @@ define('TABLE_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings'); define('TABLE_DOMAINTOIP', 'panel_domaintoip'); // VERSION INFO -$version = '0.9.33-dev2'; +$version = '0.9.33-dev3'; $dbversion = '2'; $branding = ''; diff --git a/lng/english.lng.php b/lng/english.lng.php index 5d94e5c8..379783d7 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1833,3 +1833,5 @@ $lng['serversettings']['panel_password_special_char_required']['title'] = 'Speci $lng['serversettings']['panel_password_special_char_required']['description'] = 'Password must contain at least one of the characters defined below.'; $lng['serversettings']['panel_password_special_char']['title'] = 'Special characters list'; $lng['serversettings']['panel_password_special_char']['description'] = 'One of these characters is required if the above option is set.'; +$lng['phpfpm']['use_mod_proxy']['title'] = 'Use mod_proxy / mod_proxy_fcgi'; +$lng['phpfpm']['use_mod_proxy']['description'] = 'Activate to use php-fpm via mod_proxy_fcgi. Requires at least apache-2.4.9'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 00fc64ba..e6f4a69f 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1557,3 +1557,5 @@ $lng['serversettings']['panel_password_special_char_required']['title'] = 'Sonde $lng['serversettings']['panel_password_special_char_required']['description'] = 'Das Passwort muss mindestens eines der untenstehenden Sonderzeichen enthalten'; $lng['serversettings']['panel_password_special_char']['title'] = 'Sonderzeichen-Liste'; $lng['serversettings']['panel_password_special_char']['description'] = 'Mindestens eines dieser Sonderzeichen muss in dem Passwort vorkommen, sofern die Sonderzeichen-Option aktiviert ist.'; +$lng['phpfpm']['use_mod_proxy']['title'] = 'Verwende mod_proxy / mod_proxy_fcgi'; +$lng['phpfpm']['use_mod_proxy']['description'] = 'Diese Option kann aktiviert werden, um php-fpm via mod_proxy_fcgi einzubinden. Dies setzt mindestens apache-2.4.9 voraus'; diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index 036961cd..4961e617 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -259,23 +259,34 @@ class apache { if ($row_ipsandports['ssl']) { $srvName = substr(md5($ipport),0,4).'.ssl-fpm.external'; } - $this->virtualhosts_data[$vhosts_filename] .= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName .' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . Settings::Get('phpfpm.idle_timeout') . "\n"; - $this->virtualhosts_data[$vhosts_filename] .= ' ' . "\n"; - $file_extensions = explode(' ', $phpconfig['file_extensions']); - $this->virtualhosts_data[$vhosts_filename] .= ' ' . "\n"; - $this->virtualhosts_data[$vhosts_filename] .= ' AddHandler php5-fastcgi .php'. "\n"; - $this->virtualhosts_data[$vhosts_filename] .= ' Action php5-fastcgi /fastcgiphp' . "\n"; - $this->virtualhosts_data[$vhosts_filename].= ' Options +ExecCGI' . "\n"; - $this->virtualhosts_data[$vhosts_filename].= ' ' . "\n"; - // >=apache-2.4 enabled? - if (Settings::Get('system.apache24') == '1') { - $this->virtualhosts_data[$vhosts_filename] .= ' Require all granted' . "\n"; + + // mod_proxy stuff for apache-2.4 + if (Settings::Get('system.apache24') == '1' + && Settings::Get('phpfpm.use_mod_proxy') == '1' + ) { + $this->virtualhosts_data[$vhosts_filename] .= ' '. "\n"; + $this->virtualhosts_data[$vhosts_filename] .= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost/'. "\n"; + $this->virtualhosts_data[$vhosts_filename] .= ' ' . "\n"; + } else { - $this->virtualhosts_data[$vhosts_filename] .= ' Order allow,deny' . "\n"; - $this->virtualhosts_data[$vhosts_filename] .= ' allow from all' . "\n"; + $this->virtualhosts_data[$vhosts_filename] .= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName .' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . Settings::Get('phpfpm.idle_timeout') . "\n"; + $this->virtualhosts_data[$vhosts_filename] .= ' ' . "\n"; + $file_extensions = explode(' ', $phpconfig['file_extensions']); + $this->virtualhosts_data[$vhosts_filename] .= ' ' . "\n"; + $this->virtualhosts_data[$vhosts_filename] .= ' AddHandler php5-fastcgi .php'. "\n"; + $this->virtualhosts_data[$vhosts_filename] .= ' Action php5-fastcgi /fastcgiphp' . "\n"; + $this->virtualhosts_data[$vhosts_filename].= ' Options +ExecCGI' . "\n"; + $this->virtualhosts_data[$vhosts_filename].= ' ' . "\n"; + // >=apache-2.4 enabled? + if (Settings::Get('system.apache24') == '1') { + $this->virtualhosts_data[$vhosts_filename] .= ' Require all granted' . "\n"; + } else { + $this->virtualhosts_data[$vhosts_filename] .= ' Order allow,deny' . "\n"; + $this->virtualhosts_data[$vhosts_filename] .= ' allow from all' . "\n"; + } + $this->virtualhosts_data[$vhosts_filename] .= ' ' . "\n"; + $this->virtualhosts_data[$vhosts_filename] .= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n"; } - $this->virtualhosts_data[$vhosts_filename] .= ' ' . "\n"; - $this->virtualhosts_data[$vhosts_filename] .= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n"; } /** diff --git a/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php b/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php index 1dfc9e01..294f28b3 100644 --- a/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php +++ b/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php @@ -39,22 +39,33 @@ class apache_fcgid extends apache if (customerHasPerlEnabled($domain['customerid'])) { $php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n"; } - $php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . Settings::Get('phpfpm.idle_timeout') . "\n"; - $php_options_text.= ' ' . "\n"; - $php_options_text.= ' ' . "\n"; - $php_options_text.= ' SetHandler php5-fastcgi'. "\n"; - $php_options_text.= ' Action php5-fastcgi /fastcgiphp' . "\n"; - $php_options_text.= ' Options +ExecCGI' . "\n"; - $php_options_text.= ' ' . "\n"; - // >=apache-2.4 enabled? - if (Settings::Get('system.apache24') == '1') { - $php_options_text.= ' Require all granted' . "\n"; + + // mod_proxy stuff for apache-2.4 + if (Settings::Get('system.apache24') == '1' + && Settings::Get('phpfpm.use_mod_proxy') == '1' + ) { + $php_options_text.= ' '. "\n"; + $php_options_text.= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost/'. "\n"; + $php_options_text.= ' ' . "\n"; + } else { - $php_options_text.= ' Order allow,deny' . "\n"; - $php_options_text.= ' allow from all' . "\n"; + $php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . Settings::Get('phpfpm.idle_timeout') . "\n"; + $php_options_text.= ' ' . "\n"; + $php_options_text.= ' ' . "\n"; + $php_options_text.= ' SetHandler php5-fastcgi'. "\n"; + $php_options_text.= ' Action php5-fastcgi /fastcgiphp' . "\n"; + $php_options_text.= ' Options +ExecCGI' . "\n"; + $php_options_text.= ' ' . "\n"; + // >=apache-2.4 enabled? + if (Settings::Get('system.apache24') == '1') { + $php_options_text.= ' Require all granted' . "\n"; + } else { + $php_options_text.= ' Order allow,deny' . "\n"; + $php_options_text.= ' allow from all' . "\n"; + } + $php_options_text.= ' ' . "\n"; + $php_options_text.= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n"; } - $php_options_text.= ' ' . "\n"; - $php_options_text.= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n"; } else {