Strona 1 z 1
[rozw.] apache jak zrobić stronę na hasło?
: 2016-01-19, 11:47
autor: cent4
Witam.
Problem jak w tytule.
Mam squidanalyzera i dostęp do niego jest poprzez adres: IPSERVERA/dane/squidreport/
w katalogu tej strony: /var/www/htdocs/dane/squidreport mam: .htaccess:
Kod: Zaznacz cały
AuthName "Podaj haslo"
AuthType Basic
AuthUserFile /etc/httpd/.htpasswd
require valid-user
W /etc/httpd/.htpasswd mam plik .htpasswd:
user:zaszyfrowane_haslo_usera.
Niby wszystko powinno działać, ale jak wchodzę na adres tej strony: IPSERVERA/dane/squidreport/
to nie pyta mnie o hasło tylko od razu pokazuje stronę
Co robię źle?
Re: apache jak zrobić stronę na hasło?
: 2016-01-19, 16:03
autor: tomatau
Dodaj po AuthType Basic
.htpasswd może być czytane przez apacha?
Re: apache jak zrobić stronę na hasło?
: 2016-01-20, 07:14
autor: cent4
Niestety - po dodaniu tego wpisu i restarcie apache dalej brak efektu.
Dalej swobodnie można wejść na stronę, nie podając żadnego hasła.
Re: apache jak zrobić stronę na hasło?
: 2016-01-20, 14:04
autor: tomatau
W httpd.conf w sekcji directory dla squiderporta masz dyrektywe?
Re: apache jak zrobić stronę na hasło?
: 2016-01-20, 14:48
autor: cent4
Mam tam:
Kod: Zaznacz cały
<Directory />
#AllowOverride none
AllowOverride AuthConfig
Require all denied
</Directory>
Re: apache jak zrobić stronę na hasło?
: 2016-01-20, 15:37
autor: tomatau
W logach się nic nie pojawia?
Może nie wczytuje się odpowiedni moduł?
Tutaj info:
http://httpd.apache.org/docs/2.4/howto/auth.html
Re: apache jak zrobić stronę na hasło?
: 2016-01-28, 14:43
autor: cent4
W logach nie widzę nic szczególnego...
Proszę o dalszą pomoc.
Re: apache jak zrobić stronę na hasło?
: 2016-01-29, 10:05
autor: cent4
W configu httpd.conf mam:
Kod: Zaznacz cały
<VirtualHost *>
<Directory />
#AllowOverride AuthConfig
#Require all denied
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/htdocs/dane/squidreport/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>
</VirtualHost>
Re: apache jak zrobić stronę na hasło?
: 2016-02-02, 22:21
autor: cent4
Problem był w konfiguracji apache:
Kod: Zaznacz cały
<Directory />
AllowOverride none
Require all denied
</Directory>
<Directory "/srv/httpd/htdocs">
Options Indexes FollowSymLinks
Require all granted
</Directory>
<Directory "/srv/httpd/htdocs/squidreport">
Options Indexes FollowSymLinks Includes MultiViews
AllowOverride AuthConfig
Order allow,deny
Allow from all
Require all granted
</Directory>
Re: [rozw.] apache jak zrobić stronę na hasło?
: 2016-02-02, 22:27
autor: cent4
Podziękowanie dla użytkownika webster, który jest autorem rozwiązania