A
A
AndreyTT2015-09-06 15:51:33
Apache HTTP Server
AndreyTT, 2015-09-06 15:51:33

How to close LIGHTSQUID page in Apache2 webserver using .htaccess?

Installed Apache2 server, Squid proxy server and a set of CGI scripts aka lightsquid to display Squid usage statistics. The lightsqduid itself is hooked into Apache2 as a conf module (conf-available).
In apache2.conf:
< Directory /usr/share/lightsquid/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
< /Directory>
< Directory /usr/lib/cgi-bin/lightsquid/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
< /Directory>

In the same directories is the .htaccess file:
Options FollowSymlinks ExecCGI
DirectoryIndex index.cgi
AuthType Basic
AuthName "STATISTIK"
AuthUserFile /usr/share/lightsquid/.htpasswd
Require valid-user

As a result, on 10.10.10.1/lightsquid, full statistics are opened, without any password.
PS Basic Auth module works - tested on Apache2 home page.
How to tie authorization by password?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Olj, 2016-05-20
@AndreyTT

It worked for me after changing in /etc/apache2/conf-enabled/lightsquid.conf:

Alias   /lightsquid/    /usr/lib/cgi-bin/lightsquid/
Location "/lightsquid/">
        AddHandler cgi-script .cgi
        AuthType Basic
        AuthName "Restricted Content"
        AuthUserFile /usr/share/lightsquid/.htpasswd
        Require valid-user
</Location>

O
O. J, 2015-10-02
@OrlovEvgeny

httpd.apache.org/docs/2.2/mod/core.html#allowoverride
change to:
AllowOverride AuthConfig

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question