Page 1 of 1
Apache ignoriert .htaccess
Posted: 2007-07-13 21:32
by cashworld
Hallo bin neu hier und bin Linux Newbie,
ich hab folgendes Problem, und zwar der Apache ignoriert meine .htaccess Dateien, die ich für mod_rewrit nutzen will.
httpd.conf Auszug:
Code: Select all
...
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "/srv/www/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
AccessFileName .htaccess
<Files ~ "^.ht">
Order allow,deny
Deny from all
</Files>
...
Es geht nicht, aber ich weiß nicht warum, hat jemand schon mal das Problem gehabt oder kennt die Lösung?
lg
Ben
Re: Apache ignoriert .htaccess
Posted: 2007-07-13 21:38
by dotme
Ignoriert er sie oder fehlt Dir einfach ein "RewriteEngine On"?
Um zu prüfen ob Deine ".htaccess" Datei gelesen wird, könntest Du "unfug" (sprich eine ungültige Anweisung) reinschreiben und gucken ob ein Serverfehler signalisiert wird.
Re: Apache ignoriert .htaccess
Posted: 2007-07-13 21:44
by cashworld
Er Ignoriert sie vollständig.
Re: Apache ignoriert .htaccess
Posted: 2007-07-13 23:33
by Joe User
cashworld wrote:Code: Select all
<Directory "/srv/www/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
Genau genommen dürfte man gar keinen Zugriff auf diesen Host haben...
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 00:14
by jack99
Hallo, möglicherweise gibt es in dem vHost-Verzeichnis bereits eine .htaccess Datei, die genau diese Directory-Direktiven wieder außer Kraft setzt, oder es gibt noch einen anderen Directory-container, der diese Einstellungen überschreibt?
viele Grüße
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 00:32
by cashworld
jack99 wrote:Hallo, möglicherweise gibt es in dem vHost-Verzeichnis bereits eine .htaccess Datei, die genau diese Directory-Direktiven wieder außer Kraft setzt, oder es gibt noch einen anderen Directory-container, der diese Einstellungen überschreibt?
viele Grüße
Wie meinst du das ? Ich bin Root, das mein Server da gibtes kein vhost gerade.
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 00:48
by jack99
poste doch einfach mal die kompletten conf-files deines webservers, so kann man nur Vermutungen anstellen. Ich gehe davon aus, daß Du den Server mit den neuen Einstellungen reloaded hast?
Viele Grüße
jack
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 01:23
by dtdesign
jack99 wrote:poste doch einfach mal die kompletten conf-files deines webservers, so kann man nur Vermutungen anstellen.
ACK aber bitte ohne 5.000 Zeilen Kommentare von Apache, die interessieren hier keinen ;)
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 08:16
by sledge0303
Joe User wrote:cashworld wrote:Code: Select all
<Directory "/srv/www/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
Genau genommen dürfte man gar keinen Zugriff auf diesen Host haben...
Ich zitiere mal Joe User...
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 10:00
by power2linux
cashworld wrote:
Wie meinst du das ? Ich bin Root, das mein Server da gibtes kein vhost gerade.
Hiho,
also VServer != VHost
als Vhost werden die in Apache angelegten unterschiedlichen Domain 7 Webpräsenzen bezeichnet. Dabei ist eine Apache Instanz also für mehrere Hosts(Webseiten) zuständig.
VServer sind mehrere auf einem physikalischen Server emulierte virtuellen Server. Ergo 1 PC, 20 von einander unabhängige Instanzen des Betriebssystems.
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 12:26
by cashworld
httpd.conf:
Code: Select all
ServerName 88.198.53.109:80
Include /etc/apache2/uid.conf
Include /etc/apache2/server-tuning.conf
ErrorLog /var/log/apache2/error_log
Include /etc/apache2/sysconfig.d/loadmodule.conf
Include /etc/apache2/listen.conf
Include /etc/apache2/mod_log_config.conf
Include /etc/apache2/sysconfig.d/global.conf
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf
Include /etc/apache2/mod_usertrack.conf
Include /etc/apache2/mod_autoindex-defaults.conf
TypesConfig /etc/apache2/mime.types
DefaultType text/plain
Include /etc/apache2/mod_mime-defaults.conf
Include /etc/apache2/errors.conf
Include /etc/apache2/ssl-global.conf
Include /etc/apache2/extra/httpd-ssl.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "/srv/www/htdocs/*******">
AllowOverride AuthConfig
AuthType Basic
AuthName "protected zone"
AuthUserFile /usr/.htpasswd
Require user admin
Order allow,deny
Allow from all
</Directory>
<Directory "/srv/www/htdocs/*******">
AllowOverride AuthConfig
AuthType Basic
AuthName "protected zone"
AuthUserFile /usr/.htpasswd
Require user admin
Order allow,deny
Allow from all
</Directory>
<Directory "/srv/www/htdocs/*******">
AllowOverride AuthConfig
AuthType Basic
AuthName "protected zone"
AuthUserFile /usr/.htpasswd
Require user admin
Order allow,deny
Allow from all
</Directory>
<Directory "/srv/www/htdocs/countersystem/*******">
AllowOverride AuthConfig
AuthType Basic
AuthName "protected zone"
AuthUserFile /usr/.htpasswd
Require user admin
Order allow,deny
Allow from all
</Directory>
<Directory "/srv/www/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
AccessFileName .htaccess
<Files ~ "^.ht">
Order allow,deny
Deny from all
</Files>
DirectoryIndex index.html index.html.var
Include /etc/apache2/default-server.conf
Include /etc/apache2/vhosts.d/*.conf
Wenn braucht ihr noch eine andere Conifg Datei?
DANKE SCHONMAL FÜR EURE HILFE.
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 12:28
by Roger Wilco
Eigentlich alle Konfigurationsdateien, die per Include eingebunden werden.
Ich hoffe, du meinst nicht, dass deine .htaccess in /srv/www/htdocs/countersystem/******* ignoriert wird...
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 12:42
by cashworld
Roger Wilco wrote:Eigentlich alle Konfigurationsdateien, die per Include eingebunden werden.
Ich hoffe, du meinst nicht, dass deine .htaccess in /srv/www/htdocs/countersystem/******* ignoriert wird...
Nein das sind Password geschützte Bereiche die ich in der httpd.conf setze, die gehen, aber wenn .htaccess Dateien in Ordnern liegen habe beachtet der Apache das nicht :(.
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 12:46
by Roger Wilco
cashworld wrote:Nein das sind Password geschützte Bereiche die ich in der httpd.conf setze, die gehen, aber wenn .htaccess Dateien in Ordnern liegen habe beachtet der Apache das nicht :(.
Klar, weil AllowOverride für diese Verzeichnisse entsprechend restriktiv gesetzt ist.
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 12:51
by cashworld
loadmodule.conf
Code: Select all
LoadModule actions_module /usr/lib/apache2-prefork/mod_actions.so
LoadModule alias_module /usr/lib/apache2-prefork/mod_alias.so
LoadModule auth_basic_module /usr/lib/apache2-prefork/mod_auth_basic.so
LoadModule authn_file_module /usr/lib/apache2-prefork/mod_authn_file.so
LoadModule authz_host_module /usr/lib/apache2-prefork/mod_authz_host.so
LoadModule authz_groupfile_module /usr/lib/apache2-prefork/mod_authz_groupfile.so
LoadModule authz_default_module /usr/lib/apache2-prefork/mod_authz_default.so
LoadModule authz_user_module /usr/lib/apache2-prefork/mod_authz_user.so
LoadModule authn_dbm_module /usr/lib/apache2-prefork/mod_authn_dbm.so
LoadModule autoindex_module /usr/lib/apache2-prefork/mod_autoindex.so
LoadModule cgi_module /usr/lib/apache2-prefork/mod_cgi.so
LoadModule dir_module /usr/lib/apache2-prefork/mod_dir.so
LoadModule env_module /usr/lib/apache2-prefork/mod_env.so
LoadModule expires_module /usr/lib/apache2-prefork/mod_expires.so
LoadModule include_module /usr/lib/apache2-prefork/mod_include.so
LoadModule log_config_module /usr/lib/apache2-prefork/mod_log_config.so
LoadModule mime_module /usr/lib/apache2-prefork/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2-prefork/mod_negotiation.so
LoadModule setenvif_module /usr/lib/apache2-prefork/mod_setenvif.so
LoadModule ssl_module /usr/lib/apache2-prefork/mod_ssl.so
LoadModule suexec_module /usr/lib/apache2-prefork/mod_suexec.so
LoadModule userdir_module /usr/lib/apache2-prefork/mod_userdir.so
LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so
LoadModule php5_module /usr/lib/apache2/mod_php5.so
global.conf
Code: Select all
Timeout 300
ServerSignature on
UseCanonicalName off
ServerTokens OS
LogLevel warn
CustomLog /var/log/apache2/access_log combined
default-server.conf
Code: Select all
DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /icons/ "/usr/share/apache2/icons/"
<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
<Directory "/srv/www/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
<IfModule mod_userdir.c>
UserDir public_html
Include /etc/apache2/mod_userdir.conf
</IfModule>
Include /etc/apache2/conf.d/*.conf
Kann es sein das das Problem mit meiner default-server.conf zusammen hängt??
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 12:55
by cashworld
Ich hab es!!!
httpd.conf
Das anpassen:
Code: Select all
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>
Das raus
Code: Select all
<Directory "/srv/www/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
default-server.conf
und das so anpassen:
Code: Select all
DocumentRoot "/srv/www/htdocs"
#
# Configure the DocumentRoot
#
<Directory "/srv/www/htdocs">
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.2/mod/core.html#options
# for more information.
Options FollowSymLinks
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride All
# Controls who can get stuff from this server.
Order allow,deny
Allow from all
</Directory>
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 12:56
by cashworld
Danke Jungs für eure Hilfe....
Re: Apache ignoriert .htaccess
Posted: 2007-07-14 12:58
by dtdesign
AuthConfig schließt meines Wissens nach nicht mod_rewrite ein!
Lesenswerter Abschnitt bzgl .htaccess
:arrow:
http://httpd.apache.org/docs/2.2/de/how ... .html#when
Gruß
dtdesign