remove mod_log_sql as planned

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-03-15 08:38:29 +01:00
parent eaba3c783a
commit cbc745ff72
17 changed files with 144 additions and 418 deletions

View File

@@ -537,45 +537,31 @@ class apache
{
$stats_text = '';
if($domain['speciallogfile'] == '1'
&& $this->settings['system']['mod_log_sql'] != '1')
{
if($domain['parentdomainid'] == '0')
{
if($this->settings['system']['awstats_enabled'] == '1')
{
if($domain['speciallogfile'] == '1') {
if ($domain['parentdomainid'] == '0') {
if ($this->settings['system']['awstats_enabled'] == '1') {
$stats_text.= ' Alias /awstats "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
$stats_text.= ' Alias /awstats-icon "' . makeCorrectDir($this->settings['system']['awstats_icons']) . '"' . "\n";
}
else
{
} else {
$stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['domain']) . '"' . "\n";
}
}
else
{
if($this->settings['system']['awstats_enabled'] == '1')
{
} else {
if ($this->settings['system']['awstats_enabled'] == '1') {
$stats_text.= ' Alias /awstats "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['parentdomain']) . '"' . "\n";
$stats_text.= ' Alias /awstats-icon "' . makeCorrectDir($this->settings['system']['awstats_icons']) . '"' . "\n";
}
else
{
} else {
$stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['parentdomain']) . '"' . "\n";
}
}
}
else
{
if($domain['customerroot'] != $domain['documentroot'])
{
if($this->settings['system']['awstats_enabled'] == '1')
{
} else {
if ($domain['customerroot'] != $domain['documentroot']) {
if ($this->settings['system']['awstats_enabled'] == '1') {
$stats_text.= ' Alias /awstats "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
$stats_text.= ' Alias /awstats-icon "' . makeCorrectDir($this->settings['system']['awstats_icons']) . '"' . "\n";
}
else
{
} else {
$stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer') . '"' . "\n";
}
}
@@ -583,8 +569,7 @@ class apache
// because the stats are in /awstats/[domain], not just /awstats/
// also, the awstats-icons are someplace else too!
// -> webalizer does not need this!
elseif($this->settings['system']['awstats_enabled'] == '1')
{
elseif ($this->settings['system']['awstats_enabled'] == '1') {
$stats_text.= ' Alias /awstats "' . makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
$stats_text.= ' Alias /awstats-icon "' . makeCorrectDir($this->settings['system']['awstats_icons']) . '"' . "\n";
}
@@ -596,99 +581,65 @@ class apache
/*
* Lets set the logfiles
*/
protected function getLogfiles($domain) {
protected function getLogfiles($domain)
{
$logfiles_text = '';
if($domain['speciallogfile'] == '1'
&& $this->settings['system']['mod_log_sql'] != '1')
{
if($domain['parentdomainid'] == '0')
{
if ($domain['speciallogfile'] == '1') {
if ($domain['parentdomainid'] == '0') {
$speciallogfile = '-' . $domain['domain'];
}
else
{
} else {
$speciallogfile = '-' . $domain['parentdomain'];
}
}
else
{
} else {
$speciallogfile = '';
}
if($this->settings['system']['mod_log_sql'] == '1')
{
// We are using mod_log_sql (http://www.outoforder.cc/projects/apache/mod_log_sql/)
// TODO: See how we are able emulate the error_log
// The normal access/error - logging is enabled
$error_log = makeCorrectFile($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-error.log');
// Create the logfile if it does not exist (fixes #46)
touch($error_log);
chown($error_log, $this->settings['system']['httpuser']);
chgrp($error_log, $this->settings['system']['httpgroup']);
$logfiles_text.= ' LogSQLTransferLogTable access_log' . "\n";
}
else
{
// The normal access/error - logging is enabled
$error_log = makeCorrectFile($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-error.log');
// Create the logfile if it does not exist (fixes #46)
touch($error_log);
chown($error_log, $this->settings['system']['httpuser']);
chgrp($error_log, $this->settings['system']['httpgroup']);
$access_log = makeCorrectFile($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log');
// Create the logfile if it does not exist (fixes #46)
touch($access_log);
chown($access_log, $this->settings['system']['httpuser']);
chgrp($access_log, $this->settings['system']['httpgroup']);
$access_log = makeCorrectFile($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log');
// Create the logfile if it does not exist (fixes #46)
touch($access_log);
chown($access_log, $this->settings['system']['httpuser']);
chgrp($access_log, $this->settings['system']['httpgroup']);
$logfiles_text.= ' ErrorLog "' . $error_log . "\"\n";
$logfiles_text.= ' CustomLog "' . $access_log .'" combined' . "\n";
$logfiles_text.= ' ErrorLog "' . $error_log . "\"\n";
$logfiles_text.= ' CustomLog "' . $access_log .'" combined' . "\n";
}
if($this->settings['system']['awstats_enabled'] == '1')
{
if((int)$domain['parentdomainid'] == 0)
{
if ($this->settings['system']['awstats_enabled'] == '1') {
if ((int)$domain['parentdomainid'] == 0) {
// prepare the aliases and subdomains for stats config files
$server_alias = '';
$alias_domains = $this->db->query('SELECT `domain`, `iswildcarddomain`, `wwwserveralias` FROM `' . TABLE_PANEL_DOMAINS . '`
WHERE `aliasdomain`=\'' . $domain['id'] . '\'
OR `parentdomainid` =\''. $domain['id']. '\'');
while(($alias_domain = $this->db->fetch_array($alias_domains)) !== false)
{
while (($alias_domain = $this->db->fetch_array($alias_domains)) !== false) {
$server_alias.= ' ' . $alias_domain['domain'] . ' ';
if($alias_domain['iswildcarddomain'] == '1')
{
if ($alias_domain['iswildcarddomain'] == '1') {
$server_alias.= '*.' . $alias_domain['domain'];
}
else
{
if($alias_domain['wwwserveralias'] == '1')
{
} else {
if ($alias_domain['wwwserveralias'] == '1') {
$server_alias.= 'www.' . $alias_domain['domain'];
}
else
{
} else {
$server_alias.= '';
}
}
}
if($domain['iswildcarddomain'] == '1')
{
if ($domain['iswildcarddomain'] == '1') {
$alias = '*.' . $domain['domain'];
}
else
{
if($domain['wwwserveralias'] == '1')
{
} else {
if ($domain['wwwserveralias'] == '1') {
$alias = 'www.' . $domain['domain'];
}
else
{
} else {
$alias = '';
}
}