Skip to content

Commit 6a80e6b

Browse files
committed
Fixed webalizer and awstats support for Debian/Ubuntu
1 parent 170098c commit 6a80e6b

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

bin/v-add-web-domain-stats

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ upd_web_domain_values
5454
cat $WEBTPL/$type/$type.tpl |\
5555
sed -e "s/%ip%/$ip/g" \
5656
-e "s/%web_port%/$WEB_PORT/g" \
57+
-e "s/%web_system%/$WEB_SYSTEM/g" \
5758
-e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \
59+
-e "s/%rgroups%/$WEB_RGROUPS/g" \
60+
-e "s/%proxy_system%/$PROXY_SYSTEM/g" \
5861
-e "s/%proxy_port%/$PROXY_PORT/g" \
5962
-e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \
6063
-e "s/%domain_idn%/$domain_idn/g" \
@@ -66,8 +69,11 @@ cat $WEBTPL/$type/$type.tpl |\
6669
> $HOMEDIR/$user/conf/web/$type.$domain.conf
6770

6871
if [ "$type" == 'awstats' ]; then
72+
rm -f /etc/awstats/$type.$domain_idn.conf
6973
ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \
7074
/etc/awstats/$type.$domain_idn.conf
75+
else
76+
mkdir -p /var/lib/webalizer
7177
fi
7278

7379

bin/v-change-web-domain-stats

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ upd_web_domain_values
6666
cat $WEBTPL/$type/$type.tpl |\
6767
sed -e "s/%ip%/$ip/g" \
6868
-e "s/%web_port%/$WEB_PORT/g" \
69+
-e "s/%web_system%/$WEB_SYSTEM/g" \
6970
-e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \
71+
-e "s/%rgroups%/$WEB_RGROUPS/g" \
72+
-e "s/%proxy_system%/$PROXY_SYSTEM/g" \
7073
-e "s/%proxy_port%/$PROXY_PORT/g" \
7174
-e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \
7275
-e "s/%domain_idn%/$domain_idn/g" \
@@ -78,8 +81,11 @@ cat $WEBTPL/$type/$type.tpl |\
7881
> $HOMEDIR/$user/conf/web/$type.$domain.conf
7982

8083
if [ "$type" == 'awstats' ]; then
84+
rm -f /etc/awstats/$type.$domain_idn.conf
8185
ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \
8286
/etc/awstats/$type.$domain_idn.conf
87+
else
88+
mkdir -p /var/lib/webalizer
8389
fi
8490

8591

bin/v-update-web-domain-stat

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ build_webalizer() {
6060
}
6161

6262
build_awstats() {
63-
awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"
64-
wwwroot="/usr/share/awstats/wwwroot"
63+
if [ -e "/etc/redhat-release" ]; then
64+
awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"
65+
wwwroot="/usr/share/awstats/wwwroot"
66+
else
67+
awstats="/usr/lib/cgi-bin/awstats.pl"
68+
wwwroot="/usr/share/awstats"
69+
fi
6570
opts="-config=$domain_idn -staticlinks -update -output"
6671
month=$(date "+%Y-%m")
6772
output='alldomains allhosts lasthosts unknownip allrobots lastrobots
@@ -116,8 +121,6 @@ build_awstats() {
116121
11) month='November';;
117122
12) month='December';;
118123
esac
119-
echo $month
120-
121124
select_m="$select_m<option value=$link>$month $year<\/option>\n"
122125
done
123126
cat $WEBTPL/awstats/nav.tpl | sed "s/%select_month%/$select_m/" >\

0 commit comments

Comments
 (0)