diff --git a/bin/v-add-web-domain-stats b/bin/v-add-web-domain-stats index fc89b7e5..90592b32 100755 --- a/bin/v-add-web-domain-stats +++ b/bin/v-add-web-domain-stats @@ -65,6 +65,10 @@ cat $WEBTPL/$type.tpl |\ -e "s/%alias_idn%/${aliases_idn//,/ }/g" \ > $HOMEDIR/$user/conf/web/$type.$domain.conf +if [ "$type" == 'awstats' ]; then + ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf /etc/awstats/ +fi + #----------------------------------------------------------# # Vesta # diff --git a/bin/v-delete-web-domain b/bin/v-delete-web-domain index b888b80e..d58cd70c 100755 --- a/bin/v-delete-web-domain +++ b/bin/v-delete-web-domain @@ -85,6 +85,7 @@ fi if [ ! -z "$STATS" ] && [ "$STATS" != 'no' ]; then sed -i "/ $domain$/d" $VESTA/data/queue/webstats.pipe rm -f $HOMEDIR/$user/conf/web/$STATS.$domain.conf + rm -f /etc/awstats/$STATS.$domain.conf fi # Deleting ftp account diff --git a/bin/v-delete-web-domain-stats b/bin/v-delete-web-domain-stats index 886f58ba..04124675 100755 --- a/bin/v-delete-web-domain-stats +++ b/bin/v-delete-web-domain-stats @@ -48,6 +48,7 @@ stats_dir="$HOMEDIR/$user/web/$domain/stats" rm -rf $stats_dir/* # Deleting config +rm -f /etc/awstats/$STATS.$domain.conf rm -f $HOMEDIR/$user/conf/web/$STATS.$domain.conf diff --git a/bin/v-rebuild-user b/bin/v-rebuild-user index 96acea75..88b44180 100755 --- a/bin/v-rebuild-user +++ b/bin/v-rebuild-user @@ -143,7 +143,7 @@ fi if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then touch $USER_DATA/db.conf chmod 660 $USER_DATA/db.conf - echo "v-update-databases-disk $user" >> $VESTA/data/queue/disk.pipe + echo "v_update_datbases_disk $user" >> $VESTA/data/queue/disk.pipe fi if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'no' ]; then diff --git a/bin/v-rebuild-web-domains b/bin/v-rebuild-web-domains index 356a30e0..107c2621 100755 --- a/bin/v-rebuild-web-domains +++ b/bin/v-rebuild-web-domains @@ -136,6 +136,12 @@ for domain in $(shell_list) ; do -e "s/%alias_idn%/${aliases_idn//,/ }/g" \ > $HOMEDIR/$user/conf/web/$STATS.$domain.conf + if [ "$STATS" == 'awstats' ]; then + if [ ! -e "/etc/awstats/$STATS.$domain.conf" ]; then + ln -s $HOMEDIR/$user/conf/web/$STATS.$domain.conf /etc/awstats/ + fi + fi + webstats="$BIN/v-update-web-domain-stat $user $domain" check_webstats=$(grep "$webstats" $VESTA/data/queue/webstats.pipe) if [ -z "$check_webstats" ]; then diff --git a/bin/v-update-web-domain-stat b/bin/v-update-web-domain-stat index 0f47a0cc..b98acfbf 100755 --- a/bin/v-update-web-domain-stat +++ b/bin/v-update-web-domain-stat @@ -60,46 +60,70 @@ build_webalizer() { } build_awstats() { - awstats="/var/www/awstats" - awstats_options="-config=$config -staticlinks -update -output" + awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" + wwwroot="/usr/share/awstats/wwwroot" + opts="-config=$domain -staticlinks -update -output" month=$(date "+%Y-%m") - output='alldomains allhosts lasthosts unknownip allrobots lastrobots - session urldetail urlentry urlexit osdetail unknownos - browserdetail unknownbrowser refererse refererpages keyphrases - keywords errors404' + output='alldomains allhosts lasthosts unknownip allemails lastemails + allemailr lastemailr alllogins lastlogins allrobots lastrobots + urldetail urldetail:filter urlentry urlentry:filter urlexit + urlexit:filter osdetail browserdetail unknownbrowser unknownos + refererse refererpages keyphrases keywords errors404 allextraX' # Checking statistics directory if [ ! -e "$dir/$month" ]; then mkdir -p $dir/$month fi + # Logo check + if [ ! -e "$dir/logo.png" ]; then + cp -r $VESTA/web/images/logo.png $dir/ + fi + # Icon directory check if [ ! -e "$dir/icon" ]; then - cp -r $awstats/icon $dir/ + cp -r $wwwroot/icon $dir/ fi # Creating main awstats page - $awstats/awstats.pl $awstats_options |\ - sed -e "s%awstats.$config.%%g" > $dir/$month/index.html + $awstats $opts | sed -e "s%awstats.$domain.%%g" > $dir/$month/index.html # Creating suplemental awstats pages for format in $output; do - $awstats/awstats.pl $awstats_options=$format |\ - sed -e "s%awstats.$config.%%g" > $dir/$month/$format.html + $awstats $opts=$format |\ + sed -e "s%awstats.$domain.%%g" > $dir/$month/$format.html done # Creating index page - cat $WEBTPL/awstats_index.tpl | sed -e "s/%month%/$month/g" \ - > $dir/index.html + cat $WEBTPL/awstats_index.tpl | sed -e "s/%month%/$month/g" >\ + $dir/index.html # Creating navigation page months=$(find $dir -type d | sed -e "s%$dir/%%g" -e "s%$dir%%g" |\ - grep -v icon | sort -r ) + grep -v icon | sort -r ) for link in $months; do - select_m="$select_m\t