diff -Naur syscp-1.4.2.1/lib/functions.php syscp/lib/functions.php
--- syscp-1.4.2.1/lib/functions.php	2009-04-18 13:28:57.000000000 +0200
+++ syscp/lib/functions.php	2009-04-24 17:10:44.175507211 +0200
@@ -2005,30 +2005,35 @@
 
 function createAWStatsConf($logFile, $siteDomain, $hostAliases)
 {
-	global $pathtophpfiles;
+	global $pathtophpfiles, $settings;
 
 	// Generation header
 
 	$header = "## GENERATED BY SYSCP\n";
 	$header2 = "## Do not remove the line above! This tells SysCP to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure SysCP won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n";
+	$confdir = $settings['system']['awstats_domain_file'];
+	if(substr($confdir,-1,1) != '/')
+	        $confdir .= '/';
 
 	// These are the variables we will replace
 
 	$regex = array(
 		'/\{LOG_FILE\}/',
 		'/\{SITE_DOMAIN\}/',
-		'/\{HOST_ALIASES\}/'
+		'/\{HOST_ALIASES\}/',
+                '/\{AWSTATS_CONFDIR\}/',
 	);
 	$replace = array(
 		$logFile,
 		$siteDomain,
-		$hostAliases
+		$hostAliases,
+		$confdir
 	);
 
 	// File names
-
-	$domain_file = '/etc/awstats/awstats.' . $siteDomain . '.conf';
-	$model_file = '/etc/awstats/awstats.model.conf.syscp';
+
+	$domain_file = $confdir . 'awstats.' . $siteDomain . '.conf';
+	$model_file = $confdir . 'awstats.model.conf.syscp';
 
 	// Test if the file exists
 
