Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94c94d2d14 | ||
|
|
57ec429776 | ||
|
|
c52d3819af | ||
|
|
85f35abe2d | ||
|
|
58674a2f8f | ||
|
|
968137a967 | ||
|
|
66b274c1bf | ||
|
|
b9d68a17fa | ||
|
|
ced64138e8 | ||
|
|
4fdaed5cc4 | ||
|
|
0fd11afdcb | ||
|
|
8202cc96e7 | ||
|
|
59bf7ba22f | ||
|
|
9c075c05f5 | ||
|
|
6815501c1d | ||
|
|
f11aa9a1c4 | ||
|
|
3b33dde9ac | ||
|
|
7fb0e88313 | ||
|
|
9615aaa83a | ||
|
|
16cc53146c | ||
|
|
56e9f748f4 | ||
|
|
80e338610f | ||
|
|
93abbf4a10 | ||
|
|
0271ccfc28 | ||
|
|
dae3e416a2 | ||
|
|
759213f8b9 | ||
|
|
01b313a3ce | ||
|
|
4567f7c781 | ||
|
|
ef76635508 | ||
|
|
30235ff3eb | ||
|
|
ebb390a1fd | ||
|
|
0c1a4f692a |
@@ -29,6 +29,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => '/var/customers/webs/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkPathConflicts'
|
||||
),
|
||||
'system_ipaddress' => array(
|
||||
'label' => $lng['serversettings']['ipaddress'],
|
||||
@@ -58,6 +59,22 @@ return array(
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingHostname',
|
||||
),
|
||||
'system_froxlordirectlyviahostname' => array(
|
||||
'label' => $lng['serversettings']['froxlordirectlyviahostname'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'froxlordirectlyviahostname',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_stdsubdomain' => array(
|
||||
'label' => $lng['serversettings']['stdsubdomainhost'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'stdsubdomain',
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingHostname',
|
||||
),
|
||||
'system_mysql_access_host' => array(
|
||||
'label' => $lng['serversettings']['mysql_access_host'],
|
||||
'settinggroup' => 'system',
|
||||
|
||||
@@ -76,38 +76,6 @@ return array(
|
||||
'default' => '/etc/apache2/htpasswd/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_apachereload_command' => array(
|
||||
'label' => $lng['serversettings']['apachereload_command'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apachereload_command',
|
||||
'type' => 'string',
|
||||
'default' => '/etc/init.d/apache2 reload',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpreload_command' => array(
|
||||
'label' => $lng['serversettings']['phpreload_command'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'phpreload_command',
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_nginx_php_backend' => array(
|
||||
'label' => $lng['serversettings']['nginx_php_backend'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'nginx_php_backend',
|
||||
'type' => 'string',
|
||||
'default' => '127.0.0.1:8888',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mod_log_sql' => array(
|
||||
'label' => $lng['serversettings']['mod_log_sql'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_log_sql',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_logfiles_directory' => array(
|
||||
'label' => $lng['serversettings']['logfiles_directory'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -144,6 +112,41 @@ return array(
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_apachereload_command' => array(
|
||||
'label' => $lng['serversettings']['apachereload_command'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apachereload_command',
|
||||
'type' => 'string',
|
||||
'default' => '/etc/init.d/apache2 reload',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpreload_command' => array(
|
||||
'label' => $lng['serversettings']['phpreload_command'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'phpreload_command',
|
||||
'type' => (getSetting('phpfpm', 'enabled') == '1') ? 'hidden' : 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
'system_nginx_php_backend' => array(
|
||||
'label' => $lng['serversettings']['nginx_php_backend'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'nginx_php_backend',
|
||||
'type' => (getSetting('phpfpm', 'enabled') == '1') ? 'hidden' : 'string',
|
||||
'default' => '127.0.0.1:8888',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
'system_mod_log_sql' => array(
|
||||
'label' => $lng['serversettings']['mod_log_sql'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_log_sql',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'defaultwebsrverrhandler_enabled' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_enabled'],
|
||||
'settinggroup' => 'defaultwebsrverrhandler',
|
||||
@@ -159,6 +162,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'nginx')
|
||||
),
|
||||
'defaultwebsrverrhandler_err403' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_err403'],
|
||||
@@ -167,6 +171,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'nginx')
|
||||
),
|
||||
'defaultwebsrverrhandler_err404' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_err404'],
|
||||
@@ -183,6 +188,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'nginx')
|
||||
),
|
||||
'customredirect_enabled' => array(
|
||||
'label' => $lng['serversettings']['customredirect_enabled'],
|
||||
@@ -191,6 +197,7 @@ return array(
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'lighttpd')
|
||||
),
|
||||
'customredirect_default' => array(
|
||||
'label' => $lng['serversettings']['customredirect_default'],
|
||||
@@ -201,6 +208,7 @@ return array(
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getRedirectCodes',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'lighttpd')
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -19,6 +19,7 @@ return array(
|
||||
'groups' => array(
|
||||
'fcgid' => array(
|
||||
'title' => $lng['admin']['fcgid_settings'],
|
||||
'websrv_avail' => array('apache2', 'lighttpd'),
|
||||
'fields' => array(
|
||||
'system_mod_fcgid_enabled' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid'],
|
||||
@@ -27,6 +28,7 @@ return array(
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkFcgidPhpFpm',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_mod_fcgid_configdir' => array(
|
||||
@@ -67,6 +69,7 @@ return array(
|
||||
'option_options' => array(0 => 'ScriptAlias', 1=> 'FCGIWrapper'),
|
||||
'default' => 1,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_starter' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['starter'],
|
||||
@@ -101,6 +104,7 @@ return array(
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_httpuser' => array(
|
||||
'label' => $lng['admin']['mod_fcgid_user'],
|
||||
@@ -109,6 +113,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_httpgroup' => array(
|
||||
'label' => $lng['admin']['mod_fcgid_group'],
|
||||
@@ -117,6 +122,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_defaultini_ownvhost' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'],
|
||||
@@ -127,6 +133,7 @@ return array(
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
161
actions/admin/settings/136.phpfpm.php
Normal file
161
actions/admin/settings/136.phpfpm.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'phpfpm' => array(
|
||||
'title' => $lng['admin']['phpfpm_settings'],
|
||||
'fields' => array(
|
||||
'system_phpfpm_enabled' => array(
|
||||
'label' => $lng['serversettings']['phpfpm'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkFcgidPhpFpm',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_phpfpm_enabled_ownvhost' => array(
|
||||
'label' => $lng['phpfpm']['ownvhost'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'enabled_ownvhost',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_httpuser' => array(
|
||||
'label' => $lng['phpfpm']['vhost_httpuser'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_httpuser',
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_httpgroup' => array(
|
||||
'label' => $lng['phpfpm']['vhost_httpgroup'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_httpgroup',
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
/*
|
||||
* @TODO implement if phpfpm knows custom php.ini files
|
||||
*
|
||||
'system_phpfpm_defaultini_ownvhost' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_defaultini',
|
||||
'type' => 'option',
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
*/
|
||||
'system_phpfpm_configdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'configdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/etc/php-fpm.d/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_tmpdir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'tmpdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/tmp/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_peardir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'peardir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/share/php/:/usr/share/php5/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_reload' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'reload',
|
||||
'type' => 'string',
|
||||
'default' => '/etc/init.d/php-fpm restart',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_pm' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'pm',
|
||||
'type' => 'option',
|
||||
'default' => 'static',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('static' => 'static', 'dynamic' => 'dynamic'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_max_children' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_children',
|
||||
'type' => 'int',
|
||||
'default' => 1,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_start_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['start_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'start_servers',
|
||||
'type' => 'int',
|
||||
'default' => 20,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_min_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'min_spare_servers',
|
||||
'type' => 'int',
|
||||
'default' => 5,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_max_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_spare_servers',
|
||||
'type' => 'int',
|
||||
'default' => 35,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_max_requests' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_requests'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_requests',
|
||||
'type' => 'int',
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -27,6 +27,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => '/usr/bin/perl',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('lighttpd')
|
||||
),
|
||||
'system_perl_suexecworkaround' => array(
|
||||
'label' => $lng['serversettings']['perl']['suexecworkaround'],
|
||||
@@ -35,6 +36,7 @@ return array(
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_perl_suexeccgipath' => array(
|
||||
'label' => $lng['serversettings']['perl']['suexeccgipath'],
|
||||
@@ -43,6 +45,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => '/var/www/cgi-bin/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'perl_server' => array(
|
||||
'label' => $lng['serversettings']['perl_server'],
|
||||
@@ -51,6 +54,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'default' => 'unix:/var/run/nginx/cgiwrap-dispatch.sock',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -474,7 +474,12 @@ if($page == 'customers'
|
||||
|
||||
$createstdsubdomain = intval($_POST['createstdsubdomain']);
|
||||
$password = validate($_POST['new_customer_password'], 'password');
|
||||
$password = validatePassword($password);
|
||||
// only check if not empty,
|
||||
// cause empty == generate password automatically
|
||||
if($password != '')
|
||||
{
|
||||
$password = validatePassword($password);
|
||||
}
|
||||
$sendpassword = intval($_POST['sendpassword']);
|
||||
$phpenabled = intval($_POST['phpenabled']);
|
||||
$perlenabled = intval($_POST['perlenabled']);
|
||||
|
||||
@@ -195,7 +195,7 @@ elseif($page == 'accounts')
|
||||
$result = $db->query("SELECT `bytes_in_used` FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name` = '" . $userinfo['loginname'] . "'");
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$db->query("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $db->escape($username) . "', 'user', '" . $db->escape($row[bytes_in_used]) . "', '0', '0', '0', '0', '0')");
|
||||
$db->query("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $db->escape($username) . "', 'user', '" . $db->escape($row['bytes_in_used']) . "', '0', '0', '0', '0', '0')");
|
||||
}
|
||||
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=CONCAT_WS(',',`members`,'" . $db->escape($username) . "') WHERE `customerid`='" . $userinfo['customerid'] . "' AND `gid`='" . (int)$userinfo['guid'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`+1, `ftp_lastaccountnumber`=`ftp_lastaccountnumber`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
|
||||
@@ -336,7 +336,7 @@ if($action == 'forgotpwd')
|
||||
try {
|
||||
$mail->Subject = $mail_subject;
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML(str_replace("\\n", "<br />", $mail_body));
|
||||
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||
$mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
|
||||
$mail->Send();
|
||||
} catch(phpmailerException $e) {
|
||||
|
||||
@@ -15,7 +15,7 @@ CREATE TABLE `ftp_groups` (
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `groupname` (`groupname`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `ftp_groups`
|
||||
@@ -48,7 +48,7 @@ CREATE TABLE `ftp_users` (
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `ftp_users`
|
||||
@@ -80,7 +80,7 @@ CREATE TABLE `mail_users` (
|
||||
`imap` tinyint(1) NOT NULL default '1',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `email` (`email`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `mail_users`
|
||||
@@ -105,7 +105,7 @@ CREATE TABLE `mail_virtual` (
|
||||
`iscatchall` tinyint(1) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `email` (`email`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `mail_virtual`
|
||||
@@ -168,7 +168,7 @@ CREATE TABLE `panel_admins` (
|
||||
`email_autoresponder_used` int(5) NOT NULL default '0',
|
||||
PRIMARY KEY (`adminid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
@@ -234,7 +234,7 @@ CREATE TABLE `panel_customers` (
|
||||
`email_autoresponder_used` int(5) NOT NULL default '0',
|
||||
PRIMARY KEY (`customerid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
#
|
||||
# Dumping data for table `panel_customers`
|
||||
#
|
||||
@@ -256,7 +256,7 @@ CREATE TABLE `panel_databases` (
|
||||
`apsdb` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_databases`
|
||||
@@ -310,7 +310,7 @@ CREATE TABLE `panel_domains` (
|
||||
KEY `customerid` (`customerid`),
|
||||
KEY `parentdomain` (`parentdomainid`),
|
||||
KEY `domain` (`domain`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_domains`
|
||||
@@ -340,7 +340,7 @@ CREATE TABLE `panel_ipsandports` (
|
||||
`ssl_cert_chainfile` varchar(255) NOT NULL,
|
||||
`docroot` varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_ipsandports`
|
||||
@@ -366,7 +366,7 @@ CREATE TABLE `panel_htaccess` (
|
||||
`error401path` varchar(255) NOT NULL default '',
|
||||
`options_cgi` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_htaccess`
|
||||
@@ -389,7 +389,7 @@ CREATE TABLE `panel_htpasswds` (
|
||||
`authname` varchar(255) NOT NULL default 'Restricted Area',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_htpasswds`
|
||||
@@ -435,7 +435,7 @@ CREATE TABLE `panel_settings` (
|
||||
`varname` varchar(255) NOT NULL default '',
|
||||
`value` text NOT NULL,
|
||||
PRIMARY KEY (`settingid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
@@ -462,7 +462,7 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (18, 'system', 'vmail_homedir', '/var/customers/mail/');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (19, 'system', 'bindconf_directory', '/etc/bind/');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (20, 'system', 'bindreload_command', '/etc/init.d/bind9 reload');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.15');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.16');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', 'SERVERNAME');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');
|
||||
@@ -597,6 +597,20 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (156, 'system', 'nginx_php_backend', '127.0.0.1:8888');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (157, 'system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (158, 'system', 'phpreload_command', '');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (159, 'phpfpm', 'enabled', '0');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (160, 'phpfpm', 'configdir', '/etc/php-fpm.d/');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (161, 'phpfpm', 'reload', '/etc/init.d/php-fpm restart');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (162, 'phpfpm', 'pm', 'static');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (163, 'phpfpm', 'max_children', '1');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (164, 'phpfpm', 'start_servers', '20');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (165, 'phpfpm', 'min_spare_servers', '5');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (166, 'phpfpm', 'max_spare_servers', '35');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (167, 'phpfpm', 'max_requests', '0');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (168, 'phpfpm', 'tmpdir', '/var/customers/tmp/');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (169, 'phpfpm', 'peardir', '/usr/share/php/:/usr/share/php5/');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (170, 'phpfpm', 'enabled_ownvhost', '0');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (171, 'phpfpm', 'vhost_httpuser', 'froxlorlocal');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (172, 'phpfpm', 'vhost_httpgroup', 'froxlorlocal');
|
||||
|
||||
# --------------------------------------------------------
|
||||
|
||||
@@ -610,7 +624,7 @@ CREATE TABLE `panel_tasks` (
|
||||
`type` int(11) NOT NULL default '0',
|
||||
`data` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_tasks`
|
||||
@@ -633,7 +647,7 @@ CREATE TABLE `panel_templates` (
|
||||
`value` longtext NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY adminid (adminid)
|
||||
) TYPE=MyISAM;
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_templates`
|
||||
@@ -660,7 +674,7 @@ CREATE TABLE `panel_traffic` (
|
||||
`mail` bigint(30) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_traffic`
|
||||
@@ -687,7 +701,7 @@ CREATE TABLE `panel_traffic_admins` (
|
||||
`mail` bigint(30) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `adminid` (`adminid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_traffic_admins`
|
||||
@@ -713,7 +727,7 @@ CREATE TABLE `panel_diskspace` (
|
||||
`mysql` bigint(30) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_diskspace`
|
||||
@@ -738,7 +752,7 @@ CREATE TABLE `panel_diskspace_admins` (
|
||||
`mysql` bigint(30) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `adminid` (`adminid`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_diskspace_admins`
|
||||
@@ -756,7 +770,7 @@ CREATE TABLE `panel_languages` (
|
||||
`language` varchar(30) NOT NULL default '',
|
||||
`file` varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM ;
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
#
|
||||
# Dumping data for table `panel_languages`
|
||||
|
||||
@@ -212,6 +212,20 @@ function requirement_checks()
|
||||
{
|
||||
status_message('green', 'OK');
|
||||
}
|
||||
|
||||
status_message('begin', $lng['install']['phpxml']);
|
||||
|
||||
if(!extension_loaded('xml'))
|
||||
{
|
||||
status_message('red', $lng['install']['notinstalled']);
|
||||
$_die = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
status_message('green', 'OK');
|
||||
}
|
||||
|
||||
|
||||
|
||||
status_message('begin', $lng['install']['phpfilter']);
|
||||
|
||||
|
||||
@@ -97,5 +97,5 @@ $lng['install']['froxlor_succ_checks'] = 'All requirements are satisfied';
|
||||
$lng['install']['phpmagic_quotes_runtime'] = 'Checking whether magic_quotes_runtime is off';
|
||||
$lng['install']['active'] = 'no';
|
||||
$lng['install']['phpmagic_quotes_runtime_description'] = 'PHP setting "magic_quotes_runtime" must be set to "Off" in order to avoid strange behavior of Froxlor. Disabling it for now (this is only temporary, please fix our php.ini).';
|
||||
|
||||
$lng['install']['phpxml'] = 'Testing if PHP XML-extension is installed...';
|
||||
?>
|
||||
|
||||
@@ -68,4 +68,5 @@ $lng['install']['httpgroup'] = 'Nom du la group du HTTP';
|
||||
|
||||
$lng['install']['webserver'] = 'Version du serveur';
|
||||
|
||||
$lng['install']['phpxml'] = 'Tester si PHP XML-extension est install<6C>e...';
|
||||
?>
|
||||
|
||||
@@ -97,5 +97,5 @@ $lng['install']['froxlor_succ_checks'] = 'Alle Vorraussetzungen sind erfüll
|
||||
$lng['install']['phpmagic_quotes_runtime'] = 'Prüfe ob magic_quotes_runtime ausgeschalten ist';
|
||||
$lng['install']['active'] = 'nein';
|
||||
$lng['install']['phpmagic_quotes_runtime_description'] = 'Die PHP Einstellung "magic_quotes_runtime" muss deaktiviert sein ("Off"), um merkwürdige Verhalten von Froxlor zu umgehen. Sie wurde deaktiviert (nur temporär, bitte php.ini anpassen).';
|
||||
|
||||
$lng['install']['phpxml'] = 'Teste, ob die PHP XML-Erweiterung installiert ist...';
|
||||
?>
|
||||
|
||||
@@ -937,7 +937,7 @@ if(isFroxlorVersion('0.9.11'))
|
||||
|
||||
$update_fcgid_ownvhost = isset($_POST['update_fcgid_ownvhost']) ? (int)$_POST['update_fcgid_ownvhost'] : '0';
|
||||
$update_fcgid_httpuser = isset($_POST['update_fcgid_httpuser']) ? $_POST['update_fcgid_httpuser'] : 'froxlorlocal';
|
||||
$update_fcgid_httpgroup = isset($_POST['update_fcgid_ownvhost']) ? $_POST['update_fcgid_ownvhost'] : 'froxlorlocal';
|
||||
$update_fcgid_httpgroup = isset($_POST['update_fcgid_httpgroup']) ? $_POST['update_fcgid_httpgroup'] : 'froxlorlocal';
|
||||
|
||||
if($update_fcgid_httpuser == '') {
|
||||
$update_fcgid_httpuser = 'froxlorlocal';
|
||||
@@ -1258,6 +1258,7 @@ if(isFroxlorVersion('0.9.14'))
|
||||
$db->query("INSERT INTO `".TABLE_PANEL_SETTINGS."` (`settinggroup`, `varname`, `value`) VALUES ('system', 'nginx_php_backend', '127.0.0.1:8888')");
|
||||
$db->query("INSERT INTO `".TABLE_PANEL_SETTINGS."` (`settinggroup`, `varname`, `value`) VALUES ('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock')");
|
||||
$db->query("INSERT INTO `".TABLE_PANEL_SETTINGS."` (`settinggroup`, `varname`, `value`) VALUES ('system', 'phpreload_command', '')");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.15-svn1');
|
||||
}
|
||||
@@ -1269,3 +1270,86 @@ if(isFroxlorVersion('0.9.15-svn1'))
|
||||
|
||||
updateToVersion('0.9.15');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.15'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.15 to 0.9.16-svn1", false);
|
||||
|
||||
$update_phpfpm_enabled = isset($_POST['update_phpfpm_enabled']) ? (int)$_POST['update_phpfpm_enabled'] : '0';
|
||||
$update_phpfpm_configdir = isset($_POST['update_phpfpm_configdir']) ? makeCorrectDir($_POST['update_phpfpm_configdir']) : '/etc/php-fpm.d/';
|
||||
$update_phpfpm_tmpdir = isset($_POST['update_phpfpm_tmpdir']) ? makeCorrectDir($_POST['update_phpfpm_tmpdir']) : '/var/customers/tmp';
|
||||
$update_phpfpm_peardir = isset($_POST['update_phpfpm_peardir']) ? makeCorrectDir($_POST['update_phpfpm_peardir']) : '/usr/share/php/:/usr/share/php5/';
|
||||
$update_phpfpm_reload = isset($_POST['update_phpfpm_reload']) ? $_POST['update_phpfpm_reload'] : '/etc/init.d/php-fpm restart';
|
||||
|
||||
$update_phpfpm_pm = isset($_POST['update_phpfpm_pm']) ? $_POST['update_phpfpm_pm'] : 'static';
|
||||
$update_phpfpm_max_children = isset($_POST['update_phpfpm_max_children']) ? (int)$_POST['update_phpfpm_max_children'] : '1';
|
||||
$update_phpfpm_max_requests = isset($_POST['update_phpfpm_max_requests']) ? (int)$_POST['update_phpfpm_max_requests'] : '0';
|
||||
|
||||
if($update_phpfpm_pm == 'dynamic')
|
||||
{
|
||||
$update_phpfpm_start_servers = isset($_POST['update_phpfpm_start_servers']) ? (int)$_POST['update_phpfpm_start_servers'] : '20';
|
||||
$update_phpfpm_min_spare_servers = isset($_POST['update_phpfpm_min_spare_servers']) ? (int)$_POST['update_phpfpm_min_spare_servers'] : '5';
|
||||
$update_phpfpm_max_spare_servers = isset($_POST['update_phpfpm_max_spare_servers']) ? (int)$_POST['update_phpfpm_max_spare_servers'] : '35';
|
||||
}
|
||||
else
|
||||
{
|
||||
$update_phpfpm_start_servers = 20;
|
||||
$update_phpfpm_min_spare_servers = 5;
|
||||
$update_phpfpm_max_spare_servers = 35;
|
||||
}
|
||||
|
||||
if($update_phpfpm_configdir == '') {
|
||||
$update_phpfpm_configdir = '/etc/php-fpm.d/';
|
||||
}
|
||||
if($update_phpfpm_reload == '') {
|
||||
$update_phpfpm_reload = '/etc/init.d/php-fpm restart';
|
||||
}
|
||||
|
||||
showUpdateStep("Adding new settings for PHP-FPM #1");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'enabled', '".(int)$update_phpfpm_enabled."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'configdir', '".$db->escape($update_phpfpm_configdir)."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'reload', '".$db->escape($update_phpfpm_reload)."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'pm', '".$db->escape($update_phpfpm_pm)."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'max_children', '".(int)$update_phpfpm_max_children."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'max_requests', '".(int)$update_phpfpm_max_requests."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'start_servers', '".(int)$update_phpfpm_start_servers."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'min_spare_servers', '".(int)$update_phpfpm_min_spare_servers."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'max_spare_servers', '".(int)$update_phpfpm_max_spare_servers."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'tmpdir', '".$db->escape($update_phpfpm_tmpdir)."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'peardir', '".$db->escape($update_phpfpm_peardir)."');");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.16-svn1');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.16-svn1'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.16-svn1 to 0.9.16-svn2", false);
|
||||
|
||||
$update_phpfpm_enabled_ownvhost = isset($_POST['update_phpfpm_enabled_ownvhost']) ? (int)$_POST['update_phpfpm_enabled_ownvhost'] : '0';
|
||||
$update_phpfpm_httpuser = isset($_POST['update_phpfpm_httpuser']) ? $_POST['update_phpfpm_httpuser'] : 'froxlorlocal';
|
||||
$update_phpfpm_httpgroup = isset($_POST['update_phpfpm_httpgroup']) ? $_POST['update_phpfpm_httpgroup'] : 'froxlorlocal';
|
||||
|
||||
if($update_phpfpm_httpuser == '') {
|
||||
$update_phpfpm_httpuser = 'froxlorlocal';
|
||||
}
|
||||
if($update_phpfpm_httpgroup == '') {
|
||||
$update_phpfpm_httpgroup = 'froxlorlocal';
|
||||
}
|
||||
|
||||
showUpdateStep("Adding new settings for PHP-FPM #2");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'enabled_ownvhost', '".(int)$update_phpfpm_enabled_ownvhost."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'vhost_httpuser', '".$db->escape($update_phpfpm_httpuser)."');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'vhost_httpgroup', '".$db->escape($update_phpfpm_httpgroup)."');");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.16-svn2');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.16-svn2'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.16-svn2 to 0.9.16 final");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.16');
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$question.= 'Local user: ';
|
||||
$question.= '<input type="text" class="text" name="update_fcgid_httpuser" value="froxlorlocal" /><br /><br />';
|
||||
$question.= 'Local group: ';
|
||||
$question.= '<input type="text" class="text" name="update_fcgid_ownvhost" value="froxlorlocal" /><br />';
|
||||
$question.= '<input type="text" class="text" name="update_fcgid_httpgroup" value="froxlorlocal" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
@@ -351,4 +351,54 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$question = '';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.16-svn1'))
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now features support for php-fpm.';
|
||||
$question = '<strong>Do you want to enable php-fpm?:</strong> ';
|
||||
$question.= makeyesno('update_phpfpm_enabled', '1', '0', '0').'<br /><br />';
|
||||
$question.= 'If \'yes\', please specify the configuration directory: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_configdir" value="/etc/php-fpm.d/" /><br /><br />';
|
||||
$question.= 'Please specify the temporary files directory: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_tmpdir" value="/var/customers/tmp/" /><br /><br />';
|
||||
$question.= 'Please specify the PEAR directory: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_peardir" value="/usr/share/php/:/usr/share/php5/" /><br /><br />';
|
||||
$question.= 'Please specify the php-fpm restart-command: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_reload" value="/etc/init.d/php-fpm restart" /><br /><br />';
|
||||
$question.= 'Please specify the php-fpm rocess manager control: ';
|
||||
$question.= '<select name="update_phpfpm_pm">';
|
||||
$redirects = makeoption('static', 'static', 'static');
|
||||
$redirects.= makeoption('dynamic', 'dynamic', 'static');
|
||||
$question .= $redirects.'</select><br /><br />';
|
||||
$question.= 'Please specify the number of child processes: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_max_children" value="1" /><br /><br />';
|
||||
$question.= 'Please specify the number of requests per child before respawning: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_max_requests" value="0" /><br /><br />';
|
||||
$question.= '<em>The following settings are only required if you chose process manager = dynamic</em><br /><br />';
|
||||
$question.= 'Please specify the number of child processes created on startup: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_start_servers" value="20" /><br /><br />';
|
||||
$question.= 'Please specify the desired minimum number of idle server processes: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_min_spare_servers" value="5" /><br /><br />';
|
||||
$question.= 'Please specify the desired maximum number of idle server processes: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_max_spare_servers" value="35" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.16-svn2'))
|
||||
{
|
||||
if((int)$settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want Froxlor to use PHP-FPM itself too now.';
|
||||
$question = '<strong>Use PHP-FPM for the Froxlor Panel?:</strong> ';
|
||||
$question.= makeyesno('update_phpfpm_enabled_ownvhost', '1', '0', '0').'<br /><br />';
|
||||
$question.= '<strong>If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):</strong><br /><br />';
|
||||
$question.= 'Local user: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_httpuser" value="'.$settings['system']['mod_fcgid_httpuser'].'" /><br /><br />';
|
||||
$question.= 'Local group: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_httpgroup" value="'.$settings['system']['mod_fcgid_httpgroup'].'" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ if($settings['panel']['version'] == '1.0.10')
|
||||
// Adding tables
|
||||
|
||||
$db->query("DROP TABLE IF EXISTS `" . TABLE_PANEL_HTACCESS . "`;");
|
||||
$db->query("CREATE TABLE `" . TABLE_PANEL_HTACCESS . "` (" . " `id` int(11) unsigned NOT NULL auto_increment," . " `customerid` int(11) unsigned NOT NULL default '0'," . " `path` varchar(255) NOT NULL default ''," . " `options_indexes` tinyint(1) NOT NULL default '0'," . " PRIMARY KEY (`id`)" . ") TYPE=MyISAM ;");
|
||||
$db->query("CREATE TABLE `" . TABLE_PANEL_HTACCESS . "` (" . " `id` int(11) unsigned NOT NULL auto_increment," . " `customerid` int(11) unsigned NOT NULL default '0'," . " `path` varchar(255) NOT NULL default ''," . " `options_indexes` tinyint(1) NOT NULL default '0'," . " PRIMARY KEY (`id`)" . ") ENGINE=MyISAM ;");
|
||||
$db->query("DROP TABLE IF EXISTS `" . TABLE_PANEL_ADMINS . "`;");
|
||||
$db->query("CREATE TABLE `" . TABLE_PANEL_ADMINS . "` (" . " `adminid` int(11) unsigned NOT NULL auto_increment," . " `loginname` varchar(50) NOT NULL default ''," . " `password` varchar(50) NOT NULL default ''," . " `name` varchar(255) NOT NULL default ''," . " `email` varchar(255) NOT NULL default ''," . " `customers` int(15) NOT NULL default '0'," . " `customers_used` int(15) NOT NULL default '0'," . " `customers_see_all` tinyint(1) NOT NULL default '0'," . " `domains` int(15) NOT NULL default '0'," . " `domains_used` int(15) NOT NULL default '0'," . " `domains_see_all` tinyint(1) NOT NULL default '0'," . " `change_serversettings` tinyint(1) NOT NULL default '0'," . " `diskspace` int(15) NOT NULL default '0'," . " `diskspace_used` int(15) NOT NULL default '0'," . " `mysqls` int(15) NOT NULL default '0'," . " `mysqls_used` int(15) NOT NULL default '0'," . " `emails` int(15) NOT NULL default '0'," . " `emails_used` int(15) NOT NULL default '0'," . " `email_forwarders` int(15) NOT NULL default '0'," . " `email_forwarders_used` int(15) NOT NULL default '0'," . " `ftps` int(15) NOT NULL default '0'," . " `ftps_used` int(15) NOT NULL default '0'," . " `subdomains` int(15) NOT NULL default '0'," . " `subdomains_used` int(15) NOT NULL default '0'," . " `traffic` int(15) NOT NULL default '0'," . " `traffic_used` int(15) NOT NULL default '0'," . " `deactivated` tinyint(1) NOT NULL default '0'," . " `lastlogin_succ` int(11) unsigned NOT NULL default '0'," . " `lastlogin_fail` int(11) unsigned NOT NULL default '0'," . " `loginfail_count` int(11) unsigned NOT NULL default '0'," . " PRIMARY KEY (`adminid`)" . ") TYPE=MyISAM ;");
|
||||
$db->query("CREATE TABLE `" . TABLE_PANEL_ADMINS . "` (" . " `adminid` int(11) unsigned NOT NULL auto_increment," . " `loginname` varchar(50) NOT NULL default ''," . " `password` varchar(50) NOT NULL default ''," . " `name` varchar(255) NOT NULL default ''," . " `email` varchar(255) NOT NULL default ''," . " `customers` int(15) NOT NULL default '0'," . " `customers_used` int(15) NOT NULL default '0'," . " `customers_see_all` tinyint(1) NOT NULL default '0'," . " `domains` int(15) NOT NULL default '0'," . " `domains_used` int(15) NOT NULL default '0'," . " `domains_see_all` tinyint(1) NOT NULL default '0'," . " `change_serversettings` tinyint(1) NOT NULL default '0'," . " `diskspace` int(15) NOT NULL default '0'," . " `diskspace_used` int(15) NOT NULL default '0'," . " `mysqls` int(15) NOT NULL default '0'," . " `mysqls_used` int(15) NOT NULL default '0'," . " `emails` int(15) NOT NULL default '0'," . " `emails_used` int(15) NOT NULL default '0'," . " `email_forwarders` int(15) NOT NULL default '0'," . " `email_forwarders_used` int(15) NOT NULL default '0'," . " `ftps` int(15) NOT NULL default '0'," . " `ftps_used` int(15) NOT NULL default '0'," . " `subdomains` int(15) NOT NULL default '0'," . " `subdomains_used` int(15) NOT NULL default '0'," . " `traffic` int(15) NOT NULL default '0'," . " `traffic_used` int(15) NOT NULL default '0'," . " `deactivated` tinyint(1) NOT NULL default '0'," . " `lastlogin_succ` int(11) unsigned NOT NULL default '0'," . " `lastlogin_fail` int(11) unsigned NOT NULL default '0'," . " `loginfail_count` int(11) unsigned NOT NULL default '0'," . " PRIMARY KEY (`adminid`)" . ") ENGINE=MyISAM ;");
|
||||
|
||||
// Insert Admin user
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ if($settings['panel']['version'] == '1.2.2-cvs1')
|
||||
`language` varchar(30) NOT NULL default '',
|
||||
`file` varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM
|
||||
) ENGINE=MyISAM
|
||||
");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_LANGUAGE . "` (`id`, `language`, `file`) VALUES (1, 'Deutsch', 'lng/german.lng.php');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_LANGUAGE . "` (`id`, `language`, `file`) VALUES (2, 'English', 'lng/english.lng.php');");
|
||||
@@ -88,7 +88,7 @@ if($settings['panel']['version'] == '1.2.2-cvs3')
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`file` varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM
|
||||
) ENGINE=MyISAM
|
||||
");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_CRONSCRIPT . "` (`id`, `file`) VALUES (1, 'cron_traffic.php');");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_CRONSCRIPT . "` (`id`, `file`) VALUES (2, 'cron_tasks.php');");
|
||||
@@ -146,7 +146,7 @@ if($settings['panel']['version'] == '1.2.3-cvs4')
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `adminid` (`adminid`),
|
||||
UNIQUE `date` (`adminid` , `year` , `month` , `day`)
|
||||
) TYPE=MyISAM
|
||||
) ENGINE=MyISAM
|
||||
");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.2.3-cvs5' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.2.3-cvs5';
|
||||
@@ -267,7 +267,7 @@ if($settings['panel']['version'] == '1.2.6')
|
||||
`value` longtext NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `adminid` (`adminid`)
|
||||
) TYPE=MyISAM
|
||||
) ENGINE=MyISAM
|
||||
');
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.2.6-cvs1' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.2.6-cvs1';
|
||||
@@ -458,7 +458,7 @@ if($settings['panel']['version'] == '1.2.12-svn1')
|
||||
`port` int(5) NOT NULL default \'80\',
|
||||
`default` int(1) NOT NULL default \'0\',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM');
|
||||
) ENGINE=MyISAM');
|
||||
$db->query('INSERT INTO `' . TABLE_PANEL_IPSANDPORTS . '` (`ip`, `port`, `default`) VALUES (\'' . $settings['system']['ipaddress'] . '\', \'80\', \'1\')');
|
||||
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = \'1.2.12-svn2\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'');
|
||||
$settings['panel']['version'] = '1.2.12-svn2';
|
||||
|
||||
@@ -620,7 +620,7 @@ else
|
||||
`mysql` bigint(30) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) TYPE=MyISAM ;");
|
||||
) ENGINE=MyISAM ;");
|
||||
$db->query("CREATE TABLE `" . TABLE_PANEL_DISKSPACE_ADMINS . "` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`adminid` int(11) unsigned NOT NULL default '0',
|
||||
@@ -633,7 +633,7 @@ else
|
||||
`mysql` bigint(30) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `adminid` (`adminid`)
|
||||
) TYPE=MyISAM ;");
|
||||
) ENGINE=MyISAM ;");
|
||||
$db->query("INSERT INTO `" . TABLE_BILLING_SERVICE_CATEGORIES . "` (`id`, `category_name`, `category_order`, `category_classname`, `category_classfile`, `category_cachefield`, `category_caption`, `category_rowcaption_setup`, `category_rowcaption_interval`) VALUES (1, 'hosting', 10, 'hosting', 'lib/billing_class_hosting.php', 'invoice_fee_hosting', 'hosting_caption', 'hosting_rowcaption_setup', 'hosting_rowcaption_interval');");
|
||||
$db->query("INSERT INTO `" . TABLE_BILLING_SERVICE_CATEGORIES . "` (`id`, `category_name`, `category_order`, `category_classname`, `category_classfile`, `category_cachefield`, `category_caption`, `category_rowcaption_setup`, `category_rowcaption_interval`) VALUES (2, 'domains', 20, 'domains', 'lib/billing_class_domains.php', 'invoice_fee_domains', 'domains_caption', 'domains_rowcaption_setup', 'domains_rowcaption_interval');");
|
||||
$db->query("INSERT INTO `" . TABLE_BILLING_SERVICE_CATEGORIES . "` (`id`, `category_name`, `category_order`, `category_classname`, `category_classfile`, `category_cachefield`, `category_caption`, `category_rowcaption_setup`, `category_rowcaption_interval`) VALUES (3, 'traffic', 30, 'traffic', 'lib/billing_class_traffic.php', 'invoice_fee_traffic', 'traffic_caption', 'traffic_rowcaption_setup', 'traffic_rowcaption_interval');");
|
||||
|
||||
121
lib/classes/phpinterface/class.phpinterface.php
Normal file
121
lib/classes/phpinterface/class.phpinterface.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
* @version $Id$
|
||||
* @link http://www.nutime.de/
|
||||
* @since 0.9.16
|
||||
*
|
||||
*/
|
||||
|
||||
class phpinterface
|
||||
{
|
||||
/**
|
||||
* Database handler
|
||||
* @var object
|
||||
*/
|
||||
private $_db = false;
|
||||
|
||||
/**
|
||||
* Settings array
|
||||
* @var array
|
||||
*/
|
||||
private $_settings = array();
|
||||
|
||||
/**
|
||||
* Domain-Data array
|
||||
* @var array
|
||||
*/
|
||||
private $_domain = array();
|
||||
|
||||
/**
|
||||
* Interface object
|
||||
* @var object
|
||||
*/
|
||||
private $_interface = null;
|
||||
|
||||
/**
|
||||
* Admin-User data array
|
||||
* @var array
|
||||
*/
|
||||
private $_admin_cache = array();
|
||||
|
||||
/**
|
||||
* main constructor
|
||||
*/
|
||||
public function __construct($db, $settings, $domain)
|
||||
{
|
||||
$this->_db = $db;
|
||||
$this->_settings = $settings;
|
||||
$this->_domain = $domain;
|
||||
$this->_setInterface();
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the interface-object
|
||||
* from where we can control it
|
||||
*/
|
||||
public function getInterface()
|
||||
{
|
||||
return $this->_interface;
|
||||
}
|
||||
|
||||
/**
|
||||
* set interface-object by type of
|
||||
* php-interface: fcgid or php-fpm
|
||||
* sets private $_interface variable
|
||||
*/
|
||||
private function _setInterface()
|
||||
{
|
||||
// php-fpm
|
||||
if((int)$this->_settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$this->_interface = new phpinterface_fpm($this->_db, $this->_settings, $this->_domain);
|
||||
}
|
||||
elseif((int)$this->_settings['system']['mod_fcgid'] == 1)
|
||||
{
|
||||
$this->_interface = new phpinterface_fcgid($this->_db, $this->_settings, $this->_domain);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return the php-configuration from the database
|
||||
*
|
||||
* @param int $php_config_id id of the php-configuration
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPhpConfig($php_config_id)
|
||||
{
|
||||
$php_config_id = intval($php_config_id);
|
||||
|
||||
// If domain has no config, we will use the default one.
|
||||
|
||||
if($php_config_id == 0)
|
||||
{
|
||||
$php_config_id = 1;
|
||||
}
|
||||
|
||||
if(!isset($this->php_configs_cache[$php_config_id]))
|
||||
{
|
||||
$this->_php_configs_cache[$php_config_id] = $this->_db->query_first(
|
||||
"SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`
|
||||
WHERE `id` = " . (int)$php_config_id
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_php_configs_cache[$php_config_id];
|
||||
}
|
||||
|
||||
}
|
||||
291
lib/classes/phpinterface/class.phpinterface_fcgid.php
Normal file
291
lib/classes/phpinterface/class.phpinterface_fcgid.php
Normal file
@@ -0,0 +1,291 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
* @version $Id$
|
||||
* @link http://www.nutime.de/
|
||||
* @since 0.9.16
|
||||
*
|
||||
*/
|
||||
|
||||
class phpinterface_fcgid
|
||||
{
|
||||
/**
|
||||
* Database handler
|
||||
* @var object
|
||||
*/
|
||||
private $_db = false;
|
||||
|
||||
/**
|
||||
* Settings array
|
||||
* @var array
|
||||
*/
|
||||
private $_settings = array();
|
||||
|
||||
/**
|
||||
* Domain-Data array
|
||||
* @var array
|
||||
*/
|
||||
private $_domain = array();
|
||||
|
||||
/**
|
||||
* Admin-Date cache array
|
||||
* @var array
|
||||
*/
|
||||
private $_admin_cache = array();
|
||||
|
||||
/**
|
||||
* main constructor
|
||||
*/
|
||||
public function __construct($db, $settings, $domain)
|
||||
{
|
||||
$this->_db = $db;
|
||||
$this->_settings = $settings;
|
||||
$this->_domain = $domain;
|
||||
}
|
||||
|
||||
public function createConfig($phpconfig)
|
||||
{
|
||||
// create starter
|
||||
$starter_file = "#!/bin/sh\n\n";
|
||||
$starter_file.= "#\n";
|
||||
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $this->_domain['domain'] . "' with id #" . $this->_domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
|
||||
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$starter_file.= "#\n\n";
|
||||
$starter_file.= "umask 022\n";
|
||||
$starter_file.= "PHPRC=" . escapeshellarg($this->getConfigDir()) . "\n";
|
||||
$starter_file.= "export PHPRC\n";
|
||||
|
||||
// set number of processes for one domain
|
||||
if((int)$this->_domain['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$$this->_domain['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$phpconfig['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$this->_settings['system']['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$starter_file.= "export PHP_FCGI_CHILDREN\n";
|
||||
|
||||
// set number of maximum requests for one domain
|
||||
if((int)$this->_domain['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$this->_domain['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$phpconfig['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$this->_settings['system']['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$starter_file.= "export PHP_FCGI_MAX_REQUESTS\n";
|
||||
|
||||
// Set Binary
|
||||
$starter_file.= "exec " . $phpconfig['binary'] . " -c " . escapeshellarg($this->getConfigDir()) . "\n";
|
||||
|
||||
//remove +i attibute, so starter can be overwritten
|
||||
if(file_exists($this->getStarterFile()))
|
||||
{
|
||||
removeImmutable($this->getStarterFile());
|
||||
}
|
||||
|
||||
$starter_file_handler = fopen($this->getStarterFile(), 'w');
|
||||
fwrite($starter_file_handler, $starter_file);
|
||||
fclose($starter_file_handler);
|
||||
safe_exec('chmod 750 ' . escapeshellarg($this->getStarterFile()));
|
||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($this->getStarterFile()));
|
||||
setImmutable($this->getStarterFile());
|
||||
}
|
||||
|
||||
public function createIniFile($phpconfig)
|
||||
{
|
||||
$openbasedir = '';
|
||||
$openbasedirc = ';';
|
||||
|
||||
if($this->_domain['openbasedir'] == '1')
|
||||
{
|
||||
$openbasedirc = '';
|
||||
$_phpappendopenbasedir = '';
|
||||
|
||||
$_custom_openbasedir = explode(':', $this->_settings['system']['mod_fcgid_peardir']);
|
||||
foreach($_custom_openbasedir as $cobd)
|
||||
{
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
$_custom_openbasedir = explode(':', $this->_settings['system']['phpappendopenbasedir']);
|
||||
foreach($_custom_openbasedir as $cobd)
|
||||
{
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
if($this->_domain['openbasedir_path'] == '0' && strstr($this->_domain['documentroot'], ":") === false)
|
||||
{
|
||||
$openbasedir = appendOpenBasedirPath($this->_domain['documentroot'], true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$openbasedir = appendOpenBasedirPath($this->_domain['customerroot'], true);
|
||||
}
|
||||
|
||||
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
||||
$openbasedir .= $_phpappendopenbasedir;
|
||||
|
||||
$openbasedir = explode(':', $openbasedir);
|
||||
$clean_openbasedir = array();
|
||||
foreach($openbasedir as $number => $path)
|
||||
{
|
||||
if(trim($path) != '/')
|
||||
{
|
||||
$clean_openbasedir[] = makeCorrectDir($path);
|
||||
}
|
||||
}
|
||||
$openbasedir = implode(':', $clean_openbasedir);
|
||||
}
|
||||
else
|
||||
{
|
||||
$openbasedir = 'none';
|
||||
$openbasedirc = ';';
|
||||
}
|
||||
|
||||
$admin = $this->_getAdminData($this->_domain['adminid']);
|
||||
$php_ini_variables = array(
|
||||
'SAFE_MODE' => ($this->_domain['safemode'] == '0' ? 'Off' : 'On'),
|
||||
'PEAR_DIR' => $this->_settings['system']['mod_fcgid_peardir'],
|
||||
'OPEN_BASEDIR' => $openbasedir,
|
||||
'OPEN_BASEDIR_C' => $openbasedirc,
|
||||
'OPEN_BASEDIR_GLOBAL' => $this->_settings['system']['phpappendopenbasedir'],
|
||||
'TMP_DIR' => $this->getTempDir(),
|
||||
'CUSTOMER_EMAIL' => $this->_domain['email'],
|
||||
'ADMIN_EMAIL' => $admin['email'],
|
||||
'DOMAIN' => $this->_domain['domain'],
|
||||
'CUSTOMER' => $this->_domain['loginname'],
|
||||
'ADMIN' => $admin['loginname']
|
||||
);
|
||||
|
||||
//insert a small header for the file
|
||||
|
||||
$phpini_file = ";\n";
|
||||
$phpini_file.= "; php.ini created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $this->_domain['domain'] . "' with id #" . $this->_domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
|
||||
$phpini_file.= "; Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$phpini_file.= ";\n\n";
|
||||
$phpini_file.= replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_file = str_replace('"none"', 'none', $phpini_file);
|
||||
$phpini_file = preg_replace('/\"+/', '"', $phpini_file);
|
||||
$phpini_file_handler = fopen($this->getIniFile(), 'w');
|
||||
fwrite($phpini_file_handler, $phpini_file);
|
||||
fclose($phpini_file_handler);
|
||||
safe_exec('chown root:0 ' . escapeshellarg($this->getIniFile()));
|
||||
safe_exec('chmod 0644 ' . escapeshellarg($this->getIniFile()));
|
||||
}
|
||||
|
||||
/**
|
||||
* fcgid-config directory
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @return string the directory
|
||||
*/
|
||||
public function getConfigDir($createifnotexists = true)
|
||||
{
|
||||
$configdir = makeCorrectDir($this->_settings['system']['mod_fcgid_configdir'] . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
||||
|
||||
if(!is_dir($configdir) && $createifnotexists)
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||
}
|
||||
|
||||
return $configdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* fcgid-temp directory
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @return string the directory
|
||||
*/
|
||||
public function getTempDir($createifnotexists = true)
|
||||
{
|
||||
$tmpdir = makeCorrectDir($this->_settings['system']['mod_fcgid_tmpdir'] . '/' . $this->_domain['loginname'] . '/');
|
||||
|
||||
if(!is_dir($tmpdir) && $createifnotexists)
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||
}
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* return path of php-starter file
|
||||
*
|
||||
* @return string the directory
|
||||
*/
|
||||
public function getStarterFile()
|
||||
{
|
||||
$starter_filename = makeCorrectFile($this->getConfigDir() . '/php-fcgi-starter');
|
||||
return $starter_filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* return path of php.ini file
|
||||
*
|
||||
* @return string full with path file-name
|
||||
*/
|
||||
public function getIniFile()
|
||||
{
|
||||
$phpini_filename = makeCorrectFile($this->getConfigDir() . '/php.ini');
|
||||
return $phpini_filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* return the admin-data of a specific admin
|
||||
*
|
||||
* @param int $adminid id of the admin-user
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _getAdminData($adminid)
|
||||
{
|
||||
$adminid = intval($adminid);
|
||||
|
||||
if(!isset($this->_admin_cache[$adminid]))
|
||||
{
|
||||
$this->_admin_cache[$adminid] = $this->_db->query_first(
|
||||
"SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "`
|
||||
WHERE `adminid` = " . (int)$adminid
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_admin_cache[$adminid];
|
||||
}
|
||||
}
|
||||
174
lib/classes/phpinterface/class.phpinterface_fpm.php
Normal file
174
lib/classes/phpinterface/class.phpinterface_fpm.php
Normal file
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
* @version $Id$
|
||||
* @link http://www.nutime.de/
|
||||
* @since 0.9.16
|
||||
*
|
||||
*/
|
||||
|
||||
class phpinterface_fpm
|
||||
{
|
||||
/**
|
||||
* Database handler
|
||||
* @var object
|
||||
*/
|
||||
private $_db = false;
|
||||
|
||||
/**
|
||||
* Settings array
|
||||
* @var array
|
||||
*/
|
||||
private $_settings = array();
|
||||
|
||||
/**
|
||||
* Domain-Data array
|
||||
* @var array
|
||||
*/
|
||||
private $_domain = array();
|
||||
|
||||
/**
|
||||
* main constructor
|
||||
*/
|
||||
public function __construct($db, $settings, $domain)
|
||||
{
|
||||
$this->_db = $db;
|
||||
$this->_settings = $settings;
|
||||
$this->_domain = $domain;
|
||||
}
|
||||
|
||||
public function createConfig($phpconfig)
|
||||
{
|
||||
$fh = @fopen($this->getConfigFile(), 'w');
|
||||
if($fh)
|
||||
{
|
||||
$fpm_pm = $this->_settings['phpfpm']['pm'];
|
||||
$fpm_children = (int)$this->_settings['phpfpm']['max_children'];
|
||||
$fpm_start_servers = (int)$this->_settings['phpfpm']['start_servers'];
|
||||
$fpm_min_spare_servers = (int)$this->_settings['phpfpm']['min_spare_servers'];
|
||||
$fpm_max_spare_servers = (int)$this->_settings['phpfpm']['max_spare_servers'];
|
||||
$fpm_requests = (int)$this->_settings['phpfpm']['max_requests'];
|
||||
|
||||
if($fpm_children == 0) {
|
||||
$fpm_children = 1;
|
||||
}
|
||||
|
||||
$fpm_config = ';PHP-FPM configuration for "'.$this->_domain['domain'].'" created on ' . date("Y.m.d H:i:s") . "\n";
|
||||
$fpm_config.= '['.$this->_domain['domain'].']'."\n";
|
||||
$fpm_config.= 'listen = '.$this->getSocketFile()."\n";
|
||||
if($this->_domain['loginname'] == 'froxlor.panel')
|
||||
{
|
||||
$fpm_config.= 'listen.owner = '.$this->_domain['guid']."\n";
|
||||
$fpm_config.= 'listen.group = '.$this->_domain['guid']."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$fpm_config.= 'listen.owner = '.$this->_domain['loginname']."\n";
|
||||
$fpm_config.= 'listen.group = '.$this->_domain['loginname']."\n";
|
||||
}
|
||||
$fpm_config.= 'listen.mode = 0666'."\n";
|
||||
|
||||
if($this->_domain['loginname'] == 'froxlor.panel')
|
||||
{
|
||||
$fpm_config.= 'user = '.$this->_domain['guid']."\n";
|
||||
$fpm_config.= 'group = '.$this->_domain['guid']."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$fpm_config.= 'user = '.$this->_domain['loginname']."\n";
|
||||
$fpm_config.= 'group = '.$this->_domain['loginname']."\n";
|
||||
}
|
||||
|
||||
$fpm_config.= 'pm = '.$fpm_pm."\n";
|
||||
$fpm_config.= 'pm.max_children = '.$fpm_children."\n";
|
||||
if($fpm_pm == 'dynamic') {
|
||||
$fpm_config.= 'pm.start_servers = '.$fpm_start_servers."\n";
|
||||
$fpm_config.= 'pm.min_spare_servers = '.$fpm_min_spare_servers."\n";
|
||||
$fpm_config.= 'pm.max_spare_servers = '.$fpm_max_spare_servers."\n";
|
||||
}
|
||||
$fpm_config.= 'pm.max_requests = '.$fpm_requests."\n";
|
||||
|
||||
$fpm_config.= ';chroot = '.makeCorrectDir($this->_domain['documentroot'])."\n";
|
||||
|
||||
$tmpdir = makeCorrectDir($this->_settings['phpfpm']['tmpdir'] . '/' . $this->_domain['loginname'] . '/');
|
||||
if(!is_dir($tmpdir))
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
}
|
||||
//$slowlog = makeCorrectFile($this->_settings['system']['logfiles_directory'] . $this->_domain['loginname'] . '/php-fpm_slow.log');
|
||||
|
||||
$fpm_config.= 'env[TMP] = '.$tmpdir."\n";
|
||||
$fpm_config.= 'env[TMPDIR] = '.$tmpdir."\n";
|
||||
$fpm_config.= 'env[TEMP] = '.$tmpdir."\n";
|
||||
|
||||
$fpm_config.= 'php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f '.$this->_domain['email']."\n";
|
||||
if($this->_domain['loginname'] != 'froxlor.panel')
|
||||
{
|
||||
$fpm_config.= 'php_admin_value[open_basedir] = ' . makeCorrectDir($this->_settings['system']['documentroot_prefix'] . '/' . $this->_domain['loginname'] . '/') .':' . makeCorrectDir($this->_settings['phpfpm']['tmpdir'] . '/' . $this->_domain['loginname'] . '/') . ':' . $this->_settings['phpfpm']['peardir'] . "\n";
|
||||
}
|
||||
$fpm_config.= 'php_admin_value[session.save_path] = ' . makeCorrectDir($this->_settings['phpfpm']['tmpdir'] . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
$fpm_config.= 'php_admin_value[upload_tmp_dir] = ' . makeCorrectDir($this->_settings['phpfpm']['tmpdir'] . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
|
||||
fwrite($fh, $fpm_config, strlen($fpm_config));
|
||||
fclose($fh);
|
||||
}
|
||||
}
|
||||
|
||||
public function createIniFile($phpconfig)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* fpm-config file
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @return string the full path to the file
|
||||
*/
|
||||
public function getConfigFile($createifnotexists = true)
|
||||
{
|
||||
$configdir = makeCorrectDir($this->_settings['phpfpm']['configdir']);
|
||||
$config = makeCorrectFile($configdir.'/'.$this->_domain['domain'].'.conf');
|
||||
|
||||
if(!is_dir($configdir) && $createifnotexists)
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* return path of fpm-socket file
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @return string the full path to the socket
|
||||
*/
|
||||
public function getSocketFile($createifnotexists = true)
|
||||
{
|
||||
$socketdir = makeCorrectDir('/var/run/'.$this->_settings['system']['webserver'].'/');
|
||||
$socket = makeCorrectFile($socketdir.'/'.$this->_domain['loginname'].'-'.$this->_domain['domain'].'-php-fpm.socket');
|
||||
|
||||
if(!is_dir($socketdir) && $createifnotexists)
|
||||
{
|
||||
safe_exec('mkdir -p '.$socketdir);
|
||||
safe_exec('chown -R '.$this->_settings['system']['httpuser'].':'.$this->_settings['system']['httpgroup'].' '.$socketdir);
|
||||
}
|
||||
|
||||
return $socket;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,12 @@ return Array(
|
||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir']
|
||||
),
|
||||
'files' => ((int)$settings['phpfpm']['enabled'] == 1) ?
|
||||
Array(
|
||||
'etc_apache2_modules.d_70_fastcgi.conf' => '/etc/apache2/modules.d/70_fastcgi.conf'
|
||||
)
|
||||
:
|
||||
null,
|
||||
'restart' => Array(
|
||||
'rc-update add apache2 default',
|
||||
'/etc/init.d/apache2 restart'
|
||||
|
||||
@@ -34,6 +34,12 @@ return Array(
|
||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||
'a2dismod userdir'
|
||||
),
|
||||
'files' => ((int)$settings['phpfpm']['enabled'] == 1) ?
|
||||
Array(
|
||||
'etc_apache2_mods-enabled_fastcgi.conf' => '/etc/apache2/mods-enabled/fastcgi.conf'
|
||||
)
|
||||
:
|
||||
null,
|
||||
'restart' => Array(
|
||||
'/etc/init.d/apache2 restart'
|
||||
)
|
||||
|
||||
@@ -34,6 +34,12 @@ return Array(
|
||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||
'a2dismod userdir'
|
||||
),
|
||||
'files' => ((int)$settings['phpfpm']['enabled'] == 1) ?
|
||||
Array(
|
||||
'etc_apache2_mods-enabled_fastcgi.conf' => '/etc/apache2/mods-enabled/fastcgi.conf'
|
||||
)
|
||||
:
|
||||
null,
|
||||
'restart' => Array(
|
||||
'/etc/init.d/apache2 restart'
|
||||
),
|
||||
|
||||
@@ -34,6 +34,12 @@ return Array(
|
||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||
'a2dismod userdir'
|
||||
),
|
||||
'files' => ((int)$settings['phpfpm']['enabled'] == 1) ?
|
||||
Array(
|
||||
'etc_apache2_mods-enabled_fastcgi.conf' => '/etc/apache2/mods-enabled/fastcgi.conf'
|
||||
)
|
||||
:
|
||||
null,
|
||||
'restart' => Array(
|
||||
'/etc/init.d/apache2 restart'
|
||||
),
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
function buildFormEx($form, $part = '')
|
||||
{
|
||||
global $settings;
|
||||
$fields = '';
|
||||
|
||||
if(validateFormDefinition($form))
|
||||
@@ -34,24 +35,42 @@ function buildFormEx($form, $part = '')
|
||||
// only show one section
|
||||
elseif($part != '' && ($groupname == $part || $part == 'all'))
|
||||
{
|
||||
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
|
||||
/**
|
||||
* this part checks for the 'websrv_avail' entry in the settings-array
|
||||
* if found, we check if the current webserver is in the array. If this
|
||||
* is not the case, we change the setting type to "hidden", #502
|
||||
*/
|
||||
$do_show = true;
|
||||
if(isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail']))
|
||||
{
|
||||
$fields .= getFormGroupOutput($groupname, $groupdetails);
|
||||
}
|
||||
|
||||
if(validateFieldDefinition($groupdetails))
|
||||
{
|
||||
// Prefetch form fields
|
||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||
$websrv = $settings['system']['webserver'];
|
||||
if(!in_array($websrv, $groupdetails['websrv_avail']))
|
||||
{
|
||||
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
||||
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
||||
$do_show = false;
|
||||
}
|
||||
|
||||
// Collect form field output
|
||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||
}
|
||||
|
||||
if($do_show)
|
||||
{
|
||||
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
|
||||
{
|
||||
$fields .= getFormFieldOutput($fieldname, $fielddetails);
|
||||
$fields .= getFormGroupOutput($groupname, $groupdetails);
|
||||
}
|
||||
|
||||
if(validateFieldDefinition($groupdetails))
|
||||
{
|
||||
// Prefetch form fields
|
||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||
{
|
||||
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
||||
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
||||
}
|
||||
|
||||
// Collect form field output
|
||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||
{
|
||||
$fields .= getFormFieldOutput($fieldname, $fielddetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
function getFormFieldOutput($fieldname, $fielddata)
|
||||
{
|
||||
global $settings;
|
||||
|
||||
$returnvalue = '';
|
||||
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldOutput' . ucfirst($fielddata['type'])))
|
||||
{
|
||||
@@ -44,7 +46,26 @@ function getFormFieldOutput($fieldname, $fielddata)
|
||||
$fielddata['value'] = null;
|
||||
}
|
||||
}
|
||||
$returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata);
|
||||
|
||||
/**
|
||||
* this part checks for the 'websrv_avail' entry in the settings-array
|
||||
* if found, we check if the current webserver is in the array. If this
|
||||
* is not the case, we change the setting type to "hidden", #502
|
||||
*/
|
||||
$do_show = true;
|
||||
if(isset($fielddata['websrv_avail']) && is_array($fielddata['websrv_avail']))
|
||||
{
|
||||
$websrv = $settings['system']['webserver'];
|
||||
if(!in_array($websrv, $fielddata['websrv_avail']))
|
||||
{
|
||||
$do_show = false;
|
||||
}
|
||||
}
|
||||
|
||||
if($do_show)
|
||||
{
|
||||
$returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata);
|
||||
}
|
||||
}
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,24 @@ function getFormOverviewGroupOutput($groupname, $groupdetails)
|
||||
}
|
||||
}
|
||||
|
||||
eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");
|
||||
/**
|
||||
* this part checks for the 'websrv_avail' entry in the settings-array
|
||||
* if found, we check if the current webserver is in the array. If this
|
||||
* is not the case, we change the setting type to "hidden", #502
|
||||
*/
|
||||
$do_show = true;
|
||||
if(isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail']))
|
||||
{
|
||||
$websrv = $settings['system']['webserver'];
|
||||
if(!in_array($websrv, $groupdetails['websrv_avail']))
|
||||
{
|
||||
$do_show = false;
|
||||
}
|
||||
}
|
||||
|
||||
if($do_show)
|
||||
{
|
||||
eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");
|
||||
}
|
||||
return $group;
|
||||
}
|
||||
|
||||
44
lib/functions/validate/function.checkFcgidPhpFpm.php
Normal file
44
lib/functions/validate/function.checkFcgidPhpFpm.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Functions
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
function checkFcgidPhpFpm($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
||||
{
|
||||
global $settings;
|
||||
|
||||
$returnvalue = array(FORMFIELDS_PLAUSIBILITY_CHECK_OK);
|
||||
|
||||
/*
|
||||
* check whether fcgid should be enabled but php-fpm is
|
||||
*/
|
||||
if($fieldname == 'system_mod_fcgid_enabled'
|
||||
&& (int)$newfieldvalue == 1
|
||||
&& (int)$settings['phpfpm']['enabled'] == 1
|
||||
) {
|
||||
$returnvalue = array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'phpfpmstillenabled');
|
||||
}
|
||||
/*
|
||||
* check whether php-fpm should be enabled but fcgid is
|
||||
*/
|
||||
elseif($fieldname == 'system_phpfpm_enabled'
|
||||
&& (int)$newfieldvalue == 1
|
||||
&& (int)$settings['system']['mod_fcgid'] == 1
|
||||
) {
|
||||
$returnvalue = array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'fcgidstillenabled');
|
||||
}
|
||||
|
||||
return $returnvalue;
|
||||
}
|
||||
@@ -218,7 +218,14 @@ return array (
|
||||
array (
|
||||
'url' => 'admin_phpsettings.php?page=overview',
|
||||
'label' => $lng['menue']['phpsettings']['maintitle'],
|
||||
'show_element' => ( getSetting('system', 'mod_fcgid') == true ),
|
||||
'show_element' => (
|
||||
getSetting('system', 'mod_fcgid') == true
|
||||
/*
|
||||
* @TODO activate if phpfpm knows custom php.ini files
|
||||
*
|
||||
* || getSetting('phpfpm', 'enabled') == true
|
||||
*/
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -71,7 +71,7 @@ define('PACKAGE_ENABLED', 2);
|
||||
|
||||
// VERSION INFO
|
||||
|
||||
$version = '0.9.15';
|
||||
$version = '0.9.16';
|
||||
$dbversion = '2';
|
||||
$branding = '';
|
||||
|
||||
|
||||
1070
lng/dutch.lng.php
1070
lng/dutch.lng.php
File diff suppressed because it is too large
Load Diff
@@ -547,8 +547,8 @@ $lng['panel']['back'] = 'Back';
|
||||
|
||||
$lng['serversettings']['mod_log_sql']['title'] = 'Temporary save logs in the database';
|
||||
$lng['serversettings']['mod_log_sql']['description'] = 'Use <a href="http://www.outoforder.cc/projects/apache/mod_log_sql/" title="mod_log_sql">mod_log_sql</a> to save webrequests temporarily<br /><b>This needs a special <a href="http://files.froxlor.org/docs/mod_log_sql/" title="mod_log_sql - documentation">apache-configuration</a>!</b>';
|
||||
$lng['serversettings']['mod_fcgid']['title'] = 'Include PHP via mod_fcgid/suexec';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'Use mod_fcgid/suexec/libnss_mysql to run PHP with the corresponding useraccount.<br/><b>This needs a special webserver configuration, see <a href="http://wiki.froxlor.org/contrib/fcgid-handbook">http://wiki.froxlor.org/contrib/fcgid-handbook</a></b><br /><br /><div style="color:red">NOTE: This folder\'s content gets deleted regulary so avoid storing data in there manually.</div>';
|
||||
$lng['serversettings']['mod_fcgid']['title'] = 'Enable FCGID';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'Use this to run PHP with the corresponding useraccount.<br /><br /><b>This needs a special webserver configuration for Apache, see <a href="http://wiki.froxlor.org/contrib/fcgid-handbook">http://wiki.froxlor.org/contrib/fcgid-handbook</a></b>';
|
||||
$lng['serversettings']['sendalternativemail']['title'] = 'Use alternative email-address';
|
||||
$lng['serversettings']['sendalternativemail']['description'] = 'Send the password-email to a different address during email-account-creation';
|
||||
$lng['emails']['alternative_emailaddress'] = 'Alternative e-mail-address';
|
||||
@@ -708,7 +708,7 @@ $lng['serversettings']['ticket']['noreply_name'] = 'Ticket e-mail sendername';
|
||||
// ADDED IN 1.2.19-svn1
|
||||
|
||||
$lng['serversettings']['mod_fcgid']['configdir']['title'] = 'Configuration directory';
|
||||
$lng['serversettings']['mod_fcgid']['configdir']['description'] = 'Where should all fcgid-configuration files be stored? If you don\'t use a self compiled suexec binary, which is the normal situation, this path must be under /var/www/';
|
||||
$lng['serversettings']['mod_fcgid']['configdir']['description'] = 'Where should all fcgid-configuration files be stored? If you don\'t use a self compiled suexec binary, which is the normal situation, this path must be under /var/www/<br /><br /><div style="color:red">NOTE: This folder\'s content gets deleted regulary so avoid storing data in there manually.</div>';
|
||||
$lng['serversettings']['mod_fcgid']['tmpdir']['title'] = 'Temp directory';
|
||||
|
||||
// ADDED IN 1.2.19-svn3
|
||||
@@ -1442,7 +1442,7 @@ $lng['admin']['perlenabled'] = 'Perl enabled';
|
||||
|
||||
// ADDED IN FROXLOR 0.9.11-svn3
|
||||
$lng['serversettings']['perl_path']['title'] = 'Path to perl';
|
||||
$lng['serversettings']['perl_path']['description'] = 'Only relevant if you use lighttpd. Default is /usr/bin/perl';
|
||||
$lng['serversettings']['perl_path']['description'] = 'Default is /usr/bin/perl';
|
||||
|
||||
// ADDED IN FROXLOR 0.9.12-svn1
|
||||
$lng['admin']['fcgid_settings'] = 'FCGID';
|
||||
@@ -1453,7 +1453,7 @@ $lng['admin']['mod_fcgid_group'] = 'Local group to use for FCGID (Froxlor vHost)
|
||||
|
||||
// ADDED IN FROXLOR 0.9.12-svn2
|
||||
$lng['admin']['perl_settings'] = 'Perl/CGI';
|
||||
$lng['serversettings']['perl']['suexecworkaround']['title'] = 'Enable SuExec workaround (Apache only)';
|
||||
$lng['serversettings']['perl']['suexecworkaround']['title'] = 'Enable SuExec workaround';
|
||||
$lng['serversettings']['perl']['suexecworkaround']['description'] = 'Enable only if customer docroots are not within the apache suexec path.<br />If enabled, Froxlor will generate a symlink from the customers perl-enabled directory + /cgi-bin/ to the given path.<br />Note that perl will then only work in the folders subdirectory /cgi-bin/ and not in the folder itself (as it does without this fix!)';
|
||||
$lng['serversettings']['perl']['suexeccgipath']['title'] = 'Path for customer perl-enabled directory symlinks';
|
||||
$lng['serversettings']['perl']['suexeccgipath']['description'] = 'You only need to set this if the SuExec-workaround is enabled.<br />ATTENTION: Be sure this path is within the suexec path or else this workaround is uselsess';
|
||||
@@ -1517,8 +1517,33 @@ $lng['question']['customer_reallyunlock'] = 'Do you really want to unlock custom
|
||||
|
||||
// ADDED IN FROXLOR 0.9.15-svn1
|
||||
$lng['serversettings']['perl_server']['title'] = 'Perl server location';
|
||||
$lng['serversettings']['perl_server']['description'] = 'This is only used for Nginx<br />default is set for using the guide found at: http://wiki.nginx.org/SimpleCGI';
|
||||
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx php backend';
|
||||
$lng['serversettings']['perl_server']['description'] = 'Default is set for using the guide found at: http://wiki.nginx.org/SimpleCGI';
|
||||
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend';
|
||||
$lng['serversettings']['nginx_php_backend']['description'] = 'this is where the PHP process is listening for requests from nginx, can be a unix socket of ip:port combination';
|
||||
$lng['serversettings']['phpreload_command']['title'] = 'PHP reload command';
|
||||
$lng['serversettings']['phpreload_command']['description'] = 'this is used to reload the Php backend if any is used (this is required to be set for Nginx) Default: Blank';
|
||||
$lng['serversettings']['phpreload_command']['description'] = 'this is used to reload the PHP backend if any is used<br />Default: blank';
|
||||
|
||||
// ADDED IN FROXLOR 0.9.16
|
||||
$lng['error']['intvaluetoolow'] = 'The given number is too low (field %s)';
|
||||
$lng['error']['intvaluetoohigh'] = 'The given number is too high (field %s)';
|
||||
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
||||
$lng['serversettings']['phpfpm'] = 'Enable php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['configdir'] = 'Configuration directory of php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['reload'] = 'php-fpm restart command';
|
||||
$lng['serversettings']['phpfpm_settings']['pm'] = 'Process manager control (pm)';
|
||||
$lng['serversettings']['phpfpm_settings']['max_children']['title'] = 'The number of child processes';
|
||||
$lng['serversettings']['phpfpm_settings']['max_children']['description'] = 'The number of child processes to be created when pm is set to \'static\' and the maximum number of child processes to be created when pm is set to \'dynamic\'<br />Equivalent to the PHP_FCGI_CHILDREN';
|
||||
$lng['serversettings']['phpfpm_settings']['start_servers']['title'] = 'The number of child processes created on startup';
|
||||
$lng['serversettings']['phpfpm_settings']['start_servers']['description'] = 'Note: Used only when pm is set to \'dynamic\'';
|
||||
$lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'] = 'The desired minimum number of idle server processes';
|
||||
$lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] = 'Note: Used only when pm is set to \'dynamic\'<br />Note: Mandatory when pm is set to \'dynamic\'';
|
||||
$lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'] = 'The desired maximum number of idle server processes';
|
||||
$lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] = 'Note: Used only when pm is set to \'dynamic\'<br />Note: Mandatory when pm is set to \'dynamic\'';
|
||||
$lng['serversettings']['phpfpm_settings']['max_requests']['title'] = 'Requests per child before respawning';
|
||||
$lng['serversettings']['phpfpm_settings']['max_requests']['description'] = 'For endless request processing specify \'0\'. Equivalent to PHP_FCGI_MAX_REQUESTS.';
|
||||
$lng['error']['phpfpmstillenabled'] = 'PHP-FPM is currently active. Please deactivate it before activating FCGID';
|
||||
$lng['error']['fcgidstillenabled'] = 'FCGID is currently active. Please deactivate it before activating PHP-FPM';
|
||||
$lng['phpfpm']['vhost_httpuser'] = 'Local user to use for PHP-FPM (Froxlor vHost)';
|
||||
$lng['phpfpm']['vhost_httpgroup'] = 'Local group to use for PHP-FPM (Froxlor vHost)';
|
||||
$lng['phpfpm']['ownvhost']['title'] = 'Enable PHP-FPM for the Froxlor vHost';
|
||||
$lng['phpfpm']['ownvhost']['description'] = 'If enabled, Froxlor will also be running under a local user';
|
||||
|
||||
@@ -547,7 +547,7 @@ $lng['panel']['back'] = 'Zurück';
|
||||
$lng['serversettings']['mod_log_sql']['title'] = 'Logs in Datenbank zwischenspeichern';
|
||||
$lng['serversettings']['mod_log_sql']['description'] = '<a href="http://www.outoforder.cc/projects/apache/mod_log_sql/" title="mod_log_sql">mod_log_sql</a> benutzen um die Webzugriffe temporär zu speichern<br /><b>Dies benötigt eine spezielle Apache-Konfiguration</b>';
|
||||
$lng['serversettings']['mod_fcgid']['title'] = 'PHP über mod_fcgid/suexec einbinden';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'mod_fcgid/suexec/libnss_mysql benutzen um PHP unter dem jeweiligen Useraccount laufen zu lassen<br /><b>Dies benötigt eine spezielle <a href="http://files.froxlor.org/docs/mod_log_sql/" title="mod_log_sql - Dokumentation">Apache-Konfiguration</a></b><br /><br /><div style="color:red">ACHTUNG: Der Inhalt dieses Ordners wird regelmäßig geleert, daher sollten keinerlei Daten dort manuell abgelegt werden.</div>';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'PHP unter dem jeweiligen Useraccount laufen lassen.<br /><br /><b>Dies benötigt eine spezielle Webserver-Konfiguration für Apache, siehe <a href="http://wiki.froxlor.org/contrib/fcgid-handbook">http://wiki.froxlor.org/contrib/fcgid-handbook</a>.</b>';
|
||||
$lng['serversettings']['sendalternativemail']['title'] = 'Alternative E-Mail-Adresse benutzen';
|
||||
$lng['serversettings']['sendalternativemail']['description'] = 'Während des Erstellens eines Accounts das Passwort an eine andere E-Mail-Adresse senden';
|
||||
$lng['emails']['alternative_emailaddress'] = 'Alternative E-Mail-Adresse';
|
||||
@@ -578,7 +578,6 @@ $lng['serversettings']['mysql_access_host']['description'] = 'Eine durch Komma g
|
||||
// CHANGED IN 1.2.18
|
||||
|
||||
$lng['serversettings']['mod_log_sql']['description'] = '<a href="http://www.outoforder.cc/projects/apache/mod_log_sql/" title="mod_log_sql">mod_log_sql</a> benutzen um die Webzugriffe temporär zu speichern<br /><b>Dies benötigt eine spezielle <a href="http://files.froxlor.org/docs/mod_log_sql/" title="mod_log_sql - Dokumentation">Apache-Konfiguration</a></b>';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'mod_fcgid/suexec/libnss_mysql benutzen um PHP unter dem jeweiligen Useraccount laufen zu lassen<br /><b>Dies benötigt eine spezielle Webserver-Konfiguration, siehe <a href="http://wiki.froxlor.org/contrib/fcgid-handbook">http://wiki.froxlor.org/contrib/fcgid-handbook</a>.</b>';
|
||||
|
||||
// ADDED IN 1.2.18-svn1
|
||||
|
||||
@@ -712,7 +711,7 @@ $lng['serversettings']['ticket']['noreply_name'] = 'Ticket E-Mail Absendername';
|
||||
// ADDED IN 1.2.19-svn
|
||||
|
||||
$lng['serversettings']['mod_fcgid']['configdir']['title'] = 'Konfigurations-Verzeichnis';
|
||||
$lng['serversettings']['mod_fcgid']['configdir']['description'] = 'Wo sollen alle Konfigurationsdateien von fcgid liegen? Wenn Sie keine selbst kompilierte suexec Binary benutzen, was in der Regel der Fall ist, muss dieser Pfad unter /var/www/ liegen.';
|
||||
$lng['serversettings']['mod_fcgid']['configdir']['description'] = 'Wo sollen alle Konfigurationsdateien von fcgid liegen? Wenn Sie keine selbst kompilierte suexec Binary benutzen, was in der Regel der Fall ist, muss dieser Pfad unter /var/www/ liegen.<br /><br /><div style="color:red">ACHTUNG: Der Inhalt dieses Ordners wird regelmäßig geleert, daher sollten keinerlei Daten dort manuell abgelegt werden.</div>';
|
||||
$lng['serversettings']['mod_fcgid']['tmpdir']['title'] = 'Temporäres Verzeichnis';
|
||||
|
||||
// ADDED IN 1.2.19-svn3
|
||||
@@ -1425,7 +1424,7 @@ $lng['admin']['perlenabled'] = 'Perl verfügbar';
|
||||
|
||||
// ADDED IN FROXLOR 0.9.11-svn3
|
||||
$lng['serversettings']['perl_path']['title'] = 'Pfad zu Perl';
|
||||
$lng['serversettings']['perl_path']['description'] = 'Nur nötig für lighttpd-Nutzer. Standard ist /usr/bin/perl';
|
||||
$lng['serversettings']['perl_path']['description'] = 'Standard ist /usr/bin/perl';
|
||||
|
||||
// ADDED IN FROXLOR 0.9.12-svn1
|
||||
$lng['admin']['fcgid_settings'] = 'FCGID';
|
||||
@@ -1436,7 +1435,7 @@ $lng['admin']['mod_fcgid_group'] = 'Lokale Gruppe für FCGID (Froxlor Vhost)
|
||||
|
||||
// ADDED IN FROXLOR 0.9.12-svn2
|
||||
$lng['admin']['perl_settings'] = 'Perl/CGI';
|
||||
$lng['serversettings']['perl']['suexecworkaround']['title'] = 'Aktiviere SuExec Workaround (nur für Apache)';
|
||||
$lng['serversettings']['perl']['suexecworkaround']['title'] = 'Aktiviere SuExec Workaround';
|
||||
$lng['serversettings']['perl']['suexecworkaround']['description'] = 'Aktivieren Sie den Workaround nur, wenn die Kunden-Heimatverzeichnisse sich nicht unterhalb des suexec-Pfades liegen.<br />Wenn aktiviert erstellt Froxlor eine Verknüpfung des vom Kunden für Perl aktiviertem Pfad + /cgi-bin/ im angegebenen suexec-Pfad.<br />Bitte beachten Sie, dass Perl dann nur im Unterordner /cgi-bin/ des Kunden-Ordners funktioniert und nicht direkt in diesem Ordner (wie es ohne den Workaround wäre!)';
|
||||
$lng['serversettings']['perl']['suexeccgipath']['title'] = 'Pfad für Verknüpfungen zu Kunden-Perl-Verzeichnis';
|
||||
$lng['serversettings']['perl']['suexeccgipath']['description'] = 'Diese Einstellung wird nur benötigt, wenn der SuExec-Workaround aktiviert ist.<br />ACHTUNG: Stellen Sie sicher, dass sich der angegebene Pfad innerhalb des Suexec-Pfades befindet ansonsten ist der Workaround nutzlos';
|
||||
@@ -1500,8 +1499,33 @@ $lng['question']['customer_reallyunlock'] = 'Wollen Sie den Kunden %s wirklich e
|
||||
|
||||
// ADDED IN FROXLOR 0.9.15-svn1
|
||||
$lng['serversettings']['perl_server']['title'] = 'Perl Server Ort';
|
||||
$lng['serversettings']['perl_server']['description'] = 'Nur für nginx<br />Der Standardwert ist diesem Guide entnommen: http://wiki.nginx.org/SimpleCGI';
|
||||
$lng['serversettings']['perl_server']['description'] = 'Der Standardwert ist diesem Guide entnommen: http://wiki.nginx.org/SimpleCGI';
|
||||
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP Backend';
|
||||
$lng['serversettings']['nginx_php_backend']['description'] = 'Dies ist das Backend, auf dem PHP auf Anfragen von Nginx hört. Kann ein UNIX Socket oder eine IP:Port Kombination sein';
|
||||
$lng['serversettings']['phpreload_command']['title'] = 'PHP Reload Befehl';
|
||||
$lng['serversettings']['phpreload_command']['description'] = 'Dieser wird benötigt, um das PHP Backend für Nginx bei Bedarf durch den Cronjob neu zu laden. (Nur für Nginx, Standard: leer)';
|
||||
$lng['serversettings']['phpreload_command']['description'] = 'Dieser wird benötigt, um das PHP Backend bei Bedarf durch den Cronjob neu zu laden. (Standard: leer)';
|
||||
|
||||
// ADDED IN FROXLOR 0.9.16
|
||||
$lng['error']['intvaluetoolow'] = 'Die angegebene Zahl ist zu klein (Feld %s)';
|
||||
$lng['error']['intvaluetoohigh'] = 'Die angegebene Zahl ist zu groß (Feld %s)';
|
||||
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
||||
$lng['serversettings']['phpfpm'] = 'Aktiviere php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['configdir'] = 'Pfad zu php-fpm Konfigurationen';
|
||||
$lng['serversettings']['phpfpm_settings']['reload'] = 'Kommando zum Neustarten von php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['pm'] = 'Prozess Manager Control (PM)';
|
||||
$lng['serversettings']['phpfpm_settings']['max_children']['title'] = 'Anzahl der Kind-Prozesse';
|
||||
$lng['serversettings']['phpfpm_settings']['max_children']['description'] = 'Die Anzahl der zu startenden Kind-Prozesse wenn PM auf \'static\' steht und die maximale Anzahl der Prozesse wenn PM auf \'dynamic\' steht.<br />Equivalent zu PHP_FCGI_CHILDREN';
|
||||
$lng['serversettings']['phpfpm_settings']['start_servers']['title'] = 'Anzahl der beim Starten zu erstellenden Kind-Prozesse';
|
||||
$lng['serversettings']['phpfpm_settings']['start_servers']['description'] = 'Hinweis: Nur wenn PM auf \'dynamic\' steht';
|
||||
$lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'] = 'Mindestanzahl der Idle-Prozesse';
|
||||
$lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] = 'Hinweis: Nur wenn PM auf \'dynamic\' steht<br />Wichtig: Pflichtangabe wenn PM auf \'dynamic\' steht';
|
||||
$lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'] = 'Maximale Anzahl der Idle-Prozesse';
|
||||
$lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] = 'Hinweis: Nur wenn PM auf \'dynamic\' steht<br />Wichtig: Pflichtangabe wenn PM auf \'dynamic\' steht';
|
||||
$lng['serversettings']['phpfpm_settings']['max_requests']['title'] = 'Requests pro Kindprozess bevor Neuerstellung (respawning)';
|
||||
$lng['serversettings']['phpfpm_settings']['max_requests']['description'] = 'Für keine Begrenzung \'0\' angeben. Equivalent zu PHP_FCGI_MAX_REQUESTS.';
|
||||
$lng['error']['phpfpmstillenabled'] = 'PHP-FPM ist derzeit aktiviert. Bitte deaktiviere es, um FCGID zu aktivieren';
|
||||
$lng['error']['fcgidstillenabled'] = 'FCGID ist derzeit aktiviert. Bitte deaktiviere es, um PHP-FPM zu aktivieren';
|
||||
$lng['phpfpm']['vhost_httpuser'] = 'Lokaler Benutzer für PHP-FPM (Froxlor Vhost)';
|
||||
$lng['phpfpm']['vhost_httpgroup'] = 'Lokale Gruppe für PHP-FPM (Froxlor Vhost)';
|
||||
$lng['phpfpm']['ownvhost']['title'] = 'Verwende PHP-FPM im Froxlor Vhost';
|
||||
$lng['phpfpm']['ownvhost']['description'] = 'Wenn verwendet, wird Froxlor selbst unter einem lokalem Benutzer ausgeführt';
|
||||
|
||||
@@ -57,6 +57,12 @@ class apache
|
||||
|
||||
public function reload()
|
||||
{
|
||||
if((int)$this->settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
fwrite($this->debugHandler, ' apache::reload: reloading php-fpm' . "\n");
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading php-fpm');
|
||||
safe_exec(escapeshellcmd($this->settings['phpfpm']['reload']));
|
||||
}
|
||||
fwrite($this->debugHandler, ' apache::reload: reloading apache' . "\n");
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading apache');
|
||||
safe_exec(escapeshellcmd($this->settings['system']['apachereload_command']));
|
||||
@@ -76,9 +82,10 @@ class apache
|
||||
}
|
||||
$vhosts_filename = makeCorrectFile($vhosts_folder . '/05_froxlor_dirfix_nofcgid.conf');
|
||||
|
||||
if($this->settings['system']['mod_fcgid'] == '1')
|
||||
{
|
||||
// if we use fcgid we don't need this file
|
||||
if($this->settings['system']['mod_fcgid'] == '1'
|
||||
|| $this->settings['phpfpm']['enabled'] == '1'
|
||||
) {
|
||||
// if we use fcgid or php-fpm we don't need this file
|
||||
if(file_exists($vhosts_filename))
|
||||
{
|
||||
fwrite($this->debugHandler, ' apache::_createStandardDirectoryEntry: unlinking ' . basename($vhosts_filename) . "\n");
|
||||
@@ -220,7 +227,7 @@ class apache
|
||||
if($this->settings['system']['mod_fcgid_ownvhost'] == '1')
|
||||
{
|
||||
|
||||
$configdir = makeCorrectDir($this->settings['system']['mod_fcgid_configdir'] . '/froxlor.panel/');
|
||||
$configdir = makeCorrectDir($this->settings['system']['mod_fcgid_configdir'] . '/froxlor.panel/' . $this->settings['system']['hostname']);
|
||||
if((int)$this->settings['system']['mod_fcgid_wrapper'] == 0)
|
||||
{
|
||||
$this->virtualhosts_data[$vhosts_filename].= ' SuexecUserGroup "' . $this->settings['system']['mod_fcgid_httpuser'] . '" "' . $this->settings['system']['mod_fcgid_httpgroup'] . '"' . "\n";
|
||||
@@ -239,6 +246,35 @@ class apache
|
||||
$this->virtualhosts_data[$vhosts_filename].= ' </Directory>' . "\n";
|
||||
}
|
||||
}
|
||||
// create php-fpm <Directory>-Part (config is created in apache_fcgid)
|
||||
elseif($this->settings['phpfpm']['enabled'] == '1')
|
||||
{
|
||||
$domain = array(
|
||||
'id' => 'none',
|
||||
'domain' => $this->settings['system']['hostname'],
|
||||
'adminid' => 1, /* first admin-user (superadmin) */
|
||||
'mod_fcgid_starter' => -1,
|
||||
'mod_fcgid_maxrequests' => -1,
|
||||
'guid' => $this->settings['phpfpm']['vhost_httpuser'],
|
||||
'openbasedir' => 0,
|
||||
'safemode' => '0',
|
||||
'email' => $this->settings['panel']['adminmail'],
|
||||
'loginname' => 'froxlor.panel',
|
||||
'documentroot' => $mypath
|
||||
);
|
||||
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
$this->virtualhosts_data[$vhosts_filename].= ' SuexecUserGroup "' . $this->settings['system']['mod_fcgid_httpuser'] . '" "' . $this->settings['system']['mod_fcgid_httpgroup'] . '"' . "\n";
|
||||
$this->virtualhosts_data[$vhosts_filename].= ' FastCgiExternalServer ' . $mypath . 'fpm.external -socket ' . $php->getInterface()->getSocketFile() . ' -user ' . $this->settings['system']['mod_fcgid_httpuser'] . ' -group ' . $this->settings['system']['mod_fcgid_httpuser'] . "\n";
|
||||
$this->virtualhosts_data[$vhosts_filename].= ' <Directory "' . $mypath . '">' . "\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].= ' Order allow,deny' . "\n";
|
||||
$this->virtualhosts_data[$vhosts_filename].= ' allow from all' . "\n";
|
||||
$this->virtualhosts_data[$vhosts_filename].= ' </Directory>' . "\n";
|
||||
$this->virtualhosts_data[$vhosts_filename].= ' Alias /fastcgiphp ' . $mypath . 'fpm.external' . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* dirprotection, see #72
|
||||
@@ -1089,6 +1125,11 @@ class apache
|
||||
$this->wipeOutOldDiroptionConfigs();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// no more diroptions, but there might be some file-corpses which have to be removed
|
||||
$this->wipeOutOldDiroptionConfigs();
|
||||
}
|
||||
|
||||
// Write htpasswds
|
||||
|
||||
@@ -1124,6 +1165,11 @@ class apache
|
||||
$this->logger->logAction(CRON_ACTION, LOG_WARNING, 'WARNING!!! ' . $this->settings['system']['apacheconf_htpasswddir'] . ' is not a directory. htpasswd directory protection is disabled!!!');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// no more htpasswds, but there might be some file-corpses which have to be removed
|
||||
$this->wipeOutOldHtpasswdConfigs();
|
||||
}
|
||||
|
||||
// Write virtualhosts
|
||||
|
||||
|
||||
@@ -26,219 +26,58 @@ if(@php_sapi_name() != 'cli'
|
||||
|
||||
class apache_fcgid extends apache
|
||||
{
|
||||
private $php_configs_cache = array();
|
||||
private $admin_cache = array();
|
||||
|
||||
/*
|
||||
* We put together the needed php options in the virtualhost entries
|
||||
*/
|
||||
|
||||
protected function composePhpOptions($domain)
|
||||
{
|
||||
$php_options_text = '';
|
||||
|
||||
if($domain['phpenabled'] == '1')
|
||||
{
|
||||
// This vHost has PHP enabled and we are using mod_fcgid
|
||||
//create basic variables for config
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);
|
||||
|
||||
$configdir = makeCorrectDir($this->settings['system']['mod_fcgid_configdir'] . '/' . $domain['loginname'] . '/' . $domain['domain'] . '/');
|
||||
$starter_filename = makeCorrectFile($configdir . '/php-fcgi-starter');
|
||||
$phpini_filename = makeCorrectFile($configdir . '/php.ini');
|
||||
$tmpdir = makeCorrectDir($this->settings['system']['mod_fcgid_tmpdir'] . '/' . $domain['loginname'] . '/');
|
||||
|
||||
// create config dir if necessary
|
||||
|
||||
if(!is_dir($configdir))
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
safe_exec('chown ' . $domain['guid'] . ':' . $domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||
}
|
||||
|
||||
// create tmp dir if necessary
|
||||
|
||||
if(!is_dir($tmpdir))
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chown -R ' . $domain['guid'] . ':' . $domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||
}
|
||||
|
||||
// Load php config
|
||||
|
||||
$phpconfig = $this->getPhpConfig((int)$domain['phpsettingid']);
|
||||
|
||||
if((int)$this->settings['system']['mod_fcgid_wrapper'] == 0)
|
||||
if((int)$this->settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
|
||||
$php_options_text.= ' ScriptAlias /php/ ' . $configdir . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
|
||||
$php_options_text.= ' <Directory "' . $domain['documentroot'] . '">' . "\n";
|
||||
$file_extensions = explode(' ', $phpconfig['file_extensions']);
|
||||
$php_options_text.= ' AddHandler fcgid-script .' . implode(' .', $file_extensions) . "\n";
|
||||
foreach($file_extensions as $file_extension)
|
||||
{
|
||||
$php_options_text.= ' FCGIWrapper ' . $starter_filename . ' .' . $file_extension . "\n";
|
||||
}
|
||||
|
||||
$php_options_text.= ' FastCgiExternalServer ' . makeCorrectDir($domain['documentroot']) . 'fpm.external -socket ' . $php->getInterface()->getSocketFile() . ' -user ' . $domain['loginname'] . ' -group ' . $domain['loginname'] . "\n";
|
||||
$php_options_text.= ' <Directory "' . makeCorrectDir($domain['documentroot']) . '">' . "\n";
|
||||
$php_options_text.= ' AddHandler php5-fastcgi .php'. "\n";
|
||||
$php_options_text.= ' Action php5-fastcgi /fastcgiphp' . "\n";
|
||||
$php_options_text.= ' Options +ExecCGI' . "\n";
|
||||
$php_options_text.= ' Order allow,deny' . "\n";
|
||||
$php_options_text.= ' allow from all' . "\n";
|
||||
$php_options_text.= ' </Directory>' . "\n";
|
||||
}
|
||||
|
||||
// create starter
|
||||
|
||||
$starter_file = "#!/bin/sh\n\n";
|
||||
$starter_file.= "#\n";
|
||||
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $domain['domain'] . "' with id #" . $domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
|
||||
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$starter_file.= "#\n\n";
|
||||
$starter_file.= "umask 022\n";
|
||||
$starter_file.= "PHPRC=" . escapeshellarg($configdir) . "\n";
|
||||
$starter_file.= "export PHPRC\n";
|
||||
|
||||
// set number of processes for one domain
|
||||
|
||||
if((int)$domain['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$domain['mod_fcgid_starter'] . "\n";
|
||||
$php_options_text.= ' Alias /fastcgiphp ' . makeCorrectDir($domain['documentroot']) . 'fpm.external' . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_starter'] != - 1)
|
||||
if((int)$this->settings['system']['mod_fcgid_wrapper'] == 0)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$phpconfig['mod_fcgid_starter'] . "\n";
|
||||
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
|
||||
$php_options_text.= ' ScriptAlias /php/ ' . $php->getInterface()->getConfigDir() . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$this->settings['system']['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$starter_file.= "export PHP_FCGI_CHILDREN\n";
|
||||
|
||||
// set number of maximum requests for one domain
|
||||
|
||||
if((int)$domain['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$domain['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$phpconfig['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$this->settings['system']['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$starter_file.= "export PHP_FCGI_MAX_REQUESTS\n";
|
||||
|
||||
// Set Binary
|
||||
|
||||
$starter_file.= "exec " . $phpconfig['binary'] . " -c " . escapeshellarg($configdir) . "\n";
|
||||
|
||||
//remove +i attibute, so starter can be overwritten
|
||||
|
||||
if(file_exists($starter_filename))
|
||||
{
|
||||
removeImmutable($starter_filename);
|
||||
}
|
||||
|
||||
$starter_file_handler = fopen($starter_filename, 'w');
|
||||
fwrite($starter_file_handler, $starter_file);
|
||||
fclose($starter_file_handler);
|
||||
safe_exec('chmod 750 ' . escapeshellarg($starter_filename));
|
||||
safe_exec('chown ' . $domain['guid'] . ':' . $domain['guid'] . ' ' . escapeshellarg($starter_filename));
|
||||
setImmutable($starter_filename);
|
||||
|
||||
// define the php.ini
|
||||
|
||||
$openbasedir = '';
|
||||
$openbasedirc = ';';
|
||||
|
||||
if($domain['openbasedir'] == '1')
|
||||
{
|
||||
$openbasedirc = '';
|
||||
$_phpappendopenbasedir = '';
|
||||
|
||||
$_custom_openbasedir = explode(':', $this->settings['system']['mod_fcgid_peardir']);
|
||||
foreach($_custom_openbasedir as $cobd)
|
||||
{
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
$_custom_openbasedir = explode(':', $this->settings['system']['phpappendopenbasedir']);
|
||||
foreach($_custom_openbasedir as $cobd)
|
||||
{
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
if($domain['openbasedir_path'] == '0' && strstr($domain['documentroot'], ":") === false)
|
||||
{
|
||||
$openbasedir = appendOpenBasedirPath($domain['documentroot'], true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$openbasedir = appendOpenBasedirPath($domain['customerroot'], true);
|
||||
}
|
||||
|
||||
$openbasedir .= appendOpenBasedirPath($tmpdir);
|
||||
$openbasedir .= $_phpappendopenbasedir;
|
||||
|
||||
$openbasedir = explode(':', $openbasedir);
|
||||
$clean_openbasedir = array();
|
||||
foreach($openbasedir as $number => $path)
|
||||
{
|
||||
if(trim($path) != '/')
|
||||
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
|
||||
$php_options_text.= ' <Directory "' . $domain['documentroot'] . '">' . "\n";
|
||||
$file_extensions = explode(' ', $phpconfig['file_extensions']);
|
||||
$php_options_text.= ' AddHandler fcgid-script .' . implode(' .', $file_extensions) . "\n";
|
||||
foreach($file_extensions as $file_extension)
|
||||
{
|
||||
$clean_openbasedir[] = makeCorrectDir($path);
|
||||
$php_options_text.= ' FCGIWrapper ' . $php->getInterface()->getStarterFile() . ' .' . $file_extension . "\n";
|
||||
}
|
||||
$php_options_text.= ' Options +ExecCGI' . "\n";
|
||||
$php_options_text.= ' Order allow,deny' . "\n";
|
||||
$php_options_text.= ' allow from all' . "\n";
|
||||
$php_options_text.= ' </Directory>' . "\n";
|
||||
}
|
||||
$openbasedir = implode(':', $clean_openbasedir);
|
||||
}
|
||||
else
|
||||
{
|
||||
$openbasedir = 'none';
|
||||
$openbasedirc = ';';
|
||||
}
|
||||
|
||||
$admin = $this->getAdminData($domain['adminid']);
|
||||
$php_ini_variables = array(
|
||||
'SAFE_MODE' => ($domain['safemode'] == '0' ? 'Off' : 'On'),
|
||||
'PEAR_DIR' => $this->settings['system']['mod_fcgid_peardir'],
|
||||
'OPEN_BASEDIR' => $openbasedir,
|
||||
'OPEN_BASEDIR_C' => $openbasedirc,
|
||||
'OPEN_BASEDIR_GLOBAL' => $this->settings['system']['phpappendopenbasedir'],
|
||||
'TMP_DIR' => $tmpdir,
|
||||
'CUSTOMER_EMAIL' => $domain['email'],
|
||||
'ADMIN_EMAIL' => $admin['email'],
|
||||
'DOMAIN' => $domain['domain'],
|
||||
'CUSTOMER' => $domain['loginname'],
|
||||
'ADMIN' => $admin['loginname']
|
||||
);
|
||||
|
||||
//insert a small header for the file
|
||||
|
||||
$phpini_file = ";\n";
|
||||
$phpini_file.= "; php.ini created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $domain['domain'] . "' with id #" . $domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
|
||||
$phpini_file.= "; Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$phpini_file.= ";\n\n";
|
||||
$phpini_file.= replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_file = str_replace('"none"', 'none', $phpini_file);
|
||||
$phpini_file = preg_replace('/\"+/', '"', $phpini_file);
|
||||
$phpini_file_handler = fopen($phpini_filename, 'w');
|
||||
fwrite($phpini_file_handler, $phpini_file);
|
||||
fclose($phpini_file_handler);
|
||||
safe_exec('chown root:0 ' . escapeshellarg($phpini_filename));
|
||||
safe_exec('chmod 0644 ' . escapeshellarg($phpini_filename));
|
||||
// create starter-file | config-file
|
||||
$php->getInterface()->createConfig($phpconfig);
|
||||
|
||||
// create php.ini
|
||||
// @TODO make php-fpm support this
|
||||
$php->getInterface()->createIniFile($phpconfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -248,149 +87,56 @@ class apache_fcgid extends apache
|
||||
return $php_options_text;
|
||||
}
|
||||
|
||||
private function getPhpConfig($php_config_id)
|
||||
{
|
||||
$php_config_id = intval($php_config_id);
|
||||
|
||||
// If domain has no config, we will use the default one.
|
||||
|
||||
if($php_config_id == 0)
|
||||
{
|
||||
$php_config_id = 1;
|
||||
}
|
||||
|
||||
if(!isset($this->php_configs_cache[$php_config_id]))
|
||||
{
|
||||
$this->php_configs_cache[$php_config_id] = $this->getDB()->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$php_config_id);
|
||||
}
|
||||
|
||||
return $this->php_configs_cache[$php_config_id];
|
||||
}
|
||||
|
||||
private function getAdminData($adminid)
|
||||
{
|
||||
$adminid = intval($adminid);
|
||||
|
||||
if(!isset($this->admin_cache[$adminid]))
|
||||
{
|
||||
$this->admin_cache[$adminid] = $this->getDB()->query_first("SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = " . (int)$adminid);
|
||||
}
|
||||
|
||||
return $this->admin_cache[$adminid];
|
||||
}
|
||||
|
||||
public function createOwnVhostStarter()
|
||||
{
|
||||
if ($this->settings['system']['mod_fcgid_ownvhost'] == '1')
|
||||
{
|
||||
if ($this->settings['system']['mod_fcgid_ownvhost'] == '1'
|
||||
|| ($this->settings['phpfpm']['enabled'] == '1'
|
||||
&& $this->settings['phpfpm']['enabled_ownvhost'] == '1')
|
||||
) {
|
||||
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown
|
||||
$configdir = makeCorrectDir($this->settings['system']['mod_fcgid_configdir'] . '/froxlor.panel/');
|
||||
$starter_filename = makeCorrectFile($configdir . '/php-fcgi-starter');
|
||||
$phpini_filename = makeCorrectFile($configdir . '/php.ini');
|
||||
$tmpdir = makeCorrectDir($this->settings['system']['mod_fcgid_tmpdir'] . '/froxlor.panel/');
|
||||
|
||||
$user = $this->settings['system']['mod_fcgid_httpuser'];
|
||||
$group = $this->settings['system']['mod_fcgid_httpgroup'];
|
||||
|
||||
if ($this->settings['system']['mod_fcgid_ownvhost'] == '1')
|
||||
{
|
||||
$user = $this->settings['system']['mod_fcgid_httpuser'];
|
||||
$group = $this->settings['system']['mod_fcgid_httpgroup'];
|
||||
}
|
||||
elseif($this->settings['phpfpm']['enabled'] == '1'
|
||||
&& $this->settings['phpfpm']['enabled_ownvhost'] == '1'
|
||||
) {
|
||||
$user = $this->settings['phpfpm']['vhost_httpuser'];
|
||||
$group = $this->settings['phpfpm']['vhost_httpgroup'];
|
||||
}
|
||||
|
||||
$domain = array(
|
||||
'id' => 'none',
|
||||
'domain' => $this->settings['system']['hostname'],
|
||||
'adminid' => 1, /* first admin-user (superadmin) */
|
||||
'mod_fcgid_starter' => -1,
|
||||
'mod_fcgid_maxrequests' => -1,
|
||||
'guid' => $user,
|
||||
'openbasedir' => 0,
|
||||
'safemode' => '0',
|
||||
'email' => $this->settings['panel']['adminmail'],
|
||||
'loginname' => 'froxlor.panel',
|
||||
'documentroot' => $mypath
|
||||
);
|
||||
|
||||
// all the files and folders have to belong to the local user
|
||||
// now because we also use fcgid for our own vhost
|
||||
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
|
||||
|
||||
// create config dir if necessary
|
||||
if(!is_dir($configdir))
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
safe_exec('chown ' . $user . ':' . $group . ' ' . escapeshellarg($configdir));
|
||||
}
|
||||
|
||||
// create tmp dir if necessary
|
||||
if(!is_dir($tmpdir))
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||
}
|
||||
|
||||
|
||||
// get php.ini for our own vhost
|
||||
$phpconfig = $this->getPhpConfig((int)$this->settings['system']['mod_fcgid_defaultini_ownvhost']);
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
|
||||
// create starter
|
||||
$starter_file = "#!/bin/sh\n\n";
|
||||
$starter_file.= "#\n";
|
||||
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for the Froxlor vhost\n";
|
||||
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$starter_file.= "#\n\n";
|
||||
$starter_file.= "umask 022\n";
|
||||
$starter_file.= "PHPRC=" . escapeshellarg($configdir) . "\n";
|
||||
$starter_file.= "export PHPRC\n";
|
||||
if((int)$phpconfig['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$phpconfig['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$this->settings['system']['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
$starter_file.= "export PHP_FCGI_CHILDREN\n";
|
||||
if((int)$phpconfig['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$phpconfig['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$this->settings['system']['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
$starter_file.= "export PHP_FCGI_MAX_REQUESTS\n";
|
||||
// @FIXME don't use fcgid settings if not fcgid in use, but we don't have anything else atm
|
||||
$phpconfig = $php->getPhpConfig($this->settings['system']['mod_fcgid_defaultini_ownvhost']);
|
||||
|
||||
// Set Binary
|
||||
$starter_file.= "exec " . $phpconfig['binary'] . " -c " . escapeshellarg($configdir) . "\n";
|
||||
|
||||
//remove +i attibute, so starter can be overwritten
|
||||
if(file_exists($starter_filename))
|
||||
{
|
||||
removeImmutable($starter_filename);
|
||||
}
|
||||
|
||||
$starter_file_handler = fopen($starter_filename, 'w');
|
||||
fwrite($starter_file_handler, $starter_file);
|
||||
fclose($starter_file_handler);
|
||||
safe_exec('chmod 750 ' . escapeshellarg($starter_filename));
|
||||
safe_exec('chown ' . $user . ':' . $group . ' ' . escapeshellarg($starter_filename));
|
||||
setImmutable($starter_filename);
|
||||
|
||||
// define the php.ini
|
||||
|
||||
$php_ini_variables = array(
|
||||
'SAFE_MODE' => 'Off',
|
||||
'PEAR_DIR' => $this->settings['system']['mod_fcgid_peardir'],
|
||||
'OPEN_BASEDIR' => 'none',
|
||||
'OPEN_BASEDIR_C' => ';',
|
||||
'OPEN_BASEDIR_GLOBAL' => '',
|
||||
'TMP_DIR' => $tmpdir,
|
||||
'CUSTOMER_EMAIL' => $this->settings['panel']['adminmail'],
|
||||
'ADMIN_EMAIL' => $this->settings['panel']['adminmail'],
|
||||
'DOMAIN' => $this->settings['system']['hostname'],
|
||||
'CUSTOMER' => $user,
|
||||
'ADMIN' => $user
|
||||
);
|
||||
|
||||
//insert a small header for the file
|
||||
|
||||
$phpini_file = ";\n";
|
||||
$phpini_file.= "; php.ini created/changed on " . date("Y.m.d H:i:s") . " for Froxlor-vhost from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
|
||||
$phpini_file.= "; Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$phpini_file.= ";\n\n";
|
||||
$phpini_file.= replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_file = str_replace('"none"', 'none', $phpini_file);
|
||||
$phpini_file = preg_replace('/\"+/', '"', $phpini_file);
|
||||
$phpini_file_handler = fopen($phpini_filename, 'w');
|
||||
fwrite($phpini_file_handler, $phpini_file);
|
||||
fclose($phpini_file_handler);
|
||||
safe_exec('chown root:0 ' . escapeshellarg($phpini_filename));
|
||||
safe_exec('chmod 0644 ' . escapeshellarg($phpini_filename));
|
||||
// create starter-file | config-file
|
||||
$php->getInterface()->createConfig($phpconfig);
|
||||
|
||||
// create php.ini
|
||||
// @TODO make php-fpm support this
|
||||
$php->getInterface()->createIniFile($phpconfig);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -61,6 +61,12 @@ class lighttpd
|
||||
|
||||
public function reload()
|
||||
{
|
||||
if((int)$this->settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
fwrite($this->debugHandler, ' lighttpd::reload: reloading php-fpm' . "\n");
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading php-fpm');
|
||||
safe_exec(escapeshellcmd($this->settings['phpfpm']['reload']));
|
||||
}
|
||||
fwrite($this->debugHandler, ' lighttpd::reload: reloading lighttpd' . "\n");
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading lighttpd');
|
||||
safe_exec(escapeshellcmd($this->settings['system']['apachereload_command']));
|
||||
@@ -138,6 +144,38 @@ class lighttpd
|
||||
$this->lighttpd_data[$vhost_filename].= ' }' . "\n";
|
||||
*/
|
||||
|
||||
/**
|
||||
* own php-fpm vhost
|
||||
*/
|
||||
if((int)$this->settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$domain = array(
|
||||
'id' => 'none',
|
||||
'domain' => $this->settings['system']['hostname'],
|
||||
'adminid' => 1, /* first admin-user (superadmin) */
|
||||
'mod_fcgid_starter' => -1,
|
||||
'mod_fcgid_maxrequests' => -1,
|
||||
'guid' => $this->settings['phpfpm']['vhost_httpuser'],
|
||||
'openbasedir' => 0,
|
||||
'safemode' => '0',
|
||||
'email' => $this->settings['panel']['adminmail'],
|
||||
'loginname' => 'froxlor.panel',
|
||||
'documentroot' => $mypath
|
||||
);
|
||||
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
|
||||
$this->lighttpd_data[$vhost_filename].= ' fastcgi.server = ( '."\n";
|
||||
$this->lighttpd_data[$vhost_filename].= "\t".'".php" => ('."\n";
|
||||
$this->lighttpd_data[$vhost_filename].= "\t\t".'"localhost" => ('."\n";
|
||||
$this->lighttpd_data[$vhost_filename].= "\t\t".'"socket" => "'.$php->getInterface()->getSocketFile().'",'."\n";
|
||||
$this->lighttpd_data[$vhost_filename].= "\t\t".'"check-local" => "enable",'."\n";
|
||||
$this->lighttpd_data[$vhost_filename].= "\t\t".'"disable-time" => 1'."\n";
|
||||
$this->lighttpd_data[$vhost_filename].= "\t".')'."\n";
|
||||
$this->lighttpd_data[$vhost_filename].= "\t".')'."\n";
|
||||
$this->lighttpd_data[$vhost_filename].= ' )'."\n";
|
||||
}
|
||||
|
||||
if($row_ipsandports['specialsettings'] != '')
|
||||
{
|
||||
$this->lighttpd_data[$vhost_filename].= $row_ipsandports['specialsettings'] . "\n";
|
||||
|
||||
@@ -28,241 +28,86 @@ if(@php_sapi_name() != 'cli'
|
||||
|
||||
class lighttpd_fcgid extends lighttpd
|
||||
{
|
||||
private $php_configs_cache = array();
|
||||
private $admin_cache = array();
|
||||
|
||||
protected function composePhpOptions($domain)
|
||||
{
|
||||
$php_options_text = '';
|
||||
|
||||
if($domain['phpenabled'] == '1')
|
||||
{
|
||||
// This vHost has PHP enabled and we are using mod_fcgid
|
||||
//create basic variables for config
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);
|
||||
|
||||
$configdir = makeCorrectDir($this->settings['system']['mod_fcgid_configdir'] . '/' . $domain['loginname'] . '/' . $domain['domain'] . '/');
|
||||
$starter_filename = makeCorrectFile($configdir . '/php-fcgi-starter');
|
||||
$phpini_filename = makeCorrectFile($configdir . '/php.ini');
|
||||
$tmpdir = makeCorrectDir($this->settings['system']['mod_fcgid_tmpdir'] . '/' . $domain['loginname'] . '/');
|
||||
|
||||
// create config dir if necessary
|
||||
|
||||
if(!is_dir($configdir))
|
||||
// vhost data for php-fpm
|
||||
if((int)$this->settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
safe_exec('chown ' . $domain['guid'] . ':' . $domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||
}
|
||||
|
||||
// create tmp dir if necessary
|
||||
|
||||
if(!is_dir($tmpdir))
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chown -R ' . $domain['guid'] . ':' . $domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||
}
|
||||
|
||||
// Load php config
|
||||
|
||||
$phpconfig = $this->getPhpConfig((int)$domain['phpsettingid']);
|
||||
|
||||
$php_options_text = ' fastcgi.server = ( '."\n";
|
||||
$file_extensions = explode(' ', $phpconfig['file_extensions']);
|
||||
foreach($file_extensions as $f_extension)
|
||||
{
|
||||
$php_options_text.= "\t".'".'.$f_extension.'" => ('."\n";
|
||||
$php_options_text = ' fastcgi.server = ( '."\n";
|
||||
$php_options_text.= "\t".'".php" => ('."\n";
|
||||
$php_options_text.= "\t\t".'"localhost" => ('."\n";
|
||||
$php_options_text.= "\t\t".'"socket" => "/var/run/lighttpd/'.$domain['loginname'].'-'.$domain['domain'].'-php.socket",'."\n";
|
||||
$php_options_text.= "\t\t".'"bin-path" => "'.$phpconfig['binary'].' -c '.$phpini_filename.'",'."\n";
|
||||
$php_options_text.= "\t\t".'"bin-environment" => ('."\n";
|
||||
if((int)$domain['mod_fcgid_starter'] != - 1)
|
||||
$php_options_text.= "\t\t".'"socket" => "'.$php->getInterface()->getSocketFile().'",'."\n";
|
||||
$php_options_text.= "\t\t".'"check-local" => "enable",'."\n";
|
||||
$php_options_text.= "\t\t".'"disable-time" => 1'."\n";
|
||||
$php_options_text.= "\t".')'."\n";
|
||||
$php_options_text.= "\t".')'."\n";
|
||||
$php_options_text.= ' )'."\n";
|
||||
}
|
||||
// vhost data for fcgid
|
||||
elseif((int)$this->settings['system']['mod_fcgid'] == 1)
|
||||
{
|
||||
$php_options_text = ' fastcgi.server = ( '."\n";
|
||||
$file_extensions = explode(' ', $phpconfig['file_extensions']);
|
||||
foreach($file_extensions as $f_extension)
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$domain['mod_fcgid_starter'] . '",'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_starter'] != - 1)
|
||||
$php_options_text.= "\t".'".'.$f_extension.'" => ('."\n";
|
||||
$php_options_text.= "\t\t".'"localhost" => ('."\n";
|
||||
$php_options_text.= "\t\t".'"socket" => "/var/run/lighttpd/'.$domain['loginname'].'-'.$domain['domain'].'-php.socket",'."\n";
|
||||
$php_options_text.= "\t\t".'"bin-path" => "'.$phpconfig['binary'].' -c '.$php->getInterface()->getIniFile().'",'."\n";
|
||||
$php_options_text.= "\t\t".'"bin-environment" => ('."\n";
|
||||
if((int)$domain['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$phpconfig['mod_fcgid_starter'] . '",'."\n";
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$domain['mod_fcgid_starter'] . '",'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$this->settings['system']['mod_fcgid_starter'] . '",'."\n";
|
||||
if((int)$phpconfig['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$phpconfig['mod_fcgid_starter'] . '",'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$this->settings['system']['mod_fcgid_starter'] . '",'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((int)$domain['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_MAX_REQUESTS" => "' . (int)$domain['mod_fcgid_maxrequests'] . '"'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_maxrequests'] != - 1)
|
||||
|
||||
if((int)$domain['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_MAX_REQUESTS" => "' . (int)$phpconfig['mod_fcgid_maxrequests'] . '"'."\n";
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_MAX_REQUESTS" => "' . (int)$domain['mod_fcgid_maxrequests'] . '"'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_MAX_REQUESTS" => "' . (int)$this->settings['system']['mod_fcgid_maxrequests'] . '"'."\n";
|
||||
if((int)$phpconfig['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_MAX_REQUESTS" => "' . (int)$phpconfig['mod_fcgid_maxrequests'] . '"'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_MAX_REQUESTS" => "' . (int)$this->settings['system']['mod_fcgid_maxrequests'] . '"'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$php_options_text.= "\t\t".')'."\n";
|
||||
$php_options_text.= "\t".')'."\n";
|
||||
$php_options_text.= "\t".')'."\n";
|
||||
|
||||
} // foreach extension
|
||||
$php_options_text.= ' )'."\n";
|
||||
|
||||
// create starter
|
||||
|
||||
$starter_file = "#!/bin/sh\n\n";
|
||||
$starter_file.= "#\n";
|
||||
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $domain['domain'] . "' with id #" . $domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
|
||||
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$starter_file.= "#\n\n";
|
||||
$starter_file.= "umask 022\n";
|
||||
$starter_file.= "PHPRC=" . escapeshellarg($configdir) . "\n";
|
||||
$starter_file.= "export PHPRC\n";
|
||||
|
||||
// set number of processes for one domain
|
||||
|
||||
if((int)$domain['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$domain['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$phpconfig['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$this->settings['system']['mod_fcgid_starter'] . "\n";
|
||||
}
|
||||
|
||||
$php_options_text.= "\t\t".')'."\n";
|
||||
$php_options_text.= "\t".')'."\n";
|
||||
$php_options_text.= "\t".')'."\n";
|
||||
|
||||
} // foreach extension
|
||||
$php_options_text.= ' )'."\n";
|
||||
}
|
||||
|
||||
$starter_file.= "export PHP_FCGI_CHILDREN\n";
|
||||
|
||||
// set number of maximum requests for one domain
|
||||
|
||||
if((int)$domain['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$domain['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_maxrequests'] != - 1)
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$phpconfig['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$this->settings['system']['mod_fcgid_maxrequests'] . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$starter_file.= "export PHP_FCGI_MAX_REQUESTS\n";
|
||||
|
||||
// Set Binary
|
||||
|
||||
$starter_file.= "exec " . $phpconfig['binary'] . " -c " . escapeshellarg($configdir) . "\n";
|
||||
|
||||
//remove +i attibute, so starter can be overwritten
|
||||
|
||||
if(file_exists($starter_filename))
|
||||
{
|
||||
removeImmutable($starter_filename);
|
||||
}
|
||||
|
||||
$starter_file_handler = fopen($starter_filename, 'w');
|
||||
fwrite($starter_file_handler, $starter_file);
|
||||
fclose($starter_file_handler);
|
||||
safe_exec('chmod 750 ' . escapeshellarg($starter_filename));
|
||||
safe_exec('chown ' . $domain['guid'] . ':' . $domain['guid'] . ' ' . escapeshellarg($starter_filename));
|
||||
setImmutable($starter_filename);
|
||||
|
||||
// define the php.ini
|
||||
|
||||
$openbasedir = '';
|
||||
$openbasedirc = ';';
|
||||
|
||||
if($domain['openbasedir'] == '1')
|
||||
{
|
||||
$openbasedirc = '';
|
||||
$_phpappendopenbasedir = '';
|
||||
|
||||
$_custom_openbasedir = explode(':', $this->settings['system']['mod_fcgid_peardir']);
|
||||
foreach($_custom_openbasedir as $cobd)
|
||||
{
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
$_custom_openbasedir = explode(':', $this->settings['system']['phpappendopenbasedir']);
|
||||
foreach($_custom_openbasedir as $cobd)
|
||||
{
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
if($domain['openbasedir_path'] == '0' && strstr($domain['documentroot'], ":") === false)
|
||||
{
|
||||
$openbasedir = appendOpenBasedirPath($domain['documentroot'], true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$openbasedir = appendOpenBasedirPath($domain['customerroot'], true);
|
||||
}
|
||||
|
||||
$openbasedir .= appendOpenBasedirPath($tmpdir);
|
||||
$openbasedir .= $_phpappendopenbasedir;
|
||||
|
||||
$openbasedir = explode(':', $openbasedir);
|
||||
$clean_openbasedir = array();
|
||||
foreach($openbasedir as $number => $path)
|
||||
{
|
||||
if(trim($path) != '/')
|
||||
{
|
||||
$clean_openbasedir[] = makeCorrectDir($path);
|
||||
}
|
||||
}
|
||||
$openbasedir = implode(':', $clean_openbasedir);
|
||||
}
|
||||
else
|
||||
{
|
||||
$openbasedir = 'none';
|
||||
$openbasedirc = ';';
|
||||
}
|
||||
|
||||
$admin = $this->getAdminData($domain['adminid']);
|
||||
$php_ini_variables = array(
|
||||
'SAFE_MODE' => ($domain['safemode'] == '0' ? 'Off' : 'On'),
|
||||
'PEAR_DIR' => $this->settings['system']['mod_fcgid_peardir'],
|
||||
'OPEN_BASEDIR' => $openbasedir,
|
||||
'OPEN_BASEDIR_C' => $openbasedirc,
|
||||
'OPEN_BASEDIR_GLOBAL' => $this->settings['system']['phpappendopenbasedir'],
|
||||
'TMP_DIR' => $tmpdir,
|
||||
'CUSTOMER_EMAIL' => $domain['email'],
|
||||
'ADMIN_EMAIL' => $admin['email'],
|
||||
'DOMAIN' => $domain['domain'],
|
||||
'CUSTOMER' => $domain['loginname'],
|
||||
'ADMIN' => $admin['loginname']
|
||||
);
|
||||
|
||||
//insert a small header for the file
|
||||
|
||||
$phpini_file = ";\n";
|
||||
$phpini_file.= "; php.ini created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $domain['domain'] . "' with id #" . $domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
|
||||
$phpini_file.= "; Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$phpini_file.= ";\n\n";
|
||||
$phpini_file.= replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_file = str_replace('"none"', 'none', $phpini_file);
|
||||
$phpini_file = preg_replace('/\"+/', '"', $phpini_file);
|
||||
$phpini_file_handler = fopen($phpini_filename, 'w');
|
||||
fwrite($phpini_file_handler, $phpini_file);
|
||||
fclose($phpini_file_handler);
|
||||
safe_exec('chown root:0 ' . escapeshellarg($phpini_filename));
|
||||
safe_exec('chmod 0644 ' . escapeshellarg($phpini_filename));
|
||||
// create starter-file | config-file
|
||||
$php->getInterface()->createConfig($phpconfig);
|
||||
|
||||
// create php.ini
|
||||
// @TODO make php-fpm support this
|
||||
$php->getInterface()->createIniFile($phpconfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -272,36 +117,46 @@ class lighttpd_fcgid extends lighttpd
|
||||
return $php_options_text;
|
||||
}
|
||||
|
||||
private function getPhpConfig($php_config_id)
|
||||
public function createOwnVhostStarter()
|
||||
{
|
||||
$php_config_id = intval($php_config_id);
|
||||
if ($this->settings['phpfpm']['enabled'] == '1'
|
||||
&& $this->settings['phpfpm']['enabled_ownvhost'] == '1'
|
||||
) {
|
||||
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown
|
||||
|
||||
// If domain has no config, we will use the default one.
|
||||
$user = $this->settings['phpfpm']['vhost_httpuser'];
|
||||
$group = $this->settings['phpfpm']['vhost_httpgroup'];
|
||||
|
||||
if($php_config_id == 0)
|
||||
{
|
||||
$php_config_id = 1;
|
||||
$domain = array(
|
||||
'id' => 'none',
|
||||
'domain' => $this->settings['system']['hostname'],
|
||||
'adminid' => 1, /* first admin-user (superadmin) */
|
||||
'mod_fcgid_starter' => -1,
|
||||
'mod_fcgid_maxrequests' => -1,
|
||||
'guid' => $user,
|
||||
'openbasedir' => 0,
|
||||
'safemode' => '0',
|
||||
'email' => $this->settings['panel']['adminmail'],
|
||||
'loginname' => 'froxlor.panel',
|
||||
'documentroot' => $mypath
|
||||
);
|
||||
|
||||
// all the files and folders have to belong to the local user
|
||||
// now because we also use fcgid for our own vhost
|
||||
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
|
||||
|
||||
// get php.ini for our own vhost
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
|
||||
// @FIXME don't use fcgid settings, but we don't have anything else atm
|
||||
$phpconfig = $php->getPhpConfig($this->settings['system']['mod_fcgid_defaultini_ownvhost']);
|
||||
|
||||
// create starter-file | config-file
|
||||
$php->getInterface()->createConfig($phpconfig);
|
||||
|
||||
// create php.ini
|
||||
// @TODO make php-fpm support this
|
||||
$php->getInterface()->createIniFile($phpconfig);
|
||||
}
|
||||
|
||||
if(!isset($this->php_configs_cache[$php_config_id]))
|
||||
{
|
||||
$this->php_configs_cache[$php_config_id] = $this->getDB()->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$php_config_id);
|
||||
}
|
||||
|
||||
return $this->php_configs_cache[$php_config_id];
|
||||
}
|
||||
|
||||
private function getAdminData($adminid)
|
||||
{
|
||||
$adminid = intval($adminid);
|
||||
|
||||
if(!isset($this->admin_cache[$adminid]))
|
||||
{
|
||||
$this->admin_cache[$adminid] = $this->getDB()->query_first("SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = " . (int)$adminid);
|
||||
}
|
||||
|
||||
return $this->admin_cache[$adminid];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -64,12 +64,19 @@ class nginx
|
||||
/**
|
||||
* nginx does not auto-spawn fcgi-processes
|
||||
*/
|
||||
if ($this->settings['system']['phpreload_command'] != '')
|
||||
{
|
||||
fwrite($this->debugHandler, ' nginx::reload: restarting php processes' . "\n");
|
||||
if ($this->settings['system']['phpreload_command'] != ''
|
||||
&& (int)$this->settings['phpfpm']['enabled'] == 0
|
||||
) {
|
||||
fwrite($this->debugHandler, ' nginx::reload: restarting php processes' . "\n");
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'restarting php processes');
|
||||
safe_exec($this->settings['system']['phpreload_command']);
|
||||
}
|
||||
elseif((int)$this->settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
fwrite($this->debugHandler, ' nginx::reload: reloading php-fpm' . "\n");
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading php-fpm');
|
||||
safe_exec(escapeshellcmd($this->settings['phpfpm']['reload']));
|
||||
}
|
||||
}
|
||||
|
||||
public function createVirtualHosts()
|
||||
@@ -103,7 +110,7 @@ class nginx
|
||||
|
||||
if(!isset($this->nginx_data[$vhosts_filename]))
|
||||
{
|
||||
$this->vnginx_data[$vhosts_filename] = '';
|
||||
$this->nginx_data[$vhosts_filename] = '';
|
||||
}
|
||||
|
||||
if($this->settings['defaultwebsrverrhandler']['err401'] != '')
|
||||
@@ -221,8 +228,30 @@ class nginx
|
||||
$this->nginx_data[$vhost_filename].= "\t".'location ~ \.php$ {'."\n";
|
||||
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_index index.php;'."\n";
|
||||
$this->nginx_data[$vhost_filename].= "\t\t".'include /etc/nginx/fastcgi_params;'."\n";
|
||||
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_param SCRIPT_FILENAME $document_root' . '$fastcgi_script_name;'."\n";
|
||||
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_pass ' . $this->settings['system']['nginx_php_backend'] . ';' . "\n";
|
||||
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'."\n";
|
||||
if((int)$this->settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$domain = array(
|
||||
'id' => 'none',
|
||||
'domain' => $this->settings['system']['hostname'],
|
||||
'adminid' => 1, /* first admin-user (superadmin) */
|
||||
'mod_fcgid_starter' => -1,
|
||||
'mod_fcgid_maxrequests' => -1,
|
||||
'guid' => $this->settings['phpfpm']['vhost_httpuser'],
|
||||
'openbasedir' => 0,
|
||||
'safemode' => '0',
|
||||
'email' => $this->settings['panel']['adminmail'],
|
||||
'loginname' => 'froxlor.panel',
|
||||
'documentroot' => $mypath
|
||||
);
|
||||
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_pass unix:' . $php->getInterface()->getSocketFile() . ';' . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_pass ' . $this->settings['system']['nginx_php_backend'] . ';' . "\n";
|
||||
}
|
||||
$this->nginx_data[$vhost_filename].= "\t".'}'."\n";
|
||||
|
||||
$this->nginx_data[$vhost_filename].= '}' . "\n\n";
|
||||
@@ -495,7 +524,7 @@ class nginx
|
||||
$query = "SELECT * FROM " . TABLE_PANEL_HTPASSWDS . " WHERE `customerid`='" . $domain['customerid'] . "'";
|
||||
$result = $this->db->query($query);
|
||||
|
||||
$result = array();
|
||||
$returnval = array();
|
||||
$x = 0;
|
||||
while($row_htpasswds = $this->db->fetch_array($result))
|
||||
{
|
||||
@@ -515,13 +544,13 @@ class nginx
|
||||
|
||||
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
|
||||
$result[$x]['path'] = $path;
|
||||
$result[$x]['root'] = makeCorrectDir($domain['documentroot']);
|
||||
$result[$x]['usrf'] = $htpasswd_filename;
|
||||
$returnval[$x]['path'] = $path;
|
||||
$returnval[$x]['root'] = makeCorrectDir($domain['documentroot']);
|
||||
$returnval[$x]['usrf'] = $htpasswd_filename;
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
return $returnval;
|
||||
}
|
||||
|
||||
protected function composePhpOptions($domain)
|
||||
@@ -532,7 +561,7 @@ class nginx
|
||||
$phpopts = "\t".'location ~ \.php$ {'."\n";
|
||||
$phpopts.= "\t\t".'fastcgi_index index.php;'."\n";
|
||||
$phpopts.= "\t\t".'include /etc/nginx/fastcgi_params;'."\n";
|
||||
$phpopts.= "\t\t".'fastcgi_param SCRIPT_FILENAME $document_root' . '$fastcgi_script_name;'."\n";
|
||||
$phpopts.= "\t\t".'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'."\n";
|
||||
$phpopts.= "\t\t".'fastcgi_pass ' . $this->settings['system']['nginx_php_backend'] . ';' . "\n";
|
||||
$phpopts.= "\t".'}'."\n";
|
||||
}
|
||||
|
||||
104
scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php
Normal file
104
scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* This script creates the php.ini's used by mod_suPHP+php-cgi
|
||||
*/
|
||||
|
||||
if(@php_sapi_name() != 'cli'
|
||||
&& @php_sapi_name() != 'cgi'
|
||||
&& @php_sapi_name() != 'cgi-fcgi')
|
||||
{
|
||||
die('This script only works in the shell.');
|
||||
}
|
||||
|
||||
class nginx_phpfpm extends nginx
|
||||
{
|
||||
protected function composePhpOptions($domain)
|
||||
{
|
||||
$php_options_text = '';
|
||||
|
||||
if($domain['phpenabled'] == '1')
|
||||
{
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);
|
||||
|
||||
$php_options_text = "\t".'location ~ \.php$ {'."\n";
|
||||
$php_options_text.= "\t\t".'fastcgi_index index.php;'."\n";
|
||||
$php_options_text.= "\t\t".'include /etc/nginx/fastcgi_params;'."\n";
|
||||
$php_options_text.= "\t\t".'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'."\n";
|
||||
$php_options_text.= "\t\t".'fastcgi_pass unix:' . $php->getInterface()->getSocketFile() . ';' . "\n";
|
||||
$php_options_text.= "\t".'}'."\n";
|
||||
|
||||
// create starter-file | config-file
|
||||
$php->getInterface()->createConfig($phpconfig);
|
||||
|
||||
// create php.ini
|
||||
// @TODO make php-fpm support this
|
||||
$php->getInterface()->createIniFile($phpconfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
$php_options_text.= ' # PHP is disabled for this vHost' . "\n";
|
||||
}
|
||||
|
||||
return $php_options_text;
|
||||
}
|
||||
|
||||
public function createOwnVhostStarter()
|
||||
{
|
||||
if ($this->settings['phpfpm']['enabled'] == '1'
|
||||
&& $this->settings['phpfpm']['enabled_ownvhost'] == '1'
|
||||
) {
|
||||
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown
|
||||
|
||||
$user = $this->settings['phpfpm']['vhost_httpuser'];
|
||||
$group = $this->settings['phpfpm']['vhost_httpgroup'];
|
||||
|
||||
$domain = array(
|
||||
'id' => 'none',
|
||||
'domain' => $this->settings['system']['hostname'],
|
||||
'adminid' => 1, /* first admin-user (superadmin) */
|
||||
'mod_fcgid_starter' => -1,
|
||||
'mod_fcgid_maxrequests' => -1,
|
||||
'guid' => $user,
|
||||
'openbasedir' => 0,
|
||||
'safemode' => '0',
|
||||
'email' => $this->settings['panel']['adminmail'],
|
||||
'loginname' => 'froxlor.panel',
|
||||
'documentroot' => $mypath
|
||||
);
|
||||
|
||||
// all the files and folders have to belong to the local user
|
||||
// now because we also use fcgid for our own vhost
|
||||
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
|
||||
|
||||
// get php.ini for our own vhost
|
||||
$php = new phpinterface($this->getDB(), $this->settings, $domain);
|
||||
|
||||
// @FIXME don't use fcgid settings, but we don't have anything else atm
|
||||
$phpconfig = $php->getPhpConfig($this->settings['system']['mod_fcgid_defaultini_ownvhost']);
|
||||
|
||||
// create starter-file | config-file
|
||||
$php->getInterface()->createConfig($phpconfig);
|
||||
|
||||
// create php.ini
|
||||
// @TODO make php-fpm support this
|
||||
$php->getInterface()->createIniFile($phpconfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.15.apache
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.20.lighttpd.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.25.lighttpd_fcgid.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.30.nginx.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.35.nginx_phpfpm.php'));
|
||||
|
||||
/**
|
||||
* LOOK INTO TASKS TABLE TO SEE IF THERE ARE ANY UNDONE JOBS
|
||||
@@ -67,7 +68,7 @@ while($row = $db->fetch_array($result_tasks))
|
||||
{
|
||||
$awstatsclean['dir'] = dir($awstatsclean['path']);
|
||||
while($awstatsclean['entry'] = $awstatsclean['dir']->read()) {
|
||||
$awstatsclean['fullentry'] = $awstatsclean['path'].'/'.$awstatsclean['entry'];
|
||||
$awstatsclean['fullentry'] = makeCorrectFile($awstatsclean['path'].'/'.$awstatsclean['entry']);
|
||||
/**
|
||||
* dont do anything if the file does not exist
|
||||
*/
|
||||
@@ -120,11 +121,25 @@ while($row = $db->fetch_array($result_tasks))
|
||||
}
|
||||
}
|
||||
|
||||
// clear php-fpm-configurations prior to re-creation to keep it clean
|
||||
if ($settings['phpfpm']['enabled'] == '1')
|
||||
{
|
||||
$configdir = makeCorrectDir($settings['phpfpm']['configdir']);
|
||||
|
||||
if (is_dir($configdir))
|
||||
{
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($webserver))
|
||||
{
|
||||
if($settings['system']['webserver'] == "apache2")
|
||||
{
|
||||
if($settings['system']['mod_fcgid'] == 1)
|
||||
if($settings['system']['mod_fcgid'] == 1 || $settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$webserver = new apache_fcgid($db, $cronlog, $debugHandler, $idna_convert, $settings);
|
||||
}
|
||||
@@ -135,7 +150,7 @@ while($row = $db->fetch_array($result_tasks))
|
||||
}
|
||||
elseif($settings['system']['webserver'] == "lighttpd")
|
||||
{
|
||||
if($settings['system']['mod_fcgid'] == 1)
|
||||
if($settings['system']['mod_fcgid'] == 1 || $settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$webserver = new lighttpd_fcgid($db, $cronlog, $debugHandler, $idna_convert, $settings);
|
||||
}
|
||||
@@ -146,7 +161,14 @@ while($row = $db->fetch_array($result_tasks))
|
||||
}
|
||||
elseif($settings['system']['webserver'] == "nginx")
|
||||
{
|
||||
$webserver = new nginx($db, $cronlog, $debugHandler, $idna_convert, $settings);
|
||||
if($settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$webserver = new nginx_phpfpm($db, $cronlog, $debugHandler, $idna_convert, $settings);
|
||||
}
|
||||
else
|
||||
{
|
||||
$webserver = new nginx($db, $cronlog, $debugHandler, $idna_convert, $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<IfModule mod_fastcgi.c>
|
||||
FastCgiWrapper /usr/lib/apache2/suexec
|
||||
FastCgiIpcDir /var/run/apache2/
|
||||
|
||||
<Location "/fastcgiphp">
|
||||
Order Deny,Allow
|
||||
Deny from All
|
||||
# Prevent accessing this path directly
|
||||
Allow from env=REDIRECT_STATUS
|
||||
</Location>
|
||||
</IfModule>
|
||||
@@ -1,5 +1,5 @@
|
||||
driver = mysql
|
||||
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
|
||||
default_pass_scheme = CRYPT
|
||||
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3'))
|
||||
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp')
|
||||
user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir, maildir) AS mail, uid, gid, CONCAT('maildir:storage=', (quota*1024)) as quota FROM mail_users WHERE (username = '%u' OR email = '%u')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
driver = mysql
|
||||
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
|
||||
default_pass_scheme = CRYPT
|
||||
password_query = SELECT username AS user, password_enc AS password FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3'))
|
||||
password_query = SELECT username AS user, password_enc AS password FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp')
|
||||
user_query = SELECT CONCAT(homedir,maildir) AS home, concat('maildir:',homedir,maildir) AS mail, uid, gid FROM mail_users where (username = '%u' OR email = '%u')
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<IfModule mod_fastcgi.c>
|
||||
FastCgiWrapper /usr/sbin/suexec
|
||||
FastCgiIpcDir /var/run/apache2/
|
||||
|
||||
<Location "/fastcgiphp">
|
||||
Order Deny,Allow
|
||||
Deny from All
|
||||
# Prevent accessing this path directly
|
||||
Allow from env=REDIRECT_STATUS
|
||||
</Location>
|
||||
</IfModule>
|
||||
@@ -7,4 +7,4 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
#
|
||||
# Please check that all following paths are correct
|
||||
#
|
||||
*/5 * * * * root /usr/lib/php5/bin/php -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||
*/5 * * * * root /usr/bin/php -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
driver = mysql
|
||||
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
|
||||
default_pass_scheme = CRYPT
|
||||
password_query = "SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('*:storage=', quota,'M') AS userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3'))"
|
||||
password_query = "SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('*:storage=', quota,'M') AS userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp')"
|
||||
user_query = "SELECT CONCAT(homedir, maildir) AS home, uid, gid, CONCAT('*:storage=', quota,'M') AS quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u')"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<IfModule mod_fastcgi.c>
|
||||
FastCgiWrapper /usr/lib/apache2/suexec
|
||||
FastCgiIpcDir /var/run/apache2/
|
||||
|
||||
<Location "/fastcgiphp">
|
||||
Order Deny,Allow
|
||||
Deny from All
|
||||
# Prevent accessing this path directly
|
||||
Allow from env=REDIRECT_STATUS
|
||||
</Location>
|
||||
</IfModule>
|
||||
@@ -1,5 +1,5 @@
|
||||
driver = mysql
|
||||
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
|
||||
default_pass_scheme = CRYPT
|
||||
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3'))
|
||||
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp')
|
||||
user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir, maildir) AS mail, uid, gid, CONCAT('maildir:storage=', (quota*1024)) as quota FROM mail_users WHERE (username = '%u' OR email = '%u')
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<IfModule mod_fastcgi.c>
|
||||
FastCgiWrapper /usr/lib/apache2/suexec
|
||||
FastCgiIpcDir /var/run/apache2/
|
||||
|
||||
<Location "/fastcgiphp">
|
||||
Order Deny,Allow
|
||||
Deny from All
|
||||
# Prevent accessing this path directly
|
||||
Allow from env=REDIRECT_STATUS
|
||||
</Location>
|
||||
</IfModule>
|
||||
@@ -1,6 +1,6 @@
|
||||
driver = mysql
|
||||
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
|
||||
default_pass_scheme = CRYPT
|
||||
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3'))
|
||||
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp')
|
||||
user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir, maildir) AS mail, uid, gid, CONCAT('*:storage=', (quota*1024)) as quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user