4 . /usr/share/debconf/confmodule
6 LOGAPACHE="/etc/alternc/awstats.log.alternc.conf"
7 APACHEROTATE="/etc/logrotate.d/apache2"
10 cp -a -f $APACHEROTATE $APACHEROTATE.tmp
11 sed -e 's/create 640 root adm/create 640 root www-data/' < $APACHEROTATE > $APACHEROTATE.tmp
12 mv -f $APACHEROTATE.tmp $APACHEROTATE
18 # Then, configure the quota for "aws"
19 db_get alternc-awstats/default_quota_value || true
20 /usr/lib/alternc/quota_init aws $RET
24 echo "Installing mysql table"
25 mysql --defaults-file=/etc/alternc/my.cnf \
26 </usr/share/alternc/awstats.sql || true
28 # Refresh apache configuration
29 # configure /etc/alternc/templates/apache/httpd.conf
30 # configure /etc/alternc/templates/apache-ssl/httpd.conf
32 if [ -d /etc/apache2/conf-enabled ]; then
33 if [ ! -L /etc/apache2/conf-enabled/alterncawstats.conf ]; then
34 ln -sf /etc/alternc/alterncawstats.conf \
35 /etc/apache2/conf-enabled/alterncawstats.conf
37 # build awstats.log.alternc.conf if it does not exist
38 if [ ! -f $LOGAPACHE ]; then
39 cat > $LOGAPACHE <<EOF
40 #LogFile directive isn't important here :
41 #Awstats is launched with the good "LogFile" directive when called
42 LogFile="/var/log/apache2/access.log"
43 LogFormat="%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot %other %virtualname"
46 chown alterncpanel:root $LOGAPACHE
53 touch /etc/alternc/awstats.htpasswd
54 chown alterncpanel /etc/alternc/awstats.htpasswd /etc/awstats
55 chmod 640 /etc/alternc/awstats.htpasswd
56 chmod 755 /etc/awstats
57 mkdir -p /var/cache/awstats
58 chown alterncpanel:www-data /var/cache/awstats
59 chmod 770 /var/cache/awstats
61 # Update rights on previous user's awstats configuration files
62 chown alterncpanel:root /etc/awstats/awstats.*.conf > /dev/null 2>&1 || true
64 echo -e "\033[31m**********************************************"
65 echo "* ALTERNC-AWSTATS ACTION REQUESTED *"
66 echo "* If you add an autorized user called 'admin'*"
67 echo "* in statistics section, he will access *"
68 echo "* every stats of every users *"
70 echo "* Please run alternc.install to fully deploy *"
71 echo "**********************************************"
75 abort-upgrade|abort-remove|abort-deconfigure)
79 echo "postinst called with unknown argument \`$1'" >&2
84 # dh_installdeb will replace this with shell code automatically
85 # generated by other debhelper scripts.