[erledigt] VirtualHost: Zugriff verweigert - Error 403

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

[erledigt] VirtualHost: Zugriff verweigert - Error 403

Postby paulbrause » 14. October 2012 09:48

Hallo!

Gestern abend habe ich die aktuellste Version (1.8.1) von Xampp installiert. Davor lief hier die 1.8 ohne Probleme.
Es war eine komplette Neu-Installation, ich habe also nichts übernommen.

Nun wollte ich meine Vhosts wieder einpflegen und habe daher zunächst einmal folgende Zeilen in die httpd-vhosts.conf geschrieben:
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "F:/Workspace/PHP"
    <Directory "F:/Workspace/PHP">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>


Aber schon da hapert's. Ich bekomme immer nur ein "Zugriff verweigert!", also Error 403.
Ich habe weder die Verzeichnisse geändert, noch deren Zugriffsrechte und die Hosts-Datei ist auch noch wie gehabt, also eigentlich sollte es doch laufen...
Tut es aber nicht.

Auch wenn ich jetzt weitere Vhosts angebe, laufen diese nicht, immer 403.

Ich fürchte, ich habe irgendetwas total banales übersehen, aber ich komm einfach nicht drauf?

Danke schon mal für Eure Hilfe,
paulbrause
Last edited by paulbrause on 14. October 2012 22:18, edited 1 time in total.
paulbrause
 
Posts: 5
Joined: 18. October 2007 22:18

Re: VirtualHost: Zugriff verweigert - Error 403

Postby WilliL » 14. October 2012 13:11

Hi,

ist das die ganze httpd-vhosts.conf?

ich vermisse den "ServerName localhost"
Was steht denn in der httpd-vhosts.conf der 1.8.0, die funktioniert ?
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: VirtualHost: Zugriff verweigert - Error 403

Postby paulbrause » 14. October 2012 15:02

Ach, verdammt Axt, da hab ich wohl eine Zeile zu viel herausgelöscht. ;-)
Entschuldigung.

Also, hier mal die komplette httpd-vhosts.conf:
Code: Select all
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host.localhost
    ##DocumentRoot "F:/Xampp/htdocs/dummy-host.localhost"
    ##ServerName dummy-host.localhost
    ##ServerAlias www.dummy-host.localhost
    ##ErrorLog "logs/dummy-host.localhost-error.log"
    ##CustomLog "logs/dummy-host.localhost-access.log" combined
##</VirtualHost>

##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host2.localhost
    ##DocumentRoot "F:/Xampp/htdocs/dummy-host2.localhost"
    ##ServerName dummy-host2.localhost
    ##ServerAlias www.dummy-host2.localhost
    ##ErrorLog "logs/dummy-host2.localhost-error.log"
    ##CustomLog "logs/dummy-host2.localhost-access.log" combined
##</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "F:/Workspace/PHP"
    ServerName localhost
    <Directory "F:/Workspace/PHP">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName projekt1.localhost
    ServerAlias www.projekt1.localhost
    DocumentRoot "F:/Workspace/PHP/projekt1"
    <Directory "F:/Workspace/PHP/projekt1">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>


Die httpd-vhosts.conf der Version 1.8.0 war der jetzigen identisch, nur mit mehr VirtualHost-Einträgen.
Und das ist ja genau das, was mich stutzig macht...

Ich habe inzwischen auch mal die alte Xampp-Installation aus einem Backup wiederhergestellt, da funktioniert alles einwandfrei.
Nur bei der neuen Version bekomme ich immer ein "Zugriff verweigert!", auch wenn ich die alte httpd-vhosts.conf einfach rüberkopiere.

[Edit]
Ich füge hier noch mal die Daten aus der access.log und error.log an, wenn ich im Browser "http://localhost" aufrufe:

access.log
Code: Select all
127.0.0.1 - - [14/Oct/2012:16:13:45 +0200] "GET / HTTP/1.1" 403 1143 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0"

error.log
Code: Select all
[Sun Oct 14 16:13:45.389110 2012] [authz_core:error] [pid 1604:tid 1716] [client 127.0.0.1:26779] AH01630: client denied by server configuration: F:/Workspace/PHP/
paulbrause
 
Posts: 5
Joined: 18. October 2007 22:18

Re: VirtualHost: Zugriff verweigert - Error 403

Postby WilliL » 14. October 2012 19:20

ich denke, dass das Security-Konzept geändert wurde.

httpd.conf (XAMPP 1.8.1) Zeile 201
Code: Select all
<Directory />
    AllowOverride none
   Require all denied
</Directory>


httpd.conf (XAMPP 1.8.0) Zeile 201
Code: Select all
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

wenn du mit dem Code der 1.8.0 den der 1.8.1 ersetzt, klappt es direkt (zumindest bei mir)

Ich habe mir eben die 1.81. runtergeladen und hatte das gleiche Problem.
(ich verstehe es aber nicht)
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: VirtualHost: Zugriff verweigert - Error 403

Postby Altrea » 14. October 2012 21:52

Hallo,

Okay, ich habe kurz einen Test ausgeführt.

Es scheint so zu ein, dass man die alte Schreibweise zur Rechteverwaltung nicht mit der neuen mixen kann.
Statt WilliLs Vorschlag durchgehend die alte Schreibweise zu verwenden würde ich stattdessen vorschlagen durchgehend die neue durchzuziehen.

Folgenderweise würden die VHost Einträge dann aussehen:
<VirtualHost *:80>
DocumentRoot "F:/Workspace/PHP"
ServerName localhost
<Directory "F:/Workspace/PHP">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName projekt1.localhost
ServerAlias www.projekt1.localhost
DocumentRoot "F:/Workspace/PHP/projekt1"
<Directory "F:/Workspace/PHP/projekt1">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


Eine NameVirtualHost Zeile ist mit Apache 2.4 nichtmehr von Nöten und wirft stattdessen eine Meldung in das error.log. Daher die NameVirtualHost Zeile einfach weglassen.

mit freundlichen Grüßen,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: VirtualHost: Zugriff verweigert - Error 403

Postby paulbrause » 14. October 2012 22:18

Ah, genau das war es!

Mit
Code: Select all
Require all granted

funktioniert wieder alles wie gewünscht!

Vielen Dank Euch beiden!
:D
paulbrause
 
Posts: 5
Joined: 18. October 2007 22:18

Re: VirtualHost: Zugriff verweigert - Error 403

Postby WilliL » 15. October 2012 08:43

Code: Select all
Require all granted

hatte ich auch ausprobiert, hatte mir aber nicht funktioniert - (vielleicht speichern oder restart Apache vergessen)

werde ich noch testen, da ich das eleganter/sauberer finde

Danke für den Hinweis
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 48 guests