diff --git a/actions/admin/settings/136.phpfpm.php b/actions/admin/settings/136.phpfpm.php index f5281268..97527d9b 100644 --- a/actions/admin/settings/136.phpfpm.php +++ b/actions/admin/settings/136.phpfpm.php @@ -62,7 +62,7 @@ return array( 'default' => '1', 'option_mode' => 'one', 'option_options_method' => 'getPhpConfigs', - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_defaultini_ownvhost' => array( 'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'], @@ -72,7 +72,7 @@ return array( 'default' => '1', 'option_mode' => 'one', 'option_options_method' => 'getPhpConfigs', - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_configdir' => array( 'label' => $lng['serversettings']['phpfpm_settings']['configdir'], @@ -81,7 +81,7 @@ return array( 'type' => 'string', 'string_type' => 'confdir', 'default' => '/etc/php-fpm.d/', - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_aliasconfigdir' => array( 'label' => $lng['serversettings']['phpfpm_settings']['aliasconfigdir'], @@ -90,7 +90,7 @@ return array( 'type' => 'string', 'string_type' => 'confdir', 'default' => '/var/www/php-fpm/', - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_tmpdir' => array( 'label' => $lng['serversettings']['mod_fcgid']['tmpdir'], @@ -99,7 +99,7 @@ return array( 'type' => 'string', 'string_type' => 'dir', 'default' => '/var/customers/tmp/', - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_peardir' => array( 'label' => $lng['serversettings']['mod_fcgid']['peardir'], @@ -108,7 +108,16 @@ return array( 'type' => 'string', 'string_type' => 'dir', 'default' => '/usr/share/php/:/usr/share/php5/', - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' + ), + 'system_phpfpm_fastcgi_ipcdir' => array( + 'label' => $lng['serversettings']['phpfpm_settings']['ipcdir'], + 'settinggroup' => 'phpfpm', + 'varname' => 'fastcgi_ipcdir', + 'type' => 'string', + 'string_type' => 'dir', + 'default' => '/var/lib/apache2/fastcgi/', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_reload' => array( 'label' => $lng['serversettings']['phpfpm_settings']['reload'], @@ -116,7 +125,7 @@ return array( 'varname' => 'reload', 'type' => 'string', 'default' => '/etc/init.d/php-fpm restart', - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_pm' => array( 'label' => $lng['serversettings']['phpfpm_settings']['pm'], @@ -126,7 +135,7 @@ return array( 'default' => 'static', 'option_mode' => 'one', 'option_options' => array('static' => 'static', 'dynamic' => 'dynamic', 'ondemand' => 'ondemand'), - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_max_children' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_children'], @@ -134,7 +143,7 @@ return array( 'varname' => 'max_children', 'type' => 'int', 'default' => 1, - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_start_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['start_servers'], @@ -142,7 +151,7 @@ return array( 'varname' => 'start_servers', 'type' => 'int', 'default' => 20, - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_min_spare_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers'], @@ -150,7 +159,7 @@ return array( 'varname' => 'min_spare_servers', 'type' => 'int', 'default' => 5, - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_max_spare_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers'], @@ -158,7 +167,7 @@ return array( 'varname' => 'max_spare_servers', 'type' => 'int', 'default' => 35, - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_max_requests' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_requests'], @@ -166,7 +175,7 @@ return array( 'varname' => 'max_requests', 'type' => 'int', 'default' => 0, - 'save_method' => 'storeSettingField', + 'save_method' => 'storeSettingField' ), 'system_phpfpm_idle_timeout' => array( 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout'], diff --git a/admin_configfiles.php b/admin_configfiles.php index dab2e3cf..3da7f611 100644 --- a/admin_configfiles.php +++ b/admin_configfiles.php @@ -100,7 +100,8 @@ if($userinfo['change_serversettings'] == '1') '' => makeCorrectDir(dirname(__FILE__)), '' => makeCorrectDir($settings['system']['bindconf_directory']), '' => $settings['system']['apachereload_command'], - '' => makeCorrectDir($settings['system']['logfiles_directory']) + '' => makeCorrectDir($settings['system']['logfiles_directory']), + '' => makeCorrectDir($settings['phpfpm']['fastcgi_ipcdir']) ); $files = ''; $configpage = ''; diff --git a/install/froxlor.sql b/install/froxlor.sql index 2d1a56ad..316a42dc 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -415,6 +415,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/'), ('phpfpm', 'defaultini', '1'), ('phpfpm', 'vhost_defaultini', '1'), + ('phpfpm', 'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'), ('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'), ('system', 'lastaccountnumber', '0'), ('system', 'lastguid', '9999'), @@ -539,7 +540,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'phpconfigs_hidestdsubdomain', '0'), ('panel', 'allow_theme_change_admin', '1'), ('panel', 'allow_theme_change_customer', '1'), - ('panel', 'version', '0.9.31-dev1'); + ('panel', 'version', '0.9.31-dev2'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/install/lib/class.FroxlorInstall.php b/install/lib/class.FroxlorInstall.php index 524b72bd..3ed0155a 100644 --- a/install/lib/class.FroxlorInstall.php +++ b/install/lib/class.FroxlorInstall.php @@ -385,12 +385,14 @@ class FroxlorInstall { $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/froxlor-htpasswd/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_htpasswddir'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/init.d/lighttpd reload' WHERE `settinggroup` = 'system' AND `varname` = 'apachereload_command'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/lighttpd.pem' WHERE `settinggroup` = 'system' AND `varname` = 'ssl_cert_file'"); + $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/var/run/lighttpd/' WHERE `settinggroup` = 'phpfpm' AND `varname` = 'fastcgi_ipcdir'"); } elseif ($this->_data['webserver'] == "nginx") { $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/nginx/sites-enabled/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_vhost'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/nginx/sites-enabled/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_diroptions'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/nginx/froxlor-htpasswd/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_htpasswddir'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/init.d/nginx reload' WHERE `settinggroup` = 'system' AND `varname` = 'apachereload_command'"); $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/nginx/nginx.pem' WHERE `settinggroup` = 'system' AND `varname` = 'ssl_cert_file'"); + $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/var/run/nginx/' WHERE `settinggroup` = 'phpfpm' AND `varname` = 'fastcgi_ipcdir'"); } // insert the lastcronrun to be the installation date @@ -733,7 +735,7 @@ class FroxlorInstall { // check for correct php version $content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']); - if (version_compare("5.2.0", PHP_VERSION, ">=")) { + if (version_compare("5.3.0", PHP_VERSION, ">=")) { $content .= $this->_status_message('red', $this->_lng['requirements']['notfound'].' ('.PHP_VERSION.')'); $_die = true; } else { 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 feb5b6f5..5d4bbcde 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2423,3 +2423,26 @@ if (isFroxlorVersion('0.9.30')) { updateToVersion('0.9.31-dev1'); } + +if (isFroxlorVersion('0.9.31-dev1')) { + + showUpdateStep("Updating from 0.9.31-dev1 to 0.9.31-dev2", true); + lastStepStatus(0); + + showUpdateStep("Adding new phpfpm-ipcdir setting"); + $ins_stmt = Database::prepare(" + INSERT INTO `".TABLE_PANEL_SETTINGS."` SET `settinggroup` = 'phpfpm', `varname` = 'fastcgi_ipcdir', `value` = :value + "); + $params = array(); + if ($settings['system']['webserver'] == 'apache2') { + $params['value'] = '/var/lib/apache2/fastcgi/'; + } elseif ($settings['system']['webserver'] == 'lighttpd') { + $params['value'] = '/var/run/lighttpd/'; + } elseif ($settings['system']['webserver'] == 'nginx') { + $params['value'] = '/var/run/nginx/'; + } + Database::pexecute($ins_stmt, $params); + lastStepStatus(0); + + updateToVersion('0.9.31-dev2'); +} diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index 0808bb23..8240a872 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -561,7 +561,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) $has_preconfig = true; $description = 'The PHP-FPM implementation for apache2 has changed. Please look for the "fastcgi.conf" (Debian/Ubuntu) or "70_fastcgi.conf" (Gentoo) within /etc/apache2/ and change it as shown below:

'; $description .= '
<IfModule mod_fastcgi.c>
-    FastCgiIpcDir /var/run/apache2/
+    FastCgiIpcDir /var/lib/apache2/fastcgi/
     <Location "/fastcgiphp">
         Order Deny,Allow
         Deny from All
@@ -573,4 +573,15 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
 			eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
 		}
 	}
+
+	if (versionInUpdate($current_version, '0.9.31-dev2')) {
+		if ($settings['system']['webserver'] == 'apache2'
+				&& $settings['phpfpm']['enabled'] == '1'
+		) {
+			$has_preconfig = true;
+			$description  = 'The FPM socket directory is now a setting in froxlor. Its default is /var/lib/apache2/fastcgi/.
If you are using /var/run/apache2 in the "fastcgi.conf" (Debian/Ubuntu) or "70_fastcgi.conf" (Gentoo) please correct this path accordingly
'; + $question = ''; + eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); + } + } } diff --git a/lib/classes/phpinterface/class.phpinterface_fpm.php b/lib/classes/phpinterface/class.phpinterface_fpm.php index f3e7b32b..ff01b20c 100644 --- a/lib/classes/phpinterface/class.phpinterface_fpm.php +++ b/lib/classes/phpinterface/class.phpinterface_fpm.php @@ -287,7 +287,9 @@ class phpinterface_fpm { */ public function getSocketFile($createifnotexists = true) { - $socketdir = makeCorrectDir('/var/run/'.$this->_settings['system']['webserver'].'/'); + // see #1300 why this has changed + //$socketdir = makeCorrectDir('/var/run/'.$this->_settings['system']['webserver'].'/'); + $socketdir = makeCorrectDir($this->_settings['phpfpm']['fastcgi_ipcdir']); $socket = makeCorrectFile($socketdir.'/'.$this->_domain['loginname'].'-'.$this->_domain['domain'].'-php-fpm.socket'); if (!is_dir($socketdir) && $createifnotexists) { diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 46f30f6c..08e108a3 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -71,6 +71,6 @@ define('PACKAGE_LOCKED', 1); define('PACKAGE_ENABLED', 2); // VERSION INFO -$version = '0.9.31-dev1'; +$version = '0.9.31-dev2'; $dbversion = '2'; $branding = ''; diff --git a/lng/english.lng.php b/lng/english.lng.php index 8d54f2cc..54d78550 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1975,4 +1975,6 @@ $lng['panel']['dashboard'] = "Dashboard"; $lng['panel']['used'] = "used"; $lng['panel']['assigned'] = "assigned"; $lng['panel']['available'] = "available"; -$lng['customer']['services'] = "Services"; \ No newline at end of file +$lng['customer']['services'] = "Services"; +$lng['serversettings']['phpfpm_settings']['ipcdir']['title'] = 'FastCGI IPC directory'; +$lng['serversettings']['phpfpm_settings']['ipcdir']['description'] = 'The directory where the php-fpm sockets will be stored by the webserver.
This directory has to be readable for the webserver'; diff --git a/lng/german.lng.php b/lng/german.lng.php index cf94632b..5b3e853f 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1701,4 +1701,6 @@ $lng['panel']['dashboard'] = "Dashboard"; $lng['panel']['used'] = "genutzt"; $lng['panel']['assigned'] = "zugewiesen"; $lng['panel']['available'] = "verfügbar"; -$lng['customer']['services'] = "Dienste"; \ No newline at end of file +$lng['customer']['services'] = "Dienste"; +$lng['serversettings']['phpfpm_settings']['ipcdir']['title'] = 'FastCGI IPC Verzeichnis'; +$lng['serversettings']['phpfpm_settings']['ipcdir']['description'] = 'In dieses Verzeichnis werden die php-fpm Sockets vom Webserver abgelegt.
Das Verzeichnis muss für den Webserver lesbar sein.'; diff --git a/templates/misc/configfiles/debian_squeeze/apache2/etc_apache2_mods-enabled_fastcgi.conf b/templates/misc/configfiles/debian_squeeze/apache2/etc_apache2_mods-enabled_fastcgi.conf index 1b226af8..db1a4557 100644 --- a/templates/misc/configfiles/debian_squeeze/apache2/etc_apache2_mods-enabled_fastcgi.conf +++ b/templates/misc/configfiles/debian_squeeze/apache2/etc_apache2_mods-enabled_fastcgi.conf @@ -1,5 +1,5 @@ - FastCgiIpcDir /var/run/apache2/ + FastCgiIpcDir Order Deny,Allow diff --git a/templates/misc/configfiles/debian_wheezy/apache2/etc_apache2_mods-enabled_fastcgi.conf b/templates/misc/configfiles/debian_wheezy/apache2/etc_apache2_mods-enabled_fastcgi.conf index 1b226af8..db1a4557 100644 --- a/templates/misc/configfiles/debian_wheezy/apache2/etc_apache2_mods-enabled_fastcgi.conf +++ b/templates/misc/configfiles/debian_wheezy/apache2/etc_apache2_mods-enabled_fastcgi.conf @@ -1,5 +1,5 @@ - FastCgiIpcDir /var/run/apache2/ + FastCgiIpcDir Order Deny,Allow diff --git a/templates/misc/configfiles/gentoo/apache2/etc_apache2_modules.d_70_fastcgi.conf b/templates/misc/configfiles/gentoo/apache2/etc_apache2_modules.d_70_fastcgi.conf index 1b226af8..db1a4557 100644 --- a/templates/misc/configfiles/gentoo/apache2/etc_apache2_modules.d_70_fastcgi.conf +++ b/templates/misc/configfiles/gentoo/apache2/etc_apache2_modules.d_70_fastcgi.conf @@ -1,5 +1,5 @@ - FastCgiIpcDir /var/run/apache2/ + FastCgiIpcDir Order Deny,Allow diff --git a/templates/misc/configfiles/ubuntu_lucid/apache2/etc_apache2_mods-enabled_fastcgi.conf b/templates/misc/configfiles/ubuntu_lucid/apache2/etc_apache2_mods-enabled_fastcgi.conf index 1b226af8..db1a4557 100644 --- a/templates/misc/configfiles/ubuntu_lucid/apache2/etc_apache2_mods-enabled_fastcgi.conf +++ b/templates/misc/configfiles/ubuntu_lucid/apache2/etc_apache2_mods-enabled_fastcgi.conf @@ -1,5 +1,5 @@ - FastCgiIpcDir /var/run/apache2/ + FastCgiIpcDir Order Deny,Allow diff --git a/templates/misc/configfiles/ubuntu_precise/apache2/etc_apache2_mods-enabled_fastcgi.conf b/templates/misc/configfiles/ubuntu_precise/apache2/etc_apache2_mods-enabled_fastcgi.conf index 1b226af8..db1a4557 100644 --- a/templates/misc/configfiles/ubuntu_precise/apache2/etc_apache2_mods-enabled_fastcgi.conf +++ b/templates/misc/configfiles/ubuntu_precise/apache2/etc_apache2_mods-enabled_fastcgi.conf @@ -1,5 +1,5 @@ - FastCgiIpcDir /var/run/apache2/ + FastCgiIpcDir Order Deny,Allow