Allow configuring awstats LogFormat
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
This commit is contained in:
@@ -78,6 +78,14 @@ return array(
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/share/awstats/icon/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_awstats_logformat' => array(
|
||||
'label' => $lng['serversettings']['awstats']['logformat'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'awstats_logformat',
|
||||
'type' => 'string',
|
||||
'default' => '1',
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -703,7 +703,7 @@ opcache.interned_strings_buffer'),
|
||||
('panel', 'customer_hide_options', ''),
|
||||
('panel', 'is_configured', '0'),
|
||||
('panel', 'version', '0.10.10'),
|
||||
('panel', 'db_version', '201912310');
|
||||
('panel', 'db_version', '201912313');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_tasks`;
|
||||
|
||||
@@ -530,3 +530,10 @@ if (\Froxlor\Froxlor::isDatabaseVersion('201912100')) {
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912310');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912312')) {
|
||||
showUpdateStep("Adding option change awstats LogFormat");
|
||||
Settings::AddNew("system.awstats_logformat", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912313');
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ final class Froxlor
|
||||
const VERSION = '0.10.10';
|
||||
|
||||
// Database version (YYYYMMDDC where C is a daily counter)
|
||||
const DBVERSION = '201912310';
|
||||
const DBVERSION = '201912313';
|
||||
|
||||
// Distribution branding-tag (used for Debian etc.)
|
||||
const BRANDING = '';
|
||||
|
||||
@@ -37,20 +37,30 @@ class Statistics
|
||||
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(Settings::Get('system.awstats_conf')));
|
||||
}
|
||||
|
||||
$logformat = Settings::Get('system.awstats_logformat');
|
||||
if (! is_numeric($logformat)) {
|
||||
// if LogFormat is NOT numeric (e.g. 1,2,3,4), we quote it.
|
||||
// 1-4 are pre-defined formats by awstats which must not be quoted to work properly. So if
|
||||
// it is not a integer, it is something customized and we simply quote it.
|
||||
$logformat = '"' . str_replace('"', '\"', Settings::Get('system.awstats_logformat')) . '"';
|
||||
}
|
||||
|
||||
// These are the variables we will replace
|
||||
$regex = array(
|
||||
'/\{LOG_FILE\}/',
|
||||
'/\{SITE_DOMAIN\}/',
|
||||
'/\{HOST_ALIASES\}/',
|
||||
'/\{CUSTOMER_DOCROOT\}/',
|
||||
'/\{AWSTATS_CONF\}/'
|
||||
'/\{AWSTATS_CONF\}/',
|
||||
'/\{AWSTATS_LOGFORMAT\}/'
|
||||
);
|
||||
$replace = array(
|
||||
\Froxlor\FileDir::makeCorrectFile($logFile),
|
||||
$siteDomain,
|
||||
$hostAliases,
|
||||
$awstats_dir,
|
||||
\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_conf'))
|
||||
\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_conf')),
|
||||
$logformat
|
||||
);
|
||||
|
||||
// File names
|
||||
|
||||
@@ -2087,3 +2087,6 @@ $lng['admin']['domain_honorcipherorder'] = 'Honor the (server) cipher order, def
|
||||
$lng['admin']['domain_sessiontickets'] = 'Enable TLS sessiontickets (RFC 5077), default <strong>yes</strong>';
|
||||
$lng['admin']['domain_sessionticketsenabled']['title'] = 'Enable usage of TLS sessiontickets globally';
|
||||
$lng['admin']['domain_sessionticketsenabled']['description'] = 'Default <strong>yes</strong><br>Requires apache-2.4.11+ or nginx-1.5.9+';
|
||||
|
||||
$lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat setting';
|
||||
$lng['serversettings']['awstats']['logformat']['description'] = 'If you use customized logformat for your webserver, you need change the awstats LogFormat too.<br/>Default is 1. For more information check documentation <a target="_blank" href="https://awstats.sourceforge.io/docs/awstats_config.html#LogFormat">here</a>.';
|
||||
|
||||
@@ -1734,3 +1734,6 @@ $lng['admin']['domain_honorcipherorder'] = 'Bevorzuge die serverseitige Cipher R
|
||||
$lng['admin']['domain_sessiontickets'] = 'Aktiviere TLS Sessiontickets (RFC 5077), Standardwert <strong>ja</strong>';
|
||||
$lng['admin']['domain_sessionticketsenabled']['title'] = 'Aktiviere Nutzung von TLS Sessiontickets systemweit';
|
||||
$lng['admin']['domain_sessionticketsenabled']['description'] = 'Standardwert <strong>yes</strong><br>Erfordert apache-2.4.11+ oder nginx-1.5.9+';
|
||||
|
||||
$lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat Einstellung';
|
||||
$lng['serversettings']['awstats']['logformat']['description'] = 'Wenn ein benutzerdefiniertes LogFormat beim Webserver verwendet wird, muss LogFormat von awstats ebenso angepasst werden.<br/>Standard ist 1. Für weitere Informationen siehe Dokumentation unter <a target="_blank" href="https://awstats.sourceforge.io/docs/awstats_config.html#LogFormat">hier</a>.';
|
||||
|
||||
@@ -3,7 +3,7 @@ Include "{AWSTATS_CONF}awstats.model.conf"
|
||||
|
||||
LogFile="{LOG_FILE}"
|
||||
LogType=W
|
||||
LogFormat = 1
|
||||
LogFormat = {AWSTATS_LOGFORMAT}
|
||||
LogSeparator=" "
|
||||
SiteDomain="{SITE_DOMAIN}"
|
||||
HostAliases="{HOST_ALIASES}"
|
||||
|
||||
Reference in New Issue
Block a user