<r>apt install awstats<br/>
sudo apt-get install libnet-dns-perl<br/>
sudo apt-get install libnet-ip-perl <br/>
sudo apt install Net::IP<br/>
sudo apt-get install libgeo-ipfree-perl<br/>
<br/>
nano /etc/apache2/conf-available/awstats.conf
<CODE><s>[code]</s># create new

Alias /awstats-icon/ /usr/share/awstats/icon/
Alias /awstatsclasses/ /usr/share/java/awstats/

&lt;Directory /usr/share/awstats&gt;
    Options FollowSymLinks
    AllowOverride None
    # access permission for your local network
&lt;/Directory&gt;
<e>[/code]</e></CODE>
sudo usermod -a -G adm www-data<br/>
chown root:adm /var/log/apache2<br/>
chmod 755 /var/log/apache2<br/>
chmod 644 /var/log/apache2/*.log<br/>
sudo a2enconf awstats <br/>
sudo a2enmod cgid<br/>
sudo systemctl restart apache2<br/>
/usr/share/awstats/tools/update.sh <br/>
#請靜候更新完,滑鼠游標會在下一列新的提示符號旁<br/>
/usr/share/awstats/tools/buildstatic.sh<br/>
nano /etc/cron.d/awstats<br/>

<CODE><s>[code]</s>MAILTO=root
# 把www-data改成root
*/10 * * * * root [ -x /usr/share/awstats/tools/update.sh ] &amp;&amp; /usr/share/awstats/tools/update.sh

# Generate static reports:
10 03 * * * root [ -x /usr/share/awstats/tools/buildstatic.sh ] &amp;&amp; /usr/share/awstats/tools/buildstatic.sh
<e>[/code]</e></CODE></r>