http://www.pronix.de -> Forum -> Administration, Konfiguration

Forum: Administration, Konfiguration

Moderatoren: Herb, Martin Conrad

Thema: [gelöst] - Apache2 Virtual Hosts DirectoryIndex

  • (nur registrierte Mitglieder)
Auf einem Debian Lenny 2.6.26-2-686 läuft ein Apache/2.2.9 mit vielen Virtual Hosts.
Der Aufbau der Konfigurationsdateien der Virtual Hosts ist immer gleich.
Hier ein Beispiel.

VirtualHost unter /etc/apache2/sites-available/foobar.tld
<VirtualHost *:80>
 Include /etc/apache2/mods-available/fcgid.conf

 ServerName www.foobar.tld:80
 ServerAlias foobar.tld
 ServerAdmin webmaster@foobar.tld
 DocumentRoot "/var/www/foobar.tld/htdocs"

 SuexecUserGroup foobar foobar

 DirectoryIndex index.htm index.html index.php

 ErrorLog /var/www/foobar.tld/log/error.log
 LogLevel warn
 CustomLog /var/www/foobar.tld/log/access.log combined
 ServerSignature Off

 <Directory "/var/www/foobar.tld/htdocs">
  AddHandler fcgid-script .php .php3 .php4 .php5
  FCGIWrapper /var/www/php-fcgi-scripts/foobar.tld/php-fcgi-starter .php
  Options -Indexes MultiViews FollowSymLinks +ExecCGI
  Order allow,deny
  Allow from all
  AllowOverride All
 </Directory>

 <Directory />
  Options FollowSymLinks
  AllowOverride None
 </Directory>

 <Directory /usr/share/phpmyadmin>
  AddHandler fcgid-script .php .php3 .php4 .php5
  FCGIWrapper /var/www/php-fcgi-scripts/foobar.tld/php-fcgi-starter .php
  Options FollowSymLinks +ExecCGI -Indexes
  AllowOverride All
  Order allow,deny
  Allow from all
 </Directory>

 <IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
  RewriteRule .* - [F]
 </IfModule>

</VirtualHost>


/etc/apache2/mods-available/fcgid.conf
<IfModule mod_fcgid.c>
  AddHandler    fcgid-script .fcgi
  FcgidConnectTimeout 20
  FcgidMaxRequestsPerProcess 500
  # Nach Fehlermeldung
  # mod_fcgid: HTTP request length 135714 (so far) exceeds MaxRequestLen (131072)
  # auf 15 MB erweitert.
  FcgidMaxRequestLen 15728640
</IfModule>


Mir geht es hier um die Direktive DirectoryIndex, die sich in meiner Konfiguration nicht wie von mir erwartet verhält.
Unter /var/www/foobar.tld/htdocs liegen die Dateien index.html und index.php und keine .htaccess Datei.
Entsprechend der Konfiguration wird beim Aufruf der Domain www.foobar.tld die Datei index.html ausgeliefert.
Nun wird die index.html umbenannt in _index.html.
Entsprechend der Konfiguration wird beim Aufruf der Domain www.foobar.tld die Datei index.php ausgeliefert.
Nun wird die _index.html umbenannt in index.html.OLD.
Beim Aufruf der Domain www.foobar.tld wird nun die Datei index.html.OLD als Download angeboten?!

Ideen?

Gruß,
Patrick-Oliver

--
To follow the path: look to the master, follow the master, walk with the master, see through the master, become the master.

 
http://www.oreillynet.com/linux/blog/2006/06/apache2_issues_indexhtmlold_mu.html

Scheint so, als würde das an Multiviews-Funktionalität liegen.
So ganz zufrieden bin ich damit aber noch nicht, denn wenn die index.html nicht in index.html.old umgewandelt wird, sondern in index.html.test, dann wird die index.php ausgeliefert.

Edit:
Hm, index.html.de geht auch. Ich glaube, ich bin doch mit der Begründung zufrieden Grafik: Smilie Gluecklich

--
To follow the path: look to the master, follow the master, walk with the master, see through the master, become the master.

 
 <Directory "/var/www/foobar.tld/htdocs">
  AddHandler fcgid-script .php .php3 .php4 .php5
  FCGIWrapper /var/www/php-fcgi-scripts/foobar.tld/php-fcgi-starter .php
  Options -Indexes -MultiViews FollowSymLinks +ExecCGI
  Order allow,deny
  Allow from all
  AllowOverride All
 </Directory>


Mit der Option -MultiViews wird dieses "Feature" deaktiviert.

--
To follow the path: look to the master, follow the master, walk with the master, see through the master, become the master.

 
  • (nur registrierte Mitglieder)