PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Apache & .htaccess / .htpasswd



HeighT
28.03.02, 20:35
versuche gerade einen ordner mit .htaccess & .htpasswd zu schützen!! ...bekomme dies aber nicht hin!! folgendermassen sehen meine files aus:

.htaccess:

AuthName "Test"
AuthType Basic
AuthUserFile /usr/local/httpd/htdocs/test/.htpasswd
require valid-user

.htpasswd:

admin:test

aycaramba
28.03.02, 20:38
Hallo,

das Passwort in der .htpasswd muss verschlüsselt sein. Das Tool liefert Apache mit, es heißt htpasswd.
Zudem sollte man darauf achten, dass die Passwortdatei nicht im Dokumentenbereich liegt, sonder dort, wo sie nicht "per Browser" erreichbar ist.

Gruß Marc

HeighT
28.03.02, 21:21
yo habs mit "htpasswd -c .htpasswd user" erstellt - aber leider funzt es immernoch nicht:( :( ...muss ich denn noch etwas berachten...beim apache oder bei den rechten oder so??

danke

aycaramba
28.03.02, 21:26
Versuch es mal so:

.htaccess:



AuthUserFile /pfad_zu_.htpasswd/.htpasswd
AuthName "Admin's Area"
AuthType Basic

<Limit GET>
require valid-user
</Limit>



sorry für die blöde Darstellung, aber irgendwie wollte das Forum das anders nicht korrekt darstellen.


Gruß Marc

HeighT
28.03.02, 21:42
mmmhhhh...ne funzt auch net!...das muss ein anderes problem sein?!

aycaramba
28.03.02, 21:47
Ja, es gibt da noch einen Eintrag in der httpd.conf

Der sieht standardmässig so aus:

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride none

Aus dem "none" musst Du ein "All" machen.

Gruß Marc

HeighT
28.03.02, 22:01
das ist das einzige, was bei mir zu .htaccess steht:

#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess files from being viewed by
# Web clients. Since .htaccess files often contain authorization
# information, access is disallowed for security reasons. Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files. If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>


mehr nicht - deine option habe ich nicht gefunden?!-.....mmmhhh....mist....was nun?

aycaramba
28.03.02, 22:11
Dann schick mir mal Deine httpd.conf marc-web@gmx.net

Falls Du ssh/telnet auf dem Rechner hast schau ich mir das auch wohl mal kurz an.

Marc

HeighT
28.03.02, 22:52
so...die mail iss raus - danke für deine hilfe - mal schaun, ob du was findest?

HeighT
28.03.02, 23:10
alles klar...dank aycaramba klappt es jetzt - THX nochmal