Jump to Navigation

190 - How to do Password Protect for awstats

awstats does not have a functionality on like login password protection.
You could configure that on the Apache Server. The following sample is that you installed awstats in the custom directory.

1. awstats URL

http://mywebsite/awstats/awstats.pl?config=mywebsite

2. Register a user for Apache Server

# htpasswd -c /etc/httpd/.htpasswd admin

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

3. Edit configuration ( ex. /etc/httpd/conf/httpd.conf )

The following sample is a virtual Host (web server)

<VirtualHost *:80>
DocumentRoot "/home/worda/html"
ServerName mywebsite
ErrorLog /home/worda/logs/error_log
LogLevel warn
CustomLog /home/worda/logs/access_log combined

<Directory "/home/worda/html">
allow from all
Options +Indexes
</Directory>

# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/home/worda/html/awstats/wwwroot/classes/"
Alias /awstatscss "/home/worda/html/awstats/wwwroot/css/"
Alias /awstatsicons "/home/worda/html/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/home/worda/html/awstats/wwwroot/cgi-bin/"

<Directory "/home/worda/html/awstats/wwwroot">
AuthUserFile    /etc/httpd/conf/.htpasswd
AuthGroupFile   /dev/null
AuthName        "Please Enter Your Password"
AuthType        Basic
Require valid-user
</Directory>

</VirtualHost>

4. Restart Apache Server

# service httpd restart

or

# /etc/init.d/httpd restart

 



Main menu 2

Story | by Dr. Radut