You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mário Gamito <mg...@telbit.pt> on 2007/04/09 13:38:02 UTC

[users@httpd] How to protect awstats page

Hi,

I have this awstats in:
http://www.telbit.pt/awstats/awstats.pl?config=www.telbit.pt

I want to protect it with a login and password.

awstats.pl is located outside Apache's DocumentRoot in
/usr/local/awstats/wwwroot/cgi-bin

I put there a .htaccess file with the following contents:
"AuthUserFile /usr/local/awstats/wwwroot/cgi-bin/.htpasswd
AuthName "stats"
AuthType Basic
require valid-user"

but it doesn't work, the page is unprotected.

Also i've tried to put put the .htaccess file in
/usr/local/awstats/
but no good either.

Any help would be appreciated.

Warm Regards
-- 
:wq! Mário Gamito

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to protect awstats page

Posted by Sander Temme <sc...@apache.org>.
On Apr 9, 2007, at 4:38 AM, Mário Gamito wrote:

> awstats.pl is located outside Apache's DocumentRoot in
> /usr/local/awstats/wwwroot/cgi-bin
>
> I put there a .htaccess file with the following contents:
> "AuthUserFile /usr/local/awstats/wwwroot/cgi-bin/.htpasswd
> AuthName "stats"
> AuthType Basic
> require valid-user"
>
> but it doesn't work, the page is unprotected.

You'll need to have AllowOverride set to (at least) AuthConfig for  
the directory. For instance, the default configuration file has a

<Directory />
   Options FollowSymLinks
   AllowOverride None
</Directory>

Change that AllowOverride None to AllowOverride AuthConfig, and  
you're good.  Alternatively, you can put the configuration language  
in a <Directory> block in your httpd.conf, which takes away the need  
for .htaccess altogether.

S.

-- 
sctemme@apache.org            http://www.temme.net/sander/
Open Source Software Consultant
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

ApacheCon 2007 Europe, May 1-4 in Amsterdam
http://www.eu.apachecon.com/