added possibility to enable slowlog for fpm-users in the php-config (domain based logs), fixes #1051
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -162,6 +162,16 @@ class phpinterface_fpm {
|
||||
}
|
||||
|
||||
$fpm_config.= 'pm.max_requests = '.$fpm_requests."\n";
|
||||
|
||||
// possible slowlog configs
|
||||
if ($phpconfig['fpm_slowlog'] == '1') {
|
||||
$fpm_config.= 'request_terminate_timeout = ' . $phpconfig['fpm_reqterm'] . "\n";
|
||||
$fpm_config.= 'request_slowlog_timeout = ' . $phpconfig['fpm_reqslow'] . "\n";
|
||||
$slowlog = makeCorrectFile($this->_settings['system']['logfiles_directory'] . '/' . $this->_domain['loginname'] . '-php-slow.log');
|
||||
$fpm_config.= 'slowlog = ' . $slowlog . "\n";
|
||||
$fpm_config.= 'catch_workers_output = yes' . "\n";
|
||||
}
|
||||
|
||||
$fpm_config.= ';chroot = '.makeCorrectDir($this->_domain['documentroot'])."\n";
|
||||
|
||||
$tmpdir = makeCorrectDir($this->_settings['phpfpm']['tmpdir'] . '/' . $this->_domain['loginname'] . '/');
|
||||
|
||||
@@ -30,12 +30,14 @@ return array(
|
||||
'maxlength' => 50
|
||||
),
|
||||
'binary' => array(
|
||||
'visible' => ($settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['binary'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 255,
|
||||
'value' => '/usr/bin/php-cgi'
|
||||
),
|
||||
'file_extensions' => array(
|
||||
'visible' => ($settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
|
||||
'type' => 'text',
|
||||
@@ -43,13 +45,38 @@ return array(
|
||||
'value' => 'php'
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => ($settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'mod_fcgid_maxrequests' => array(
|
||||
'visible' => ($settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'phpfpm_enable_slowlog' => array(
|
||||
'visible' => ($settings['phpfpm']['enabled'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
'phpfpm_reqtermtimeout' => array(
|
||||
'visible' => ($settings['phpfpm']['enabled'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 10,
|
||||
'value' => '60s'
|
||||
),
|
||||
'phpfpm_reqslowtimeout' => array(
|
||||
'visible' => ($settings['phpfpm']['enabled'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 10,
|
||||
'value' => '5s'
|
||||
),
|
||||
'phpsettings' => array(
|
||||
'style' => 'vertical-align:top;',
|
||||
'label' => $lng['admin']['phpsettings']['phpinisettings'],
|
||||
|
||||
@@ -31,12 +31,14 @@ return array(
|
||||
'value' => $result['description']
|
||||
),
|
||||
'binary' => array(
|
||||
'visible' => ($settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['binary'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 255,
|
||||
'value' => $result['binary']
|
||||
),
|
||||
'file_extensions' => array(
|
||||
'visible' => ($settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
|
||||
'type' => 'text',
|
||||
@@ -44,15 +46,40 @@ return array(
|
||||
'value' => $result['file_extensions']
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => ($settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||
'type' => 'text',
|
||||
'value' => ((int)$result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
|
||||
),
|
||||
'mod_fcgid_maxrequests' => array(
|
||||
'visible' => ($settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
|
||||
'type' => 'text',
|
||||
'value' => ((int)$result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
|
||||
),
|
||||
'phpfpm_enable_slowlog' => array(
|
||||
'visible' => ($settings['phpfpm']['enabled'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['fpm_slowlog'])
|
||||
),
|
||||
'phpfpm_reqtermtimeout' => array(
|
||||
'visible' => ($settings['phpfpm']['enabled'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 10,
|
||||
'value' => $result['fpm_reqterm']
|
||||
),
|
||||
'phpfpm_reqslowtimeout' => array(
|
||||
'visible' => ($settings['phpfpm']['enabled'] == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 10,
|
||||
'value' => $result['fpm_reqslow']
|
||||
),
|
||||
'phpsettings' => array(
|
||||
'style' => 'vertical-align:top;',
|
||||
'label' => $lng['admin']['phpsettings']['phpinisettings'],
|
||||
|
||||
@@ -72,6 +72,6 @@ define('PACKAGE_LOCKED', 1);
|
||||
define('PACKAGE_ENABLED', 2);
|
||||
|
||||
// VERSION INFO
|
||||
$version = '0.9.31-dev5';
|
||||
$version = '0.9.31-dev6';
|
||||
$dbversion = '2';
|
||||
$branding = '';
|
||||
|
||||
Reference in New Issue
Block a user