PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Virtuell Host und .htaccess



be1001
01.12.05, 00:25
Hallo,

habe folgendes Problem:

Möchte einen virtellen Host über eine .htaccess Funktion schützen.

Habe Suse 9.3 und folgende Einstellungen:

http.conf

# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride AuthConfig
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>


vhost.conf

<VirtualHost 172.29.174.12>
<IfDefine SSL>
SSLEngine off
</IfDefine>
DocumentRoot /christian/Apache/Lederberg
AccessFileName .htaccess
<Directory "/christian/Apache/Freigabe_1">
##AllowOverride All
##Options Indexes Include FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
ServerName www.xxx.org
ServerAdmin info@beilfuss.de
</VirtualHost>

.htaccess

#
#.htacces für xxx.net

#
AuthUserFile /christian/Freigabe_1/.passwd
AuthName "Protected Area"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>

Leider habe ich das problem, das ich trotzdem direkt die Internetseite angezeigt bekomme, also gar keine Abfrage kommt.

Was habe ich falsch gemacht?????

christian

undefined
01.12.05, 02:22
Dann stimmen deine Pfade nicht siehe in der /var/log/apache2/error_log


<Directory "/home/httpd/vhosts/meine.domain/httpdocs">
Options Indexes FollowSymLinks
AllowOverride Indexes FileInfo Authconfig
Order allow,deny
Allow from all
</Directory>



AuthType Basic
AuthName "Administrator Bereich"
AuthUserFile /home/httpd/vhosts/meinedomain/httpdocs/Administration/.htpasswd
Require valid-user
DirectoryIndex Index.php5

be1001
02.12.05, 00:50
Hallo

habe immer noch die selben Probleme, habe alles umgebaut, aber in den Logs sind keine Fehler sichtbar.
Bei Aufruf der Seite www.xxx.org geht es direkt auf die Seite, es kommt keine Abfrage des Passworts.


Auszug httpd.conf

# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride All
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>

Auszug vhost.conf

<VirtualHost 172.29.174.12>
# YaST auto define section
<IfDefine SSL>
SSLEngine off
</IfDefine>
ServerName www.xxx.org
DocumentRoot /christian/Apache/Lederberg
AccessFileName .htaccess
<Directory "/christian/Apache/vhost">
AllowOverride Authconfig
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
ServerAdmin info@beilfuss.de
</VirtualHost>

Auszug .htaccess

AuthUserFile /christian/vhost/.htpasswd
AuthName "Protected Area"
AuthType Basic
#<Limit GET POST>
require valid-user
#</Limit>

Auszug error_log

Fri Dec 02 00:01:49 2005] [notice] caught SIGTERM, shutting down
[Fri Dec 02 00:01:50 2005] [notice] Apache/2.0.53 (Linux/SUSE) configured -- resuming normal operations
[Fri Dec 02 00:03:17 2005] [notice] caught SIGTERM, shutting down
[Fri Dec 02 00:03:19 2005] [notice] Apache/2.0.53 (Linux/SUSE) configured -- resuming normal operations
[Fri Dec 02 00:23:50 2005] [notice] caught SIGTERM, shutting down
[Fri Dec 02 00:23:52 2005] [notice] Apache/2.0.53 (Linux/SUSE) configured -- resuming normal operations
[Fri Dec 02 00:24:58 2005] [notice] caught SIGTERM, shutting down
[Fri Dec 02 00:25:00 2005] [notice] Apache/2.0.53 (Linux/SUSE) configured -- resuming normal operations
[Fri Dec 02 00:33:55 2005] [notice] caught SIGTERM, shutting down
[Fri Dec 02 00:33:56 2005] [notice] Apache/2.0.53 (Linux/SUSE) configured -- resuming normal operations


Auszug access.log

212.89.97.8 - - [02/Dec/2005:00:25:19 +0100] "GET /assets/images/autogen/2005_Np
1.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0 (c
ompatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:25:19 +0100] "GET /assets/images/autogen/2005_NR
p2.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0 (
compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:25:19 +0100] "GET /assets/images/autogen/Impress
um_Np1.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4
.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:25:19 +0100] "GET /assets/images/autogen/Impress
um_NRp2.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/
4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:10 +0100] "GET / HTTP/1.1" 304 - "-" "Mozilla
/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:11 +0100] "GET /left_index.html HTTP/1.1" 304
- "http://www.xxx.org" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0
; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:11 +0100] "GET /rollover.js HTTP/1.1" 304 - "
http://www.xxx.org/left_index.html" "Mozilla/4.0 (compatible; MSIE 6.0; Wi
ndows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:11 +0100] "GET /body_index.html HTTP/1.1" 304
- "http://www.xxx.org" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0
; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:11 +0100] "GET /assets/images/background.gif
HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0 (compati
ble; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:11 +0100] "GET /assets/images/autogen/clearpi
xel.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:12 +0100] "GET /assets/images/autogen/Home_Hp
3_1.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:12 +0100] "GET /assets/images/autogen/2000_Np
1.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0 (c
ompatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:12 +0100] "GET /assets/images/autogen/2005_Np
1.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0 (c ompatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:12 +0100] "GET /assets/images/autogen/Impress um_Np1.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4 .0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:13 +0100] "GET /assets/images/autogen/Home_HR p4_1.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:13 +0100] "GET /assets/images/autogen/2000_NR p2.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0 ( compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:13 +0100] "GET /assets/images/autogen/2005_NR p2.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/4.0 ( compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:14 +0100] "GET /assets/images/autogen/Impress um_NRp2.gif HTTP/1.1" 304 - "http://www.xxx.org/left_index.html" "Mozilla/ 4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:14 +0100] "GET /assets/images/autogen/clearpi xel.gif HTTP/1.1" 304 - "http://www.xxx.org/body_index.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
212.89.97.8 - - [02/Dec/2005:00:34:14 +0100] "GET /assets/images/Lederberg_alt_0 01.jpg HTTP/1.1" 304 - "http://www.xxx.org/body_index.html" "Mozilla/4.0 ( compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"


Wo kann der Fehler noch liegen. Ich hab mehrfach überprüft ob die Verzeichnisse richtig sind.
Christian

marce
02.12.05, 07:00
<Directory "/christian/Apache/vhost">

DocumentRoot /christian/Apache/Lederberg
die beiden passen irgendwie nicht so recht zusammen... kenne aber des Rest der Config nicht...

be1001
03.12.05, 20:41
ich hab die .htaccess aus Sicherheitsgründen in ein anderes Verzeichnis gelegt.

Darum die verschiedenen Verzeichnise, oder muss die .htaccerss im Documentverzeichnis liegen???

marce
04.12.05, 10:13
entweder Du machst die Cionfig komplett im "zentralen" httpd.conf oder über z.B. .htaccess - die muss dann aber im jeweiligen VZ liegen - wie soll sonst der Apache das zuordnen können?

Steht übrigens _alles_ in der Doku...

be1001
04.12.05, 11:19
Da heisst also ich soll nur die .htpasswd aus sicherheitsgründen in ein anderes Verzeichnis legen???

Habe ich das dann richtig verstanden????

Tomek
04.12.05, 13:52
Nein, die .htpasswd kann auch ruhig im DocumentRoot liegen. Denn in der Standardkonfiguration von Apache ist folgende Einstellung zu finden:

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
Somit können diese Dateien über den Browser nicht direkt aufgerufen werden.