bngi2k
Goto Top

Apache htaccess Einstellungen

Hallo zusammen!
Ich habe einen Apache2 Webserver unter openSUSE 10.3 laufen.
Nun wollte ich bestimmte Ordner per .htaccess schützen, dies funktioniert allerdings nicht.
Es passiert nichts beim Aufruf dieser Seiten. Ich denke es liegt daran das irgendwie das .htaccess deaktiviert ist. Wobei die .htaccess, .htpasswd und httpd.conf von den einstellungen her richtig sind, oder sehe ich das falsch?
Woran kann es sonst noch liegen? Noch irgendwelche Parameter in der httpd.conf oder sonst irgendwo?

.htaccess
AuthUserFile "/srv/www/htdocs/admin/.htpasswd"
AuthType Basic
AuthName "admin"
require valid-user

.htpasswd
benutzer:passwort

httpd.conf
-> forbid access to the entire filesystem by default
<Directory />
Options none
AllowOverride None
Order deny,allow
Deny from all
</Directory>

<Directory "/srv/www/htdocs">
Options none
AllowOverride All
Order allow,deny
Allow from all
</Directory>

->use .htaccess files for overriding,
AccessFileName .htaccess
->and never show them
<Files ~ "^\.ht">
Order allow,deny
deny from all
</Files>

Content-Key: 74610

Url: https://administrator.de/contentid/74610

Printed on: April 19, 2024 at 08:04 o'clock

Member: Dani
Dani Nov 27, 2007, updated at Oct 18, 2012 at 16:32:44 (UTC)
Goto Top
Hi!
Also soweit ich mich erinne, darfst du nichts in der httpd.conf edtieren (für dein Vorhaben). Kenne mal kein Howto wo das drin steht. face-smile

Ich habe mal vor langer Zeit eine Anleitung dazu geschrieben. Das funktioniert auf jeden Fall unter Linux und Windows.

Du musst einfach in die entsprechenden Verzeichnisse, die .htaccess Datei legen. Die .htpasswd am besten Außerhalb des WWW root-Verzeichnisses.


Grüße
Dani
Member: BNGI2k
BNGI2k Nov 28, 2007 at 11:47:48 (UTC)
Goto Top
Nein hat doch nichts mit dem .htaccess selber zu tun!

Das muss irgend ne Option beim Apache sein, mit der das deaktivert ist, bzw. erst aktiviert werden kann.
Member: Dani
Dani Nov 28, 2007 at 12:56:44 (UTC)
Goto Top
Hi!
Ach du hast die Config des Apache geändert! Denn standardmäßig geht .htaccess bei mir (OpenSuse). Hier mal meine Auszüge (/etc/apache2/httpd.conf):
# forbid access to the entire filesystem by default
<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">  
    Order allow,deny
    Deny from all
</Files>
Funktioniert! face-smile


Grüße
Dani
Member: BNGI2k
BNGI2k Nov 28, 2007 at 14:53:20 (UTC)
Goto Top
Wie gesagt, habe meine Einstellungen geändert und deine eingetragen, geht trotzdem nicht.
Hab in der httpd.conf schon vieles ausprobiert, geht nicht.
Nichtmal wenn ich "AllowOverride All", "Allow from All" etc. eintrage.

Keinen Plan was ich noch machen muss.
Member: BNGI2k
BNGI2k Nov 29, 2007 at 14:52:09 (UTC)
Goto Top
Hat keiner ne Idee?
Ist wichtig!
Member: DJRobin
DJRobin May 19, 2008 at 17:18:01 (UTC)
Goto Top
Also bei mir sieht die .htaccess datei so aus:

AuthType Basic
AuthName "DEN Passwortgeschuetzter Bereich"
AuthUserfile "../htdocs/.htpasswd"
Require valid-user

Allerdings läuft mein Apache 2 auf Windows Vista xD

Good luck !!