Jak udelat slozku v /var/www/html/Films na heslo?

Zdravim,slysel jsem ze to neni tezke,takze mam uzivatele i skupiny,ale nevim kam(viz nize) to mam dat v httpd.conf poradte nekdo pls.

jedna kam dat v httpd.conf toho:

<Directory /var/www/html/films>
AuthType Basic
AuthName Filmy
AuthUserFile /etc/httpd/conf/users
AuthGroupFile /etc/httpd/conf/groups
require group mojegrupa

Podle me to muzes prifarit (pokud to je spravne) na konec httpd.conf.

http://httpd.apache.org/docs/1.3/howto/auth.html - to je pro apache 1.3
http://httpd.apache.org/docs/2.2/howto/auth.html - tohle je pro apache 2.2 (FC6)

tak sem to udelal a stejne se potom httpd nespusti,takze je tam neco spatne.

Jak nespusti? Pise chybu nebo nebezi vubec? A pustil jste httpd? (service httpd start)

kdyz dam na konec httpd.conf toto:
<Directory /var/www/html/films>
AuthType Basic
AuthName Filmy
AuthUserFile /etc/httpd/conf/users
AuthGroupFile /etc/httpd/conf/groups
require group mojegrupa

a pak dam service httpd restart tak se to v pohode vypne,ale pri startu to napise Failed,kdyz to odstranim tak zase vse OK:

Tak se podivejte do logu proc to nejde…:slight_smile: Vytvoril jste ten authuserfile a authgroupfile?

ano

[Wed Mar 21 15:14:24 2007] [error] [client 192.168.80.140] Directory index forbidden by Options directive: /var/www/html/
[Wed Mar 21 15:17:19 2007] [error] [client 192.168.80.140] (2)No such file or directory: Could not open group file: /etc/httpd/conf/groups
[Wed Mar 21 15:17:45 2007] [notice] caught SIGTERM, shutting down
[Wed Mar 21 15:17:45 2007] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Wed Mar 21 15:17:45 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Mar 21 15:17:45 2007] [notice] Digest: generating secret for digest authentication …
[Wed Mar 21 15:17:45 2007] [notice] Digest: done
[Wed Mar 21 15:17:45 2007] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Wed Mar 21 15:17:45 2007] [notice] Apache/2.2.3 (Fedora) configured – resuming normal operations
[Wed Mar 21 15:17:49 2007] [error] [client 192.168.80.140] (2)No such file or directory: Could not open group file: /etc/httpd/conf/groups
[Wed Mar 21 15:17:53 2007] [error] [client 192.168.80.140] (2)No such file or directory: Could not open group file: /etc/httpd/conf/groups
[Wed Mar 21 15:17:56 2007] [error] [client 192.168.80.140] Directory index forbidden by Options directive: /var/www/html/
[Wed Mar 21 15:18:02 2007] [error] [client 192.168.80.140] (2)No such file or directory: Could not open group file: /etc/httpd/conf/groups
[Wed Mar 21 15:18:16 2007] [error] [client 192.168.80.140] Directory index forbidden by Options directive: /var/www/html/
[Wed Mar 21 15:18:57 2007] [notice] caught SIGTERM, shutting down
[Wed Mar 21 15:18:58 2007] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Wed Mar 21 15:18:58 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Mar 21 15:18:59 2007] [notice] Digest: generating secret for digest authentication …
[Wed Mar 21 15:18:59 2007] [notice] Digest: done
[Wed Mar 21 15:18:59 2007] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Wed Mar 21 15:18:59 2007] [notice] Apache/2.2.3 (Fedora) configured – resuming normal operations
[Wed Mar 21 15:19:02 2007] [error] [client 192.168.80.140] (2)No such file or directory: Could not open group file: /etc/httpd/conf/groups
[Wed Mar 21 15:19:08 2007] [error] [client 192.168.80.140] (2)No such file or directory: Could not open group file: /etc/httpd/conf/groups

vyreseno!

Este se s nami podelte o zpusob reseni a bude to skvele :). Kdybyste napsal kratky navod byl byste hrdina dne :).

Tak zde je ten navod jako prvni sem si na konec httpd.conf(/etc/httpd/conf) dal tento text:

<Directory /var/www/html/films> #slozka ktera bude pristupna na heslo
AuthType Basic #typ prihlaseni
AuthName Filmy #zobrazi se pri prihlaseni
AuthUserFile /etc/httpd/conf/users #slozka s uzivateli
AuthGroupFile /etc/httpd/conf/group #slozka se skupinami
require group mojegrupa #skupina

Tak to mam httpd.conf
pozn./nekde…=/etc/httpd/conf
nyni si vytvorime group mojegrupa s uzivatelema user1 a user2
echo “mojegrupa: user1 user2” > /nekde…/group #pou6ijte oba dva prikazy
echo “mojegrupa: user1 user2” > /nekde…/users
nazvy uzivatelu si dejte podle sebe

tedka nastavime heslo pro uzivatele

/usr/bin/htpasswd -b /nekde…/users user1 heslo1

/usr/bin/htpasswd -b /nekde…/users user2 heslo2

misto heslo 1/2 napiste sve heslo

tedka jeste

service httpd restart a je to.