Securing Awstats
Password protecting Awstats on Rocky Linux 9.x
- Add the following to the end of the httpd.conf file:
<Directory "/usr/share/awstats/wwwroot">
Options None
AllowOverride None
Require all granted
AuthType basic
AuthName "NOC Authentication"
AuthUserFile /etc/awstats/awstats.htpasswd
<Files awstats.pl>
Require valid-user
</Files>
</Directory>
2. In the /etc/awstats directory run the following command as root:
]# htpasswd -c awstats.htpasswd username