From 9b843a8ad58ab5f095cbab63a6e499edb4deb259 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 22 Mar 2010 12:36:59 +0000 Subject: [PATCH] merging awstats branch to trunk, fixes #57, fixes #58 --- actions/admin/settings/140.statistics.php | 36 ------ admin_configfiles.php | 1 - admin_customers.php | 8 +- customer_domains.php | 5 + install/froxlor.sql | 88 +++++++------- lib/configfiles/etch.inc.php | 14 +-- lib/configfiles/gentoo.inc.php | 13 +- lib/configfiles/hardy.inc.php | 14 +-- lib/configfiles/lenny.inc.php | 14 +-- lib/configfiles/suse10.inc.php | 10 +- lib/functions/filedir/function.safe_exec.php | 5 +- .../froxlor/function.createAWStatsConf.php | 36 ++++-- .../function.getCustomerIdByDomain.php | 21 ++++ .../jobs/cron_tasks.inc.http.10.apache.php | 99 ++++++++------- .../jobs/cron_tasks.inc.http.20.lighttpd.php | 115 +++++++++++++++++- scripts/jobs/cron_tasks.php | 7 +- scripts/jobs/cron_traffic.inc.functions.php | 115 +++++++++++++++++- scripts/jobs/cron_traffic.php | 18 ++- .../customer/domains/domains_delimiter.tpl | 2 +- .../awstats.froxlor.model.conf} | 3 +- .../awstats.froxlor.model_log_sql.conf} | 3 +- .../awstats/etc_apache_vhosts_05_awstats.conf | 14 --- .../awstats/etc_awstats.model.conf | 9 ++ .../etc_awstats_awstats.model.conf.froxlor | 9 -- ...awstats_awstats.model_log_sql.conf.froxlor | 9 -- .../debian_etch/awstats/etc_cron.d_awstats | 6 - .../awstats/etc_cron.d_awstats_log_sql | 6 - .../awstats/etc_lighttpd_froxlor-awstats.conf | 19 --- .../awstats/etc_apache_vhosts_05_awstats.conf | 14 --- .../awstats/etc_awstats.model.conf | 9 ++ .../etc_awstats_awstats.model.conf.froxlor | 9 -- .../debian_lenny/awstats/etc_cron.d_awstats | 6 - .../awstats/etc_cron.d_awstats_log_sql | 6 - .../awstats/etc_lighttpd_froxlor-awstats.conf | 19 --- .../awstats/etc_apache_vhosts_05_awstats.conf | 14 --- .../gentoo/awstats/etc_awstats.model.conf | 9 ++ ...awstats_awstats.model_log_sql.conf.froxlor | 9 -- .../gentoo/awstats/etc_cron.d_awstats | 6 - .../gentoo/awstats/etc_cron.d_awstats_log_sql | 6 - .../awstats/etc_lighttpd_froxlor-awstats.conf | 19 --- .../awstats/etc_apache_vhosts_05_awstats.conf | 14 --- .../awstats/etc_awstats.model.conf | 9 ++ .../etc_awstats_awstats.model.conf.froxlor | 9 -- ...awstats_awstats.model_log_sql.conf.froxlor | 9 -- .../awstats/etc_cron.d_awstats | 6 - .../awstats/etc_cron.d_awstats_log_sql | 6 - .../awstats/etc_lighttpd_froxlor-awstats.conf | 19 --- .../awstats/etc_apache_vhosts_05_awstats.conf | 14 --- .../awstats/etc_awstats.model.conf | 9 ++ .../etc_awstats_awstats.model.conf.froxlor | 9 -- ...awstats_awstats.model_log_sql.conf.froxlor | 9 -- .../ubuntu_hardy/awstats/etc_cron.d_awstats | 6 - .../awstats/etc_cron.d_awstats_log_sql | 6 - .../awstats/etc_lighttpd_froxlor-awstats.conf | 19 --- 54 files changed, 471 insertions(+), 498 deletions(-) create mode 100644 lib/functions/froxlor/function.getCustomerIdByDomain.php rename templates/misc/{configfiles/gentoo/awstats/etc_awstats_awstats.model.conf.froxlor => awstatsmodel/awstats.froxlor.model.conf} (72%) rename templates/misc/{configfiles/debian_lenny/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor => awstatsmodel/awstats.froxlor.model_log_sql.conf} (79%) delete mode 100644 templates/misc/configfiles/debian_etch/awstats/etc_apache_vhosts_05_awstats.conf create mode 100644 templates/misc/configfiles/debian_etch/awstats/etc_awstats.model.conf delete mode 100644 templates/misc/configfiles/debian_etch/awstats/etc_awstats_awstats.model.conf.froxlor delete mode 100644 templates/misc/configfiles/debian_etch/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor delete mode 100644 templates/misc/configfiles/debian_etch/awstats/etc_cron.d_awstats delete mode 100644 templates/misc/configfiles/debian_etch/awstats/etc_cron.d_awstats_log_sql delete mode 100644 templates/misc/configfiles/debian_etch/awstats/etc_lighttpd_froxlor-awstats.conf delete mode 100644 templates/misc/configfiles/debian_lenny/awstats/etc_apache_vhosts_05_awstats.conf create mode 100644 templates/misc/configfiles/debian_lenny/awstats/etc_awstats.model.conf delete mode 100644 templates/misc/configfiles/debian_lenny/awstats/etc_awstats_awstats.model.conf.froxlor delete mode 100644 templates/misc/configfiles/debian_lenny/awstats/etc_cron.d_awstats delete mode 100644 templates/misc/configfiles/debian_lenny/awstats/etc_cron.d_awstats_log_sql delete mode 100644 templates/misc/configfiles/debian_lenny/awstats/etc_lighttpd_froxlor-awstats.conf delete mode 100644 templates/misc/configfiles/gentoo/awstats/etc_apache_vhosts_05_awstats.conf create mode 100644 templates/misc/configfiles/gentoo/awstats/etc_awstats.model.conf delete mode 100644 templates/misc/configfiles/gentoo/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor delete mode 100644 templates/misc/configfiles/gentoo/awstats/etc_cron.d_awstats delete mode 100644 templates/misc/configfiles/gentoo/awstats/etc_cron.d_awstats_log_sql delete mode 100644 templates/misc/configfiles/gentoo/awstats/etc_lighttpd_froxlor-awstats.conf delete mode 100644 templates/misc/configfiles/suse_linux_10_0/awstats/etc_apache_vhosts_05_awstats.conf create mode 100644 templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats.model.conf delete mode 100644 templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats_awstats.model.conf.froxlor delete mode 100644 templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor delete mode 100644 templates/misc/configfiles/suse_linux_10_0/awstats/etc_cron.d_awstats delete mode 100644 templates/misc/configfiles/suse_linux_10_0/awstats/etc_cron.d_awstats_log_sql delete mode 100644 templates/misc/configfiles/suse_linux_10_0/awstats/etc_lighttpd_froxlor-awstats.conf delete mode 100644 templates/misc/configfiles/ubuntu_hardy/awstats/etc_apache_vhosts_05_awstats.conf create mode 100644 templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats.model.conf delete mode 100644 templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats_awstats.model.conf.froxlor delete mode 100644 templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor delete mode 100644 templates/misc/configfiles/ubuntu_hardy/awstats/etc_cron.d_awstats delete mode 100644 templates/misc/configfiles/ubuntu_hardy/awstats/etc_cron.d_awstats_log_sql delete mode 100644 templates/misc/configfiles/ubuntu_hardy/awstats/etc_lighttpd_froxlor-awstats.conf diff --git a/actions/admin/settings/140.statistics.php b/actions/admin/settings/140.statistics.php index 0c678b55..5062db9b 100644 --- a/actions/admin/settings/140.statistics.php +++ b/actions/admin/settings/140.statistics.php @@ -40,42 +40,6 @@ return array( 'default' => false, 'save_method' => 'storeSettingField', ), - 'system_awstats_domain_file' => array( - 'label' => $lng['serversettings']['awstats_domain_file'], - 'settinggroup' => 'system', - 'varname' => 'awstats_domain_file', - 'type' => 'string', - 'string_type' => 'dir', - 'default' => '/etc/awstats/', - 'save_method' => 'storeSettingField', - ), - 'system_awstats_model_file' => array( - 'label' => $lng['serversettings']['awstats_model_file'], - 'settinggroup' => 'system', - 'varname' => 'awstats_model_file', - 'type' => 'string', - 'string_type' => 'file', - 'default' => '/etc/awstats/awstats.model.conf.syscp', - 'save_method' => 'storeSettingField', - ), - 'system_awstats_path' => array( - 'label' => $lng['serversettings']['awstats_path'], - 'settinggroup' => 'system', - 'varname' => 'awstats_path', - 'type' => 'string', - 'string_type' => 'dir', - 'default' => '/usr/share/awstats/VERSION/webroot/cgi-bin/', - 'save_method' => 'storeSettingField', - ), - 'system_awstats_updateall_command' => array( - 'label' => $lng['serversettings']['awstats_updateall_command'], - 'settinggroup' => 'system', - 'varname' => 'awstats_updateall_command', - 'type' => 'string', - 'string_type' => 'file', - 'default' => '/usr/bin/awstats_updateall.pl', - 'save_method' => 'storeSettingField', - ), ), ), ), diff --git a/admin_configfiles.php b/admin_configfiles.php index 92629834..ff463d35 100644 --- a/admin_configfiles.php +++ b/admin_configfiles.php @@ -95,7 +95,6 @@ if($userinfo['change_serversettings'] == '1') '' => $settings['system']['vmail_homedir'], '' => $settings['system']['vmail_uid'], '' => $settings['system']['vmail_gid'], - '' => $settings['system']['awstats_path'], '' => ($settings['system']['use_ssl'] == '1') ? 'imaps pop3s' : '', '' => $settings['system']['realtime_port'], '' => ($settings['system']['mod_fcgid_tmpdir'] != '') ? makeCorrectDir($settings['system']['mod_fcgid_tmpdir']) : '/tmp/' diff --git a/admin_customers.php b/admin_customers.php index dbde305d..091d70ca 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -568,14 +568,16 @@ if($page == 'customers' $htpasswdPassword = crypt($password); } - $db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/webalizer/')) . "')"); - $log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added webalizer htpasswd for user '" . $loginname . "'"); - if($settings['system']['awstats_enabled'] == '1') { $db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/awstats/')) . "')"); $log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added awstats htpasswd for user '" . $loginname . "'"); } + else + { + $db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/webalizer/')) . "')"); + $log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added webalizer htpasswd for user '" . $loginname . "'"); + } inserttask('1'); $result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($documentroot) . "', 'y', '" . (int)$guid . "', '" . (int)$guid . "')"); diff --git a/customer_domains.php b/customer_domains.php index 1e6fa0e2..c2c45506 100644 --- a/customer_domains.php +++ b/customer_domains.php @@ -125,6 +125,11 @@ elseif($page == 'domains') if($paging->checkDisplay($i)) { $row = htmlentities_array($domain_array[$sortkey]); + if($settings['system']['awstats_enabled'] == '1') { + $statsapp = 'awstats/'.$row['domain'].'/'; + } else { + $statsapp = 'webalizer'; + } eval("\$domains.=\"" . getTemplate("domains/domains_delimiter") . "\";"); if($paging->sortfield == 'd.domain' diff --git a/install/froxlor.sql b/install/froxlor.sql index 9087d8ab..acf8c58d 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -508,52 +508,48 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (77, 'dkim', 'use_dkim', '0'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (78, 'system', 'webalizer_enabled', '1'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (79, 'system', 'awstats_enabled', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (80, 'system', 'awstats_domain_file', '/etc/awstats/'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (81, 'system', 'awstats_model_file', '/etc/awstats/awstats.model.conf.froxlor'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (82, 'dkim', 'dkim_prefix', '/etc/postfix/dkim/'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (83, 'dkim', 'dkim_domains', 'domains'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (84, 'dkim', 'dkim_dkimkeys', 'dkim-keys.conf'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (85, 'dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (86, 'panel', 'unix_names', '1'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (87, 'panel', 'allow_preset', '1'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (88, 'system', 'awstats_path', '/usr/share/awstats/VERSION/webroot/cgi-bin/'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (89, 'system', 'awstats_updateall_command', '/usr/bin/awstats_updateall.pl'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (90, 'panel', 'allow_preset_admin', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (91, 'system', 'httpuser', 'www-data'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (92, 'system', 'httpgroup', 'www-data'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (93, 'system', 'webserver', 'apache2'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (94, 'autoresponder', 'autoresponder_active', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (95, 'autoresponder', 'last_autoresponder_run', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (96, 'admin', 'show_version_login', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (97, 'admin', 'show_version_footer', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (98, 'admin', 'froxlor_graphic', 'images/header.gif'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (99, 'system', 'mod_fcgid_wrapper', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (100, 'system', 'mod_fcgid_starter', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (101, 'system', 'mod_fcgid_peardir', '/usr/share/php/:/usr/share/php5/'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (102, 'system', 'index_file_extension', 'html'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (103, 'aps', 'items_per_page', '20'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (104, 'aps', 'upload_fields', '5'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (105, 'aps', 'aps_active', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (1069, 'aps', 'php-extension', ''); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (107, 'aps', 'php-configuration', ''); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (108, 'aps', 'webserver-htaccess', ''); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (109, 'aps', 'php-function', ''); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (110, 'aps', 'webserver-module', ''); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (111, 'system', 'realtime_port', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (112, 'session', 'allow_multiple_login', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (113, 'panel', 'allow_domain_change_admin', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (114, 'panel', 'allow_domain_change_customer', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (115, 'system', 'mod_fcgid_maxrequests', '250'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (116, 'system','ssl_key_file','/etc/apache2/apache2.key'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (117, 'system','ssl_ca_file',''); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (118, 'panel', 'frontend', 'froxlor'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (119, 'spf', 'use_spf', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (120, 'spf', 'spf_entry', '@ IN TXT "v=spf1 a mx -all"'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (121, 'system', 'debug_cron', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (122, 'panel', 'password_min_length', '0'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (123, 'system', 'store_index_file_subs', '1'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (124, 'panel', 'adminmail_defname', 'Froxlor Administrator'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (125, 'panel', 'adminmail_return', ''); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (80, 'dkim', 'dkim_prefix', '/etc/postfix/dkim/'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (81, 'dkim', 'dkim_domains', 'domains'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (82, 'dkim', 'dkim_dkimkeys', 'dkim-keys.conf'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (83, 'dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (84, 'panel', 'unix_names', '1'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (85, 'panel', 'allow_preset', '1'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (86, 'panel', 'allow_preset_admin', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (87, 'system', 'httpuser', 'www-data'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (88, 'system', 'httpgroup', 'www-data'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (89, 'system', 'webserver', 'apache2'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (90, 'autoresponder', 'autoresponder_active', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (91, 'autoresponder', 'last_autoresponder_run', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (92, 'admin', 'show_version_login', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (93, 'admin', 'show_version_footer', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (94, 'admin', 'froxlor_graphic', 'images/header.gif'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (95, 'system', 'mod_fcgid_wrapper', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (96, 'system', 'mod_fcgid_starter', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (97, 'system', 'mod_fcgid_peardir', '/usr/share/php/:/usr/share/php5/'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (98, 'system', 'index_file_extension', 'html'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (99, 'aps', 'items_per_page', '20'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (100, 'aps', 'upload_fields', '5'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (101, 'aps', 'aps_active', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (102, 'aps', 'php-extension', ''); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (103, 'aps', 'php-configuration', ''); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (104, 'aps', 'webserver-htaccess', ''); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (105, 'aps', 'php-function', ''); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (106, 'aps', 'webserver-module', ''); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (107, 'system', 'realtime_port', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (108, 'session', 'allow_multiple_login', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (109, 'panel', 'allow_domain_change_admin', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (110, 'panel', 'allow_domain_change_customer', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (111, 'system', 'mod_fcgid_maxrequests', '250'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (112, 'system','ssl_key_file','/etc/apache2/apache2.key'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (113, 'system','ssl_ca_file',''); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (114, 'panel', 'frontend', 'froxlor'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (115, 'spf', 'use_spf', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (116, 'spf', 'spf_entry', '@ IN TXT "v=spf1 a mx -all"'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (117, 'system', 'debug_cron', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (118, 'panel', 'password_min_length', '0'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (119, 'system', 'store_index_file_subs', '1'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (120, 'panel', 'adminmail_defname', 'Froxlor Administrator'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (121, 'panel', 'adminmail_return', ''); # -------------------------------------------------------- diff --git a/lib/configfiles/etch.inc.php b/lib/configfiles/etch.inc.php index 04424a2c..9bdef6bd 100644 --- a/lib/configfiles/etch.inc.php +++ b/lib/configfiles/etch.inc.php @@ -253,18 +253,12 @@ return Array( ), 'awstats' => Array( 'label' => 'Awstats', - 'files' => Array( - ($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor', - ($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats', - ($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf') - ), 'commands' => Array( - 'apt-get install awstats', - ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '') + 'apt-get install awstats' + ), + 'files' => Array( + 'etc_awstats.model.conf' => '/etc/awstats.model.conf' ), - 'restart' => Array( - ($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart') - ) ), 'libnss' => Array( 'label' => 'libnss (system login with mysql)', diff --git a/lib/configfiles/gentoo.inc.php b/lib/configfiles/gentoo.inc.php index 04d7435c..a019add8 100644 --- a/lib/configfiles/gentoo.inc.php +++ b/lib/configfiles/gentoo.inc.php @@ -268,17 +268,12 @@ milter_default_action = accept\n" >> /etc/postfix/main.cf' ), 'awstats' => Array( 'label' => 'Awstats', - 'files' => Array( - ($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor', - ($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats', - ($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf') - ), 'commands' => Array( - ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '') + 'emerge awstats' + ), + 'files' => Array( + 'etc_awstats.model.conf' => '/etc/awstats.model.conf' ), - 'restart' => Array( - ($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart') - ) ), 'libnss' => Array( 'label' => 'libnss (system login with mysql)', diff --git a/lib/configfiles/hardy.inc.php b/lib/configfiles/hardy.inc.php index a96ff042..be77acdf 100644 --- a/lib/configfiles/hardy.inc.php +++ b/lib/configfiles/hardy.inc.php @@ -247,18 +247,12 @@ return Array( ), 'awstats' => Array( 'label' => 'Awstats', - 'files' => Array( - ($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor', - ($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats', - ($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf') - ), 'commands' => Array( - 'apt-get install awstats', - ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '') + 'apt-get install awstats' + ), + 'files' => Array( + 'etc_awstats.model.conf' => '/etc/awstats.model.conf' ), - 'restart' => Array( - ($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart') - ) ), 'libnss' => Array( 'label' => 'libnss (system login with mysql)', diff --git a/lib/configfiles/lenny.inc.php b/lib/configfiles/lenny.inc.php index d3c16358..0d7a2117 100644 --- a/lib/configfiles/lenny.inc.php +++ b/lib/configfiles/lenny.inc.php @@ -254,18 +254,12 @@ return Array( ), 'awstats' => Array( 'label' => 'Awstats', - 'files' => Array( - ($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor', - ($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats', - ($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf') - ), 'commands' => Array( - 'apt-get install awstats', - ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '') + 'apt-get install awstats' + ), + 'files' => Array( + 'etc_awstats.model.conf' => '/etc/awstats.model.conf' ), - 'restart' => Array( - ($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart') - ) ), 'libnss' => Array( 'label' => 'libnss (system login with mysql)', diff --git a/lib/configfiles/suse10.inc.php b/lib/configfiles/suse10.inc.php index f1419487..9fd02d58 100644 --- a/lib/configfiles/suse10.inc.php +++ b/lib/configfiles/suse10.inc.php @@ -138,15 +138,7 @@ return Array( 'awstats' => Array( 'label' => 'Awstats', 'files' => Array( - ($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor', - ($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats', - ($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf') - ), - 'commands' => Array( - ($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '') - ), - 'restart' => Array( - ($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart') + 'etc_awstats.model.conf' => '/etc/awstats.model.conf' ) ) ) diff --git a/lib/functions/filedir/function.safe_exec.php b/lib/functions/filedir/function.safe_exec.php index e72fdb00..6a93c827 100644 --- a/lib/functions/filedir/function.safe_exec.php +++ b/lib/functions/filedir/function.safe_exec.php @@ -51,11 +51,12 @@ function safe_exec($exec_string, &$return_value = false) $settings['system']['apachereload_command'], $settings['system']['bindreload_command'], $settings['dkim']['dkimrestart_command'], - $settings['system']['awstats_updateall_command'], 'openssl', 'unzip', 'php', - 'rm' + 'rm', + 'awstats_buildstaticpages.pl', + 'ln' ); // diff --git a/lib/functions/froxlor/function.createAWStatsConf.php b/lib/functions/froxlor/function.createAWStatsConf.php index fdf3dfcf..03dc9c91 100644 --- a/lib/functions/froxlor/function.createAWStatsConf.php +++ b/lib/functions/froxlor/function.createAWStatsConf.php @@ -24,38 +24,54 @@ * @param logFile * @param siteDomain * @param hostAliases - * @return - * @author Michael Duergner - * @author Berend Dekens + * @return null */ -function createAWStatsConf($logFile, $siteDomain, $hostAliases) +function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot) { - global $pathtophpfiles; + global $pathtophpfiles, $settings; // Generation header - $header = "## GENERATED BY SYSCP\n"; + $header = "## GENERATED BY FROXLOR\n"; $header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n"; + $awstats_dir = makeCorrectDir($customerDocroot.'/awstats/'.$siteDomain.'/'); + if(!is_dir($awstats_dir)) + { + safe_exec('mkdir -p '.escapeshellarg($awstats_dir)); + } + // These are the variables we will replace $regex = array( '/\{LOG_FILE\}/', '/\{SITE_DOMAIN\}/', - '/\{HOST_ALIASES\}/' + '/\{HOST_ALIASES\}/', + '/\{CUSTOMER_DOCROOT\}/' ); $replace = array( - $logFile, + makeCorrectFile($logFile), $siteDomain, - $hostAliases + $hostAliases, + $awstats_dir ); // File names $domain_file = '/etc/awstats/awstats.' . $siteDomain . '.conf'; - $model_file = '/etc/awstats/awstats.model.conf.froxlor'; + $model_file = dirname(dirname(dirname(dirname(__FILE__)))); + $model_file.= '/templates/misc/awstatsmodel/'; + + if($settings['system']['mod_log_sql'] == '1') + { + $model_file.= 'awstats.froxlor.model_log_sql.conf'; + } else { + $model_file.= 'awstats.froxlor.model.conf'; + } + $model_file = makeCorrectFile($model_file); + // Test if the file exists if(file_exists($domain_file)) diff --git a/lib/functions/froxlor/function.getCustomerIdByDomain.php b/lib/functions/froxlor/function.getCustomerIdByDomain.php new file mode 100644 index 00000000..b562b5c5 --- /dev/null +++ b/lib/functions/froxlor/function.getCustomerIdByDomain.php @@ -0,0 +1,21 @@ +query_first("SELECT `customerid` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '".$domain."'"); + if(is_array($result) + && isset($result['customerid']) + ) { + return $result['customerid']; + } + return false; +} diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index f9df5fa6..c1329847 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -340,20 +340,26 @@ class apache { if($domain['parentdomainid'] == '0') { - $stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['domain']) . '"' . "\n"; - if($this->settings['system']['awstats_enabled'] == '1') { - $stats_text.= createAWStatsVhost($domain['domain'], $this->settings); + // @TODO see if this is correct for awstats + $stats_text.= ' Alias /awstats "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '"' . "\n"; + } + else + { + $stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['domain']) . '"' . "\n"; } } else { - $stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['parentdomain']) . '"' . "\n"; - if($this->settings['system']['awstats_enabled'] == '1') { - $stats_text.= createAWStatsVhost($domain['parentdomain'], $this->settings); + // @TODO see if this is correct for awstats + $stats_text.= ' Alias /awstats "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['parentdomain']) . '"' . "\n"; + } + else + { + $stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['parentdomain']) . '"' . "\n"; } } } @@ -361,12 +367,14 @@ class apache { if($domain['customerroot'] != $domain['documentroot']) { - $stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer') . '"' . "\n"; - } - - if($this->settings['system']['awstats_enabled'] == '1') - { - $stats_text.= createAWStatsVhost($domain['domain'], $this->settings); + if($this->settings['system']['awstats_enabled'] == '1') + { + $stats_text.= ' Alias /awstats "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '"' . "\n"; + } + else + { + $stats_text.= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer') . '"' . "\n"; + } } } @@ -427,51 +435,56 @@ class apache if($this->settings['system']['awstats_enabled'] == '1') { - // prepare the aliases for stats config files - - $server_alias = ''; - $alias_domains = $this->db->query('SELECT `domain`, `iswildcarddomain`, `wwwserveralias` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `aliasdomain`=\'' . $domain['id'] . '\''); - - while(($alias_domain = $this->db->fetch_array($alias_domains)) !== false) + if((int)$domain['parentdomainid'] == 0) { - $server_alias.= ' ' . $alias_domain['domain'] . ' '; + // prepare the aliases and subdomains for stats config files - if($alias_domain['iswildcarddomain'] == '1') + $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) { - $server_alias.= '*.' . $domain['domain']; - } - else - { - if($alias_domain['wwwserveralias'] == '1') + $server_alias.= ' ' . $alias_domain['domain'] . ' '; + + if($alias_domain['iswildcarddomain'] == '1') { - $server_alias.= 'www.' . $alias_domain['domain']; + $server_alias.= '*.' . $domain['domain']; } else { - $server_alias.= ''; + if($alias_domain['wwwserveralias'] == '1') + { + $server_alias.= 'www.' . $alias_domain['domain']; + } + else + { + $server_alias.= ''; + } } } - } - - if($domain['iswildcarddomain'] == '1') - { - $alias = '*.' . $domain['domain']; - } - else - { - if($domain['wwwserveralias'] == '1') + + if($domain['iswildcarddomain'] == '1') { - $alias = 'www.' . $domain['domain']; + $alias = '*.' . $domain['domain']; } else { - $alias = ''; + if($domain['wwwserveralias'] == '1') + { + $alias = 'www.' . $domain['domain']; + } + else + { + $alias = ''; + } } + + // After inserting the AWStats information, + // be sure to build the awstats conf file as well + createAWStatsConf($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log', $domain['domain'], $alias . $server_alias, $domain['customerroot']); } - - // After inserting the AWStats information, be sure to build the awstats conf file as well - - createAWStatsConf($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log', $domain['domain'], $alias . $server_alias); } return $logfiles_text; @@ -617,7 +630,7 @@ class apache public function createVirtualHosts() { - $result_domains = $this->db->query("SELECT `d`.`id`, `d`.`domain`, `d`.`customerid`, `d`.`documentroot`, `d`.`ssl`, `d`.`parentdomainid`, `d`.`ipandport`, `d`.`ssl_ipandport`, `d`.`ssl_redirect`, `d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`wwwserveralias`, `d`.`openbasedir`, `d`.`openbasedir_path`, `d`.`safemode`, `d`.`speciallogfile`, `d`.`specialsettings`, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, `d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled`, `d`.`mod_fcgid_starter`, `d`.`mod_fcgid_maxrequests` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) " . "LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) " . "WHERE `d`.`aliasdomain` IS NULL ORDER BY `d`.`iswildcarddomain`, `d`.`domain` ASC"); + $result_domains = $this->db->query("SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, `d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled`, `d`.`mod_fcgid_starter`, `d`.`mod_fcgid_maxrequests` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) " . "LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) " . "WHERE `d`.`aliasdomain` IS NULL ORDER BY `d`.`iswildcarddomain`, `d`.`domain` ASC"); while($domain = $this->db->fetch_array($result_domains)) { diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index 68cea7b9..aaf037e2 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -62,7 +62,7 @@ class lighttpd public function reload() { fwrite($this->debugHandler, ' lighttpd::reload: reloading lighttpd' . "\n"); - $this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading apache'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading lighttpd'); safe_exec($this->settings['system']['apachereload_command']); } @@ -225,11 +225,11 @@ class lighttpd if($ssl == '0') { - $query2 = "SELECT `d`.`id`, `d`.`domain`, `d`.`customerid`, `d`.`documentroot`, `d`.`ssl`, `d`.`parentdomainid`, `d`.`ipandport`, `d`.`ssl_ipandport`, `d`.`ssl_redirect`, `d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`wwwserveralias`, `d`.`openbasedir`, `d`.`openbasedir_path`, `d`.`safemode`, `d`.`speciallogfile`, `d`.`specialsettings`, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, `c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) WHERE `d`.`ipandport`='" . $ipandport['id'] . "' AND `d`.`aliasdomain` IS NULL ORDER BY `d`.`iswildcarddomain`, `d`.`domain` ASC"; + $query2 = "SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, `c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) WHERE `d`.`ipandport`='" . $ipandport['id'] . "' AND `d`.`aliasdomain` IS NULL ORDER BY `d`.`iswildcarddomain`, `d`.`domain` ASC"; } else { - $query2 = "SELECT `d`.`id`, `d`.`domain`, `d`.`customerid`, `d`.`documentroot`, `d`.`ssl`, `d`.`parentdomainid`, `d`.`ipandport`, `d`.`ssl_ipandport`, `d`.`ssl_redirect`, `d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`wwwserveralias`, `d`.`openbasedir`, `d`.`openbasedir_path`, `d`.`safemode`, `d`.`speciallogfile`, `d`.`specialsettings`, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, `c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) WHERE `d`.`ssl_ipandport`='" . $ipandport['id'] . "' AND `d`.`aliasdomain` IS NULL ORDER BY `d`.`iswildcarddomain`, `d`.`domain` ASC"; + $query2 = "SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, `c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) WHERE `d`.`ssl_ipandport`='" . $ipandport['id'] . "' AND `d`.`aliasdomain` IS NULL ORDER BY `d`.`iswildcarddomain`, `d`.`domain` ASC"; } $included_vhosts = array(); @@ -323,6 +323,7 @@ class lighttpd $vhost_content.= $this->create_htaccess($domain); $vhost_content.= $this->create_pathOptions($domain); $vhost_content.= $this->composePhpOptions($domain); + $vhost_content.= $this->getStats($domain); $vhost_content.= $this->getLogFiles($domain); $vhost_content.= '}' . "\n"; return $vhost_content; @@ -351,6 +352,60 @@ class lighttpd $logfiles_text.= ' accesslog.filename = "' . $access_log . '"' . "\n"; } + + 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) + { + $server_alias.= ' ' . $alias_domain['domain'] . ' '; + + if($alias_domain['iswildcarddomain'] == '1') + { + $server_alias.= '*.' . $domain['domain']; + } + else + { + if($alias_domain['wwwserveralias'] == '1') + { + $server_alias.= 'www.' . $alias_domain['domain']; + } + else + { + $server_alias.= ''; + } + } + } + + if($domain['iswildcarddomain'] == '1') + { + $alias = '*.' . $domain['domain']; + } + else + { + if($domain['wwwserveralias'] == '1') + { + $alias = 'www.' . $domain['domain']; + } + else + { + $alias = ''; + } + } + + // After inserting the AWStats information, + // be sure to build the awstats conf file as well + createAWStatsConf($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log', $domain['domain'], $alias . $server_alias, $domain['customerroot']); + } + } return $logfiles_text; } @@ -570,6 +625,60 @@ class lighttpd return $webroot_text; } + + /* + * Lets set the text part for the stats software + */ + + protected function getStats($domain) + { + $stats_text = ''; + + if($domain['speciallogfile'] == '1' + && $this->settings['system']['mod_log_sql'] != '1') + { + if($domain['parentdomainid'] == '0') + { + if($this->settings['system']['awstats_enabled'] == '1') + { + // @TODO see if this is correct for awstats + $stats_text.= ' alias.url = ( "/awstats/" => "'.makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']).'" )' . "\n"; + } + else + { + $stats_text.= ' alias.url = ( "/webalizer/" => "'.makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['domain']).'" )' . "\n"; + } + } + else + { + if($this->settings['system']['awstats_enabled'] == '1') + { + // @TODO see if this is correct for awstats + $stats_text.= ' alias.url = ( "/awstats/" => "'.makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['parentdomain']).'" )' . "\n"; + } + else + { + $stats_text.= ' alias.url = ( "/webalizer/" => "'.makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['parentdomain']).'" )' . "\n"; + } + } + } + else + { + if($domain['customerroot'] != $domain['documentroot']) + { + if($this->settings['system']['awstats_enabled'] == '1') + { + $stats_text.= ' alias.url = ( "/awstats/" => "'.makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']).'" )' . "\n"; + } + else + { + $stats_text.= ' alias.url = ( "/webalizer/" => "'.makeCorrectFile($domain['customerroot'] . '/webalizer').'" )' . "\n"; + } + } + } + + return $stats_text; + } public function writeConfigs() { diff --git a/scripts/jobs/cron_tasks.php b/scripts/jobs/cron_tasks.php index a4f23d69..5968b033 100644 --- a/scripts/jobs/cron_tasks.php +++ b/scripts/jobs/cron_tasks.php @@ -61,7 +61,7 @@ while($row = $db->fetch_array($result_tasks)) * (e.g. awstats not installed yet or whatever) * fixes #45 */ - if (is_dir($awstatsclean['dir'])) + if (is_dir($awstatsclean['path'])) { $awstatsclean['dir'] = dir($awstatsclean['path']); while($awstatsclean['entry'] = $awstatsclean['dir']->read()) { @@ -75,6 +75,7 @@ while($row = $db->fetch_array($result_tasks)) $awstatsclean['headerRead'] = fgets($awstatsclean['fh'], strlen($awstatsclean['header'])+1); fclose($awstatsclean['fh']); if($awstatsclean['headerRead'] == $awstatsclean['header']) { + $cronlog->logAction(CRON_ACTION, LOG_INFO, "Removing awstats configuration ".$awstatsclean['fullentry']." for re-creation"); @unlink($awstatsclean['fullentry']); } } @@ -140,6 +141,8 @@ while($row = $db->fetch_array($result_tasks)) { $cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: mkdir -p ' . escapeshellarg($settings['system']['documentroot_prefix'] . $row['data']['loginname'] . '/webalizer')); safe_exec('mkdir -p ' . escapeshellarg($settings['system']['documentroot_prefix'] . $row['data']['loginname'] . '/webalizer')); + $cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: mkdir -p ' . escapeshellarg($settings['system']['documentroot_prefix'] . $row['data']['loginname'] . '/awstats')); + safe_exec('mkdir -p ' . escapeshellarg($settings['system']['documentroot_prefix'] . $row['data']['loginname'] . '/awstats')); $cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: mkdir -p ' . escapeshellarg($settings['system']['vmail_homedir'] . $row['data']['loginname'])); safe_exec('mkdir -p ' . escapeshellarg($settings['system']['vmail_homedir'] . $row['data']['loginname'])); @@ -162,7 +165,7 @@ while($row = $db->fetch_array($result_tasks)) } /** - * TYPE=4 MEANS THAT SOMETHING IN THE BIND CONFIG HAS CHANGED. REBUILD syscp_bind.conf + * TYPE=4 MEANS THAT SOMETHING IN THE BIND CONFIG HAS CHANGED. REBUILD froxlor_bind.conf */ elseif ($row['type'] == '4') { diff --git a/scripts/jobs/cron_traffic.inc.functions.php b/scripts/jobs/cron_traffic.inc.functions.php index 686cf921..d537afe1 100644 --- a/scripts/jobs/cron_traffic.inc.functions.php +++ b/scripts/jobs/cron_traffic.inc.functions.php @@ -17,6 +17,114 @@ * @version $Id$ */ +function awstatsDoSingleDomain($domain, $outputdir) +{ + global $cronlog; + $returnval = 0; + + $domainconfig = '/etc/awstats/awstats.' . $domain . '.conf'; + if(file_exists($domainconfig)) + { + $outputdir = makeCorrectDir($outputdir . '/' . $domain); + + if(!is_dir($outputdir)) + { + safe_exec('mkdir -p ' . escapeshellarg($outputdir)); + } + + $cronlog->logAction(CRON_ACTION, LOG_INFO, "Running awstats_buildstaticpages.pl for domain '".$domain."' (Output: '".$outputdir."')"); + safe_exec('awstats_buildstaticpages.pl -update -config=' . $domain . ' -dir='.escapeshellarg($outputdir)); + + /** + * index file is saved like 'awstats.[domain].html', + * so link a index.html to it + */ + $original_index = makeCorrectFile($outputdir.'/awstats.'.$domain.'.html'); + $new_index = makeCorrectFile($outputdir.'/index.html'); + if(!file_exists($new_index)) { + safe_exec('ln -s '.escapeshellarg($original_index).' '.escapeshellarg($new_index)); + } + + /** + * statistics file looks like: 'awstats[month][year].[domain].txt' + */ + $file = makeCorrectFile($outputdir.'/awstats'.date('mY', time()).'.'.$domain.'.txt'); + $cronlog->logAction(CRON_ACTION, LOG_INFO, "Gathering traffic information from '".$file."'"); + + if (file_exists($file)) { + $content = @file_get_contents($file); + if ($content !== false) { + $content_array = explode("\n", $content); + + $count_bdw = false; + foreach($content_array as $line) + { + if(trim($line) == '') { + continue; + } + + $parts = explode(' ', $line); + + if(isset($line[0]) + && strtoupper($line[0]) == 'BEGIN_DOMAIN' + ) { + $count_bdw = true; + } + elseif(isset($line[0]) + && strtoupper($line[0]) == 'END_DOMAIN' + ) { + $count_bdw = false; + } + + if ($count_bdw) { + if (isset($line[3])) { + $returnval += floatval($line[3]); + } + } + } + } + } + } + return $returnval; +} + +function callAwstatsGetTraffic($domain, $outputdir, $caption, $usersdomainlist) +{ + global $settings, $db, $cronlog; + $returnval = 0; + + foreach($usersdomainlist as $domainid => $singledomain) + { + // as we check for the config-model awstats will only parse + // 'real' domains and no subdomains which are aliases in the + // model-config-file. + $returnval += awstatsDoSingleDomain($singledomain, $outputdir); + } + + /** + * now, because this traffic is being saved daily, we have to + * subtract the values from all the month's values to return + * a sane value for our panel_traffic and to remain the whole stats + * (awstats overwrites the customers .html stats-files) + */ + $customerid = getCustomerIdByDomain($domain); + + if($customerid !== false) + { + $result = $db->query_first("SELECT SUM(`http`) as `trafficmonth` FROM `" . TABLE_PANEL_TRAFFIC . "` + WHERE `customerid` = '".(int)$customerid."' + AND `year`='".date('Y', time())."' + AND `month`='".date('m', time())."'"); + if(is_array($result) + && isset($result['trafficmonth']) + ) { + $returnval = ($returnval - floatval($result['trafficmonth'])); + } + } + + return floatval($returnval); +} + /** * Function which make webalizer statistics and returns used traffic since last run * @@ -29,7 +137,7 @@ function callWebalizerGetTraffic($logfile, $outputdir, $caption, $usersdomainlist) { - global $settings; + global $settings, $cronlog; $returnval = 0; if(file_exists($settings['system']['logfiles_directory'] . $logfile . '-access.log')) @@ -37,6 +145,7 @@ function callWebalizerGetTraffic($logfile, $outputdir, $caption, $usersdomainlis $domainargs = ''; foreach($usersdomainlist as $domainid => $domain) { + // hide referer $domainargs.= ' -r ' . escapeshellarg($domain); } @@ -69,6 +178,7 @@ function callWebalizerGetTraffic($logfile, $outputdir, $caption, $usersdomainlis $verbosity = '-Q'; } + $cronlog->logAction(CRON_ACTION, LOG_INFO, "Running webalizer for domain '".$caption."'"); safe_exec('webalizer ' . $verbosity . ' -p -o ' . escapeshellarg($outputdir) . ' -n ' . escapeshellarg($caption) . $domainargs . ' ' . escapeshellarg($settings['system']['logfiles_directory'] . $logfile . '-access.log')); /** @@ -80,6 +190,7 @@ function callWebalizerGetTraffic($logfile, $outputdir, $caption, $usersdomainlis $httptraffic = array(); $webalizer_hist = @file_get_contents($outputdir . 'webalizer.hist'); + $cronlog->logAction(CRON_ACTION, LOG_INFO, "Gathering traffic information from '".$webalizer_hist."'"); $webalizer_hist_rows = explode("\n", $webalizer_hist); foreach($webalizer_hist_rows as $webalizer_hist_row) { @@ -108,6 +219,7 @@ function callWebalizerGetTraffic($logfile, $outputdir, $caption, $usersdomainlis reset($httptraffic); $httptrafficlast = array(); $webalizer_lasthist = @file_get_contents($outputdir . 'webalizer.hist.1'); + $cronlog->logAction(CRON_ACTION, LOG_INFO, "Gathering traffic information from '".$webalizer_lasthist."'"); $webalizer_lasthist_rows = explode("\n", $webalizer_lasthist); foreach($webalizer_lasthist_rows as $webalizer_lasthist_row) { @@ -229,4 +341,3 @@ function safeSQLLogfile($domains, $loginname) $db->query("DELETE FROM access_log " . $where); return true; } - diff --git a/scripts/jobs/cron_traffic.php b/scripts/jobs/cron_traffic.php index 4683fa28..90572b7c 100644 --- a/scripts/jobs/cron_traffic.php +++ b/scripts/jobs/cron_traffic.php @@ -165,7 +165,14 @@ while($row = $db->fetch_array($result)) unset($domainlist[$row['customerid']][$domainid]); } - $httptraffic+= floatval(callWebalizerGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domain, $domainlist[$row['customerid']])); + if($this->settings['system']['awstats_enabled'] == '1') + { + $httptraffic+= floatval(callAwstatsGetTraffic($domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domainlist[$row['customerid']])); + } + else + { + $httptraffic+= floatval(callWebalizerGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domain, $domainlist[$row['customerid']])); + } } } @@ -176,7 +183,14 @@ while($row = $db->fetch_array($result)) safeSQLLogfile($domainlist[$row['customerid']], $row['loginname']); } - $httptraffic+= floatval(callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']])); + if($settings['system']['awstats_enabled'] == '1') + { + $httptraffic+= floatval(callAwstatsGetTraffic($caption, $row['documentroot'] . '/awstats/', $caption, $domainlist[$row['customerid']])); + } + else + { + $httptraffic+= floatval(callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']])); + } } /** diff --git a/templates/customer/domains/domains_delimiter.tpl b/templates/customer/domains/domains_delimiter.tpl index 7be6b64b..80eac269 100644 --- a/templates/customer/domains/domains_delimiter.tpl +++ b/templates/customer/domains/domains_delimiter.tpl @@ -1,3 +1,3 @@ -     {$row['domain']} [{$lng['domains']['statstics']}] +     {$row['domain']} [{$lng['domains']['statstics']}] \ No newline at end of file diff --git a/templates/misc/configfiles/gentoo/awstats/etc_awstats_awstats.model.conf.froxlor b/templates/misc/awstatsmodel/awstats.froxlor.model.conf similarity index 72% rename from templates/misc/configfiles/gentoo/awstats/etc_awstats_awstats.model.conf.froxlor rename to templates/misc/awstatsmodel/awstats.froxlor.model.conf index 414c74d5..08f6a00c 100644 --- a/templates/misc/configfiles/gentoo/awstats/etc_awstats_awstats.model.conf.froxlor +++ b/templates/misc/awstatsmodel/awstats.froxlor.model.conf @@ -4,6 +4,7 @@ LogFormat = 1 LogSeparator=" " SiteDomain="{SITE_DOMAIN}" HostAliases="{HOST_ALIASES}" +DirData="{CUSTOMER_DOCROOT}" # Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" +Include "/etc/awstats/awstats.model.conf" diff --git a/templates/misc/configfiles/debian_lenny/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor b/templates/misc/awstatsmodel/awstats.froxlor.model_log_sql.conf similarity index 79% rename from templates/misc/configfiles/debian_lenny/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor rename to templates/misc/awstatsmodel/awstats.froxlor.model_log_sql.conf index f8d795d7..7e45bee7 100644 --- a/templates/misc/configfiles/debian_lenny/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor +++ b/templates/misc/awstatsmodel/awstats.froxlor.model_log_sql.conf @@ -4,6 +4,7 @@ LogFormat = "%host %virtualname %logname %time1 %methodurl %code %bytesd %refere LogSeparator=" " SiteDomain="{SITE_DOMAIN}" HostAliases="{HOST_ALIASES}" +DirData="{CUSTOMER_DOCROOT}" # Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file +Include "/etc/awstats/awstats.model.conf" \ No newline at end of file diff --git a/templates/misc/configfiles/debian_etch/awstats/etc_apache_vhosts_05_awstats.conf b/templates/misc/configfiles/debian_etch/awstats/etc_apache_vhosts_05_awstats.conf deleted file mode 100644 index 2c220e2f..00000000 --- a/templates/misc/configfiles/debian_etch/awstats/etc_apache_vhosts_05_awstats.conf +++ /dev/null @@ -1,14 +0,0 @@ -ScriptAlias /awstats/ "/usr/lib/cgi-bin/" -ScriptAlias /awstats "/usr/lib/cgi-bin/awstats.pl" -ScriptAlias /awstats.pl "/usr/lib/cgi-bin/awstats.pl" -Alias /awstats-icon/ "/usr/share/awstats/icon/" - - - Options ExecCGI - AllowOverride None - - Order allow,deny - Allow from all - - - diff --git a/templates/misc/configfiles/debian_etch/awstats/etc_awstats.model.conf b/templates/misc/configfiles/debian_etch/awstats/etc_awstats.model.conf new file mode 100644 index 00000000..7847b4ea --- /dev/null +++ b/templates/misc/configfiles/debian_etch/awstats/etc_awstats.model.conf @@ -0,0 +1,9 @@ +# for Froxlor and AWStats to work together +# you have to change the following line +# in the awstats.mode.conf file + +# look for +DirData="/some/folder/" + +# and comment this out with a hash (#) +#DirData="/some/folder/" diff --git a/templates/misc/configfiles/debian_etch/awstats/etc_awstats_awstats.model.conf.froxlor b/templates/misc/configfiles/debian_etch/awstats/etc_awstats_awstats.model.conf.froxlor deleted file mode 100644 index 0a979bfd..00000000 --- a/templates/misc/configfiles/debian_etch/awstats/etc_awstats_awstats.model.conf.froxlor +++ /dev/null @@ -1,9 +0,0 @@ -LogFile="{LOG_FILE}" -LogType=W -LogFormat = 1 -LogSeparator=" " -SiteDomain="{SITE_DOMAIN}" -HostAliases="{HOST_ALIASES}" - -# Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file diff --git a/templates/misc/configfiles/debian_etch/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor b/templates/misc/configfiles/debian_etch/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor deleted file mode 100644 index f8d795d7..00000000 --- a/templates/misc/configfiles/debian_etch/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor +++ /dev/null @@ -1,9 +0,0 @@ -LogFile="{LOG_FILE}" -LogType=W -LogFormat = "%host %virtualname %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" -LogSeparator=" " -SiteDomain="{SITE_DOMAIN}" -HostAliases="{HOST_ALIASES}" - -# Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file diff --git a/templates/misc/configfiles/debian_etch/awstats/etc_cron.d_awstats b/templates/misc/configfiles/debian_etch/awstats/etc_cron.d_awstats deleted file mode 100644 index 3478e330..00000000 --- a/templates/misc/configfiles/debian_etch/awstats/etc_cron.d_awstats +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -*/10 * * * * www-data [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/debian_etch/awstats/etc_cron.d_awstats_log_sql b/templates/misc/configfiles/debian_etch/awstats/etc_cron.d_awstats_log_sql deleted file mode 100644 index 3c78c0c7..00000000 --- a/templates/misc/configfiles/debian_etch/awstats/etc_cron.d_awstats_log_sql +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -45 0 * * * www-data [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/debian_etch/awstats/etc_lighttpd_froxlor-awstats.conf b/templates/misc/configfiles/debian_etch/awstats/etc_lighttpd_froxlor-awstats.conf deleted file mode 100644 index c5369bb3..00000000 --- a/templates/misc/configfiles/debian_etch/awstats/etc_lighttpd_froxlor-awstats.conf +++ /dev/null @@ -1,19 +0,0 @@ -#alias.url += ( -# "/js/awstats_misc_tracker.js" => "/usr/share/awstats/wwwroot/js/awstats_misc_tracker.js" -#) - -$HTTP["url"] =~ "^/awstats" { - alias.url += ( - "/awstats/" => "", - "/awstats" => "awstats.pl", - "/awstats.pl" => "awstats.pl" -# "/awstatsicons/" => "/usr/share/awstats/wwwroot/icon/" - ) - - index-file.names = ( "awstatstotals.php" ) - - cgi.assign = ( - ".pl" => "/usr/bin/perl", - ".cgi" => "/usr/bin/perl" - ) -} \ No newline at end of file diff --git a/templates/misc/configfiles/debian_lenny/awstats/etc_apache_vhosts_05_awstats.conf b/templates/misc/configfiles/debian_lenny/awstats/etc_apache_vhosts_05_awstats.conf deleted file mode 100644 index 2c220e2f..00000000 --- a/templates/misc/configfiles/debian_lenny/awstats/etc_apache_vhosts_05_awstats.conf +++ /dev/null @@ -1,14 +0,0 @@ -ScriptAlias /awstats/ "/usr/lib/cgi-bin/" -ScriptAlias /awstats "/usr/lib/cgi-bin/awstats.pl" -ScriptAlias /awstats.pl "/usr/lib/cgi-bin/awstats.pl" -Alias /awstats-icon/ "/usr/share/awstats/icon/" - - - Options ExecCGI - AllowOverride None - - Order allow,deny - Allow from all - - - diff --git a/templates/misc/configfiles/debian_lenny/awstats/etc_awstats.model.conf b/templates/misc/configfiles/debian_lenny/awstats/etc_awstats.model.conf new file mode 100644 index 00000000..7847b4ea --- /dev/null +++ b/templates/misc/configfiles/debian_lenny/awstats/etc_awstats.model.conf @@ -0,0 +1,9 @@ +# for Froxlor and AWStats to work together +# you have to change the following line +# in the awstats.mode.conf file + +# look for +DirData="/some/folder/" + +# and comment this out with a hash (#) +#DirData="/some/folder/" diff --git a/templates/misc/configfiles/debian_lenny/awstats/etc_awstats_awstats.model.conf.froxlor b/templates/misc/configfiles/debian_lenny/awstats/etc_awstats_awstats.model.conf.froxlor deleted file mode 100644 index 0a979bfd..00000000 --- a/templates/misc/configfiles/debian_lenny/awstats/etc_awstats_awstats.model.conf.froxlor +++ /dev/null @@ -1,9 +0,0 @@ -LogFile="{LOG_FILE}" -LogType=W -LogFormat = 1 -LogSeparator=" " -SiteDomain="{SITE_DOMAIN}" -HostAliases="{HOST_ALIASES}" - -# Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file diff --git a/templates/misc/configfiles/debian_lenny/awstats/etc_cron.d_awstats b/templates/misc/configfiles/debian_lenny/awstats/etc_cron.d_awstats deleted file mode 100644 index 3478e330..00000000 --- a/templates/misc/configfiles/debian_lenny/awstats/etc_cron.d_awstats +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -*/10 * * * * www-data [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/debian_lenny/awstats/etc_cron.d_awstats_log_sql b/templates/misc/configfiles/debian_lenny/awstats/etc_cron.d_awstats_log_sql deleted file mode 100644 index 3c78c0c7..00000000 --- a/templates/misc/configfiles/debian_lenny/awstats/etc_cron.d_awstats_log_sql +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -45 0 * * * www-data [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/debian_lenny/awstats/etc_lighttpd_froxlor-awstats.conf b/templates/misc/configfiles/debian_lenny/awstats/etc_lighttpd_froxlor-awstats.conf deleted file mode 100644 index c5369bb3..00000000 --- a/templates/misc/configfiles/debian_lenny/awstats/etc_lighttpd_froxlor-awstats.conf +++ /dev/null @@ -1,19 +0,0 @@ -#alias.url += ( -# "/js/awstats_misc_tracker.js" => "/usr/share/awstats/wwwroot/js/awstats_misc_tracker.js" -#) - -$HTTP["url"] =~ "^/awstats" { - alias.url += ( - "/awstats/" => "", - "/awstats" => "awstats.pl", - "/awstats.pl" => "awstats.pl" -# "/awstatsicons/" => "/usr/share/awstats/wwwroot/icon/" - ) - - index-file.names = ( "awstatstotals.php" ) - - cgi.assign = ( - ".pl" => "/usr/bin/perl", - ".cgi" => "/usr/bin/perl" - ) -} \ No newline at end of file diff --git a/templates/misc/configfiles/gentoo/awstats/etc_apache_vhosts_05_awstats.conf b/templates/misc/configfiles/gentoo/awstats/etc_apache_vhosts_05_awstats.conf deleted file mode 100644 index 2c220e2f..00000000 --- a/templates/misc/configfiles/gentoo/awstats/etc_apache_vhosts_05_awstats.conf +++ /dev/null @@ -1,14 +0,0 @@ -ScriptAlias /awstats/ "/usr/lib/cgi-bin/" -ScriptAlias /awstats "/usr/lib/cgi-bin/awstats.pl" -ScriptAlias /awstats.pl "/usr/lib/cgi-bin/awstats.pl" -Alias /awstats-icon/ "/usr/share/awstats/icon/" - - - Options ExecCGI - AllowOverride None - - Order allow,deny - Allow from all - - - diff --git a/templates/misc/configfiles/gentoo/awstats/etc_awstats.model.conf b/templates/misc/configfiles/gentoo/awstats/etc_awstats.model.conf new file mode 100644 index 00000000..7847b4ea --- /dev/null +++ b/templates/misc/configfiles/gentoo/awstats/etc_awstats.model.conf @@ -0,0 +1,9 @@ +# for Froxlor and AWStats to work together +# you have to change the following line +# in the awstats.mode.conf file + +# look for +DirData="/some/folder/" + +# and comment this out with a hash (#) +#DirData="/some/folder/" diff --git a/templates/misc/configfiles/gentoo/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor b/templates/misc/configfiles/gentoo/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor deleted file mode 100644 index f8d795d7..00000000 --- a/templates/misc/configfiles/gentoo/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor +++ /dev/null @@ -1,9 +0,0 @@ -LogFile="{LOG_FILE}" -LogType=W -LogFormat = "%host %virtualname %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" -LogSeparator=" " -SiteDomain="{SITE_DOMAIN}" -HostAliases="{HOST_ALIASES}" - -# Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file diff --git a/templates/misc/configfiles/gentoo/awstats/etc_cron.d_awstats b/templates/misc/configfiles/gentoo/awstats/etc_cron.d_awstats deleted file mode 100644 index 0df6d639..00000000 --- a/templates/misc/configfiles/gentoo/awstats/etc_cron.d_awstats +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -*/10 * * * * apache [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/gentoo/awstats/etc_cron.d_awstats_log_sql b/templates/misc/configfiles/gentoo/awstats/etc_cron.d_awstats_log_sql deleted file mode 100644 index f09d60b0..00000000 --- a/templates/misc/configfiles/gentoo/awstats/etc_cron.d_awstats_log_sql +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -45 0 * * * apache [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/gentoo/awstats/etc_lighttpd_froxlor-awstats.conf b/templates/misc/configfiles/gentoo/awstats/etc_lighttpd_froxlor-awstats.conf deleted file mode 100644 index c5369bb3..00000000 --- a/templates/misc/configfiles/gentoo/awstats/etc_lighttpd_froxlor-awstats.conf +++ /dev/null @@ -1,19 +0,0 @@ -#alias.url += ( -# "/js/awstats_misc_tracker.js" => "/usr/share/awstats/wwwroot/js/awstats_misc_tracker.js" -#) - -$HTTP["url"] =~ "^/awstats" { - alias.url += ( - "/awstats/" => "", - "/awstats" => "awstats.pl", - "/awstats.pl" => "awstats.pl" -# "/awstatsicons/" => "/usr/share/awstats/wwwroot/icon/" - ) - - index-file.names = ( "awstatstotals.php" ) - - cgi.assign = ( - ".pl" => "/usr/bin/perl", - ".cgi" => "/usr/bin/perl" - ) -} \ No newline at end of file diff --git a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_apache_vhosts_05_awstats.conf b/templates/misc/configfiles/suse_linux_10_0/awstats/etc_apache_vhosts_05_awstats.conf deleted file mode 100644 index 2c220e2f..00000000 --- a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_apache_vhosts_05_awstats.conf +++ /dev/null @@ -1,14 +0,0 @@ -ScriptAlias /awstats/ "/usr/lib/cgi-bin/" -ScriptAlias /awstats "/usr/lib/cgi-bin/awstats.pl" -ScriptAlias /awstats.pl "/usr/lib/cgi-bin/awstats.pl" -Alias /awstats-icon/ "/usr/share/awstats/icon/" - - - Options ExecCGI - AllowOverride None - - Order allow,deny - Allow from all - - - diff --git a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats.model.conf b/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats.model.conf new file mode 100644 index 00000000..7847b4ea --- /dev/null +++ b/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats.model.conf @@ -0,0 +1,9 @@ +# for Froxlor and AWStats to work together +# you have to change the following line +# in the awstats.mode.conf file + +# look for +DirData="/some/folder/" + +# and comment this out with a hash (#) +#DirData="/some/folder/" diff --git a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats_awstats.model.conf.froxlor b/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats_awstats.model.conf.froxlor deleted file mode 100644 index 0a979bfd..00000000 --- a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats_awstats.model.conf.froxlor +++ /dev/null @@ -1,9 +0,0 @@ -LogFile="{LOG_FILE}" -LogType=W -LogFormat = 1 -LogSeparator=" " -SiteDomain="{SITE_DOMAIN}" -HostAliases="{HOST_ALIASES}" - -# Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file diff --git a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor b/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor deleted file mode 100644 index f8d795d7..00000000 --- a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor +++ /dev/null @@ -1,9 +0,0 @@ -LogFile="{LOG_FILE}" -LogType=W -LogFormat = "%host %virtualname %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" -LogSeparator=" " -SiteDomain="{SITE_DOMAIN}" -HostAliases="{HOST_ALIASES}" - -# Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file diff --git a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_cron.d_awstats b/templates/misc/configfiles/suse_linux_10_0/awstats/etc_cron.d_awstats deleted file mode 100644 index 3478e330..00000000 --- a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_cron.d_awstats +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -*/10 * * * * www-data [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_cron.d_awstats_log_sql b/templates/misc/configfiles/suse_linux_10_0/awstats/etc_cron.d_awstats_log_sql deleted file mode 100644 index 3c78c0c7..00000000 --- a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_cron.d_awstats_log_sql +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -45 0 * * * www-data [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_lighttpd_froxlor-awstats.conf b/templates/misc/configfiles/suse_linux_10_0/awstats/etc_lighttpd_froxlor-awstats.conf deleted file mode 100644 index c5369bb3..00000000 --- a/templates/misc/configfiles/suse_linux_10_0/awstats/etc_lighttpd_froxlor-awstats.conf +++ /dev/null @@ -1,19 +0,0 @@ -#alias.url += ( -# "/js/awstats_misc_tracker.js" => "/usr/share/awstats/wwwroot/js/awstats_misc_tracker.js" -#) - -$HTTP["url"] =~ "^/awstats" { - alias.url += ( - "/awstats/" => "", - "/awstats" => "awstats.pl", - "/awstats.pl" => "awstats.pl" -# "/awstatsicons/" => "/usr/share/awstats/wwwroot/icon/" - ) - - index-file.names = ( "awstatstotals.php" ) - - cgi.assign = ( - ".pl" => "/usr/bin/perl", - ".cgi" => "/usr/bin/perl" - ) -} \ No newline at end of file diff --git a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_apache_vhosts_05_awstats.conf b/templates/misc/configfiles/ubuntu_hardy/awstats/etc_apache_vhosts_05_awstats.conf deleted file mode 100644 index 2c220e2f..00000000 --- a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_apache_vhosts_05_awstats.conf +++ /dev/null @@ -1,14 +0,0 @@ -ScriptAlias /awstats/ "/usr/lib/cgi-bin/" -ScriptAlias /awstats "/usr/lib/cgi-bin/awstats.pl" -ScriptAlias /awstats.pl "/usr/lib/cgi-bin/awstats.pl" -Alias /awstats-icon/ "/usr/share/awstats/icon/" - - - Options ExecCGI - AllowOverride None - - Order allow,deny - Allow from all - - - diff --git a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats.model.conf b/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats.model.conf new file mode 100644 index 00000000..7847b4ea --- /dev/null +++ b/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats.model.conf @@ -0,0 +1,9 @@ +# for Froxlor and AWStats to work together +# you have to change the following line +# in the awstats.mode.conf file + +# look for +DirData="/some/folder/" + +# and comment this out with a hash (#) +#DirData="/some/folder/" diff --git a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats_awstats.model.conf.froxlor b/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats_awstats.model.conf.froxlor deleted file mode 100644 index 0a979bfd..00000000 --- a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats_awstats.model.conf.froxlor +++ /dev/null @@ -1,9 +0,0 @@ -LogFile="{LOG_FILE}" -LogType=W -LogFormat = 1 -LogSeparator=" " -SiteDomain="{SITE_DOMAIN}" -HostAliases="{HOST_ALIASES}" - -# Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file diff --git a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor b/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor deleted file mode 100644 index f8d795d7..00000000 --- a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_awstats_awstats.model_log_sql.conf.froxlor +++ /dev/null @@ -1,9 +0,0 @@ -LogFile="{LOG_FILE}" -LogType=W -LogFormat = "%host %virtualname %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" -LogSeparator=" " -SiteDomain="{SITE_DOMAIN}" -HostAliases="{HOST_ALIASES}" - -# Include local configuration options identical for all virtual hosts -Include "/etc/awstats/awstats.conf.local" \ No newline at end of file diff --git a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_cron.d_awstats b/templates/misc/configfiles/ubuntu_hardy/awstats/etc_cron.d_awstats deleted file mode 100644 index 3478e330..00000000 --- a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_cron.d_awstats +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -*/10 * * * * www-data [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_cron.d_awstats_log_sql b/templates/misc/configfiles/ubuntu_hardy/awstats/etc_cron.d_awstats_log_sql deleted file mode 100644 index 3c78c0c7..00000000 --- a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_cron.d_awstats_log_sql +++ /dev/null @@ -1,6 +0,0 @@ -# -# Set PATH, otherwise restart-scripts won't find start-stop-daemon -# -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -45 0 * * * www-data [ -x /usr/bin/awstats_updateall.pl ] && /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats -excludeconf=awstats.model.conf.froxlor,awstats.conf \ No newline at end of file diff --git a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_lighttpd_froxlor-awstats.conf b/templates/misc/configfiles/ubuntu_hardy/awstats/etc_lighttpd_froxlor-awstats.conf deleted file mode 100644 index c5369bb3..00000000 --- a/templates/misc/configfiles/ubuntu_hardy/awstats/etc_lighttpd_froxlor-awstats.conf +++ /dev/null @@ -1,19 +0,0 @@ -#alias.url += ( -# "/js/awstats_misc_tracker.js" => "/usr/share/awstats/wwwroot/js/awstats_misc_tracker.js" -#) - -$HTTP["url"] =~ "^/awstats" { - alias.url += ( - "/awstats/" => "", - "/awstats" => "awstats.pl", - "/awstats.pl" => "awstats.pl" -# "/awstatsicons/" => "/usr/share/awstats/wwwroot/icon/" - ) - - index-file.names = ( "awstatstotals.php" ) - - cgi.assign = ( - ".pl" => "/usr/bin/perl", - ".cgi" => "/usr/bin/perl" - ) -} \ No newline at end of file