vim /usr/local/apache2/conf/httpd.conf

<Files "awstats.pl">
    AuthType Basic
    AuthName "awstat access"
    AuthUserFile "/usr/local/awstats/htpasswd.users"
    Require valid-user
</Files>

然后

/usr/local/apache2/bin/htpasswd -c /etc/awstats/htpasswd admin

New password:
Re-type new password:
Adding password for user admin

/usr/local/apache2/bin/apachectl stop

/usr/local/apache2/bin/apachectl start

即可