Options -Indexes

Apache, Lighttpd, nginx, Cherokee
Post Reply
binford6100turbo
Posts: 35
Joined: 2005-12-30 13:38
 

Options -Indexes

Post by binford6100turbo »

Hallo zusammen,

ich möchte nicht, dass beim Aufruf eines Verzeichnisses dessen gesamter Inhalt angezeigt wird.

Kann man das per default abschalten? Habe in der apache2.conf keinen entsprechenden Eintrag gefunden.

Finde es umständlich in jedes Haupt-Verzeichnis eine .htaccess legen zu müssen.

Wo wir gerade dabei sind. Habe zum Testen eine .htaccess erstellt mit dem Inhalt:
Options -Indexes
Wenn ich nun das Verzeichnis über den Browser öffne, erhalte ich einen Error 500 (Internal Server Error). Sollte hier nicht ein Error 403 ausgegeben werden? Ist die Syntax korrekt?

Gruß
Binford
rootsvr
Posts: 538
Joined: 2005-09-02 11:12
Contact:
 

Re: Options -Indexes

Post by rootsvr »

Ich vermute Du hast in der httpd.conf
AllowOverride None

brauchst aber
AllowOverride Options

Generell kann man aber Indexes auch zentral in der httpd.conf abschalten.

Bei nem Internal Server Error sollte aber auch die Error.log was ausspucken
binford6100turbo
Posts: 35
Joined: 2005-12-30 13:38
 

Re: Options -Indexes

Post by binford6100turbo »

also in der httpd.conf stehen meine ganzen Virtualhosts. Hier steht aber nix von "AllowOverride None"

Gruß
Binford
sledge0303
Posts: 695
Joined: 2005-09-16 00:06
Location: Berlin-Reinickendorf
Contact:
 

Re: Options -Indexes

Post by sledge0303 »

Ich errate mal das du Debian hast, wenn ja bist du hier goldrichtig mit deinen Einstellungen:

Code: Select all

/etc/apache2/mods-available/<deinhost>

User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Options -Indexes

Post by Joe User »

PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
Contact:
 

Re: Options -Indexes

Post by daemotron »

In Deine httpd.conf:

Code: Select all

<Directory "/pfad/zur/homepage">
  Options -Indexes -FollowSymLinks
</Directory>
Links zum Thema:
http://httpd.apache.org/docs/2.0/mod/core.html#options
http://httpd.apache.org/docs/2.0/mod/co ... #directory
binford6100turbo
Posts: 35
Joined: 2005-12-30 13:38
 

Re: Options -Indexes

Post by binford6100turbo »

hier mal ein Virtualhost aus meiner httpd.conf:

<VirtualHost 123.456.78.90:80>
ServerName meinedomain.de
ServerAlias http://www.meinedomain.de
DocumentRoot /var/www/domains/meinedomain.de/htdocs
ErrorLog /var/www/domains/meinedomain.de/logs/error_log
CustomLog /var/www/domains/meinedomain.de/logs/access.log combined
</VirtualHost>

Wo muss das mit dem AllowOverride Options hin?

Gruß
Binford
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
Contact:
 

Re: Options -Indexes

Post by daemotron »

Code: Select all

<VirtualHost 123.456.78.90:80> 
ServerName meinedomain.de 
ServerAlias www.meinedomain.de 
DocumentRoot /var/www/domains/meinedomain.de/htdocs 
ErrorLog /var/www/domains/meinedomain.de/logs/error_log 
CustomLog /var/www/domains/meinedomain.de/logs/access.log combined 

<Directory "/var/www/domains/meinedomain.de/htdocs">
  AllowOverride Options
  Options -Indexes
</Directory>

</VirtualHost> 
binford6100turbo
Posts: 35
Joined: 2005-12-30 13:38
 

Re: Options -Indexes

Post by binford6100turbo »

so, habs drin, aber der verzeichnisinhalt wird immernoch angezeigt. Apache-Restart hab ich natürlich gemacht! Die .htaccess kann ich in dem betroffenen Verzeichnis ja dann löschen, oder?!
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Options -Indexes

Post by Joe User »

Warum entlädst Du nicht einfach mod_autoindex?
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
tiberian
Posts: 61
Joined: 2006-04-14 01:45
 

Re: Options -Indexes

Post by tiberian »

Hi,

ich habe gerade genau das gleiche Problem.

Die Konfiguration ist wie folgt:

Code: Select all

<VirtualHost 111.111.111.111:80>
        DocumentRoot /abc/def/xyz/andreas
        ServerName andreas.domain.tld
        ServerAdmin webmaster@domain.tld
        ErrorLog  /abc/def/andreas/log/andreas-error.log
        CustomLog /abc/def/andreas/log/andreas-access.log combined
        <Directory /abc/def/domain.tld/andreas/>
          AllowOverride All
          Options +Includes -Indexes
          Allow from all
        </Directory>
</VirtualHost>                                                                                                                                                
Aber es funktioniert nicht. Weder im angegebenen Document root noch in den Unterordnern.
Und ich möchte mod_autoindex nicht deaktivieren, da ich es in manchen Verzeichnissen brauche.

Jemand eine idee ?

Danke

Grüße
Tiberian
tiberian
Posts: 61
Joined: 2006-04-14 01:45
 

Re: Options -Indexes

Post by tiberian »

wirklich keiner ne Idee woran das liegen könnte ?

Ich verzweifel grad ein bisschen dran und finde auch keine irgendwie passende antwort dazu bei google.

Das komische is ja das es eigentlich bei allen anderen Vhosts funktioniert, nur bei diesem nicht..

Danke

Grüße
Tiberian
Anonymous
 

Re: Options -Indexes

Post by Anonymous »

Hi,
bei mir funktioniert es mit exakt dieser config (allerdings mit NameVirtualHost, aber das duerfte keinen Unterschied machen).

Der Fehler muss also woanders liegen...


Daniel
tiberian
Posts: 61
Joined: 2006-04-14 01:45
 

Re: Options -Indexes

Post by tiberian »

Hi,

Jo ich benutze auch Namevirtualhosts und hab noch ca. 30 andre Vhosts.
Auf allen andren Vhosts funktioniert das auch...

Drum versteh ich das ja net.

Grüße
Tiberian
Post Reply