VHost funktioniert bei gleicher config nicht

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

VHost funktioniert bei gleicher config nicht

Postby MrMister » 16. September 2009 17:31

Hallo alle miteinander,

kämpfe grade mit einem sonderbaren Problem auf meiner Apache-Installation. Habe nach dem gleichen Schema, nach dem ich schon mehrere andere VHosts angelegt habe, versucht, einen weiteren hinzuzufügen, aber leider wird dieser einfach nicht erkannt. Keine Fehlermeldung beim Start, aber im Browser ist er einfach nicht erreichbar. Hier mal meine httpd-vhosts.conf:

Code: Select all
<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs"
    ServerName localhost
   ServerAlias localhost
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\wordpress"
    ServerName wordpress.local
    ServerAlias wordpress.local
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\drupal"
    ServerName drupal.local
    ServerAlias drupal.local
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\temp"
    ServerName temp.local
   ServerAlias temp.local
</VirtualHost>


Meine hosts-Datei im Windows32-Verzeichnis:

Code: Select all
127.0.0.1       localhost
127.0.0.1      wordpress.local
127.0.0.1      drupal.local
127.0.0.1      temp.local
::1             localhost


Es geht um den vhost "temp.local" - Wie ihr sehen könnt habe ich nichts anderes getan als bei den übrigen vhosts auch, und die funktionieren auch jetzt noch einwandfrei - nur der neue eben nicht. :cry: hosts-Datei wurde mit Adminrechten bearbeitet, habe einen Reboot gemacht, den Apache neu gestartet, was man halt so tut, wenns nicht auf Anhieb will... :lol:
Jemand ne Idee woran das liegen könnte?

Danke fürs Lesen und beste Grüße,
MrMister
MrMister
 
Posts: 13
Joined: 30. March 2006 22:57

Re: VHost funktioniert bei gleicher config nicht

Postby Nobbie » 16. September 2009 20:23

So oder so fehlt (wie immer - ungefähr schon 10.000 mal hier angefragt worden, Antwort auch immer dieselbe) die "NameVirtualHost"-Direktive.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: VHost funktioniert bei gleicher config nicht

Postby MrMister » 16. September 2009 20:26

Sorry, ich habe nur nicht die ganze Datei gepostet, sondern nur den Teil mit den VHosts - die Direktive ist gesetzt:

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 127.0.0.1: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 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs"
    ServerName localhost
   ServerAlias localhost
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\wordpress"
    ServerName wordpress.local
    ServerAlias wordpress.local
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\drupal"
    ServerName drupal.local
    ServerAlias drupal.local
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\spd"
    ServerName spd.local
   ServerAlias spd.local
</VirtualHost>
MrMister
 
Posts: 13
Joined: 30. March 2006 22:57

Re: VHost funktioniert bei gleicher config nicht

Postby Nobbie » 16. September 2009 21:07

Und hier gibt es offensichtlich keinen VirtualHost "temp.local" (sondern nur einen "spd.local"); da ist auch klar, warum der temp.local nicht geht.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: VHost funktioniert bei gleicher config nicht

Postby MrMister » 17. September 2009 00:58

In der Tat, da scheint mir ein Fehler unterlaufen zu sein, doch funktionieren tut es auch damit nicht... hier nochmal der aktuelle, korrigierte Stand der Files:

Hosts:
Code: Select all
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
127.0.0.1      wordpress.local
127.0.0.1      drupal.local
127.0.0.1      spd.local
::1             localhost



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 127.0.0.1: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 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs"
    ServerName localhost
   ServerAlias localhost
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\wordpress"
    ServerName wordpress.local
    ServerAlias wordpress.local
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\drupal"
    ServerName drupal.local
    ServerAlias drupal.local
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin admin@localhost
    DocumentRoot "D:\Programme\XAMPP\htdocs\spd"
    ServerName spd.local
    ServerAlias spd.local
</VirtualHost>


Wie gesagt, alle anderen vhosts funktionieren, nur dieser nicht...

Trotzdem schonmal vielen Dank für deine Mühe und deine Posts!

Liebe Grüße,
MrMister
MrMister
 
Posts: 13
Joined: 30. March 2006 22:57

Re: VHost funktioniert bei gleicher config nicht

Postby Wiedmann » 17. September 2009 01:35

Es geht um den vhost "temp.local" ... hier nochmal der aktuelle, korrigierte Stand der Files: ... alle anderen vhosts funktionieren, nur dieser nicht

Da "temp.local" ja in keinem "der Files" vorkommt, auch kein Wunder.

BTW: Die ganzen "ServerAlias" Directiven kannst du weglassen.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: VHost funktioniert bei gleicher config nicht

Postby MrMister » 17. September 2009 10:47

Ich sollte besser dokumentieren, worum es geht - tut mir echt leid, stell mich grad ein wenig blöd an... Nach dem Hinweis von Nobbie, dass es keinen Eintrag für temp.local gibt, sondern nur für spd.local, habe ich alle Einträge für temp.local auf spd.local umgeschrieben und versuche nun diesen VHost aufzurufen.
Sorry für die Verwirrung. Habe die Files mehrfach durchgeschaut und es jeweils mit den passenden Einträgen versucht. Also: Aktueller Stand der Files in meinem letzten Post, mit dem Versuch, spd.local aufzurufen. :wink:

localhost, drupal.local sowie wordpress.local funktionieren, spd.local nicht. Dort sucht sich der Browser tot und versucht es irgendwann mit http://www.spd.local, was natürlich nirgendwo landen kann.

Liebe Grüße und danke für die Hilfestellung,
MrMister

PS: Danke für den Hinweis mit dem ServerAlias!
MrMister
 
Posts: 13
Joined: 30. March 2006 22:57

Re: VHost funktioniert bei gleicher config nicht

Postby Nobbie » 17. September 2009 11:28

MrMister wrote:spd.local nicht. Dort sucht sich der Browser tot und versucht es irgendwann mit http://www.spd.local, was natürlich nirgendwo landen kann.


Was bedeutet, dass es nichts mit Apache und vhosts zu tun hat, sondern die Domain spd.local ist schlicht unbekannt. Nachdem wir hier noch nie Originaldaten gesehen haben, vermute ich das auch weiterhin und würde raten, dass die hosts-Datei nicht richtig ist.

Versuche mal ein "ping spd.local" in einer DOS-Box auszuführen, führt wahrscheinlich auch nicht zu einem Ergebnis. Und dann schaue Dir die hosts-Datei genau an, ob da irgendwo ein Fehler ist. Ohnehin kannst Du auch die Zeile "::1 localhost" löschen, die ist für TCPIP Version 6.

P.S.: Vielleicht stimmt ja auch alles, aber Du gibst etwas falsches im Browser ein (einen Dreher beispielsweise sdp.local oder ähnlich)
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: VHost funktioniert bei gleicher config nicht

Postby MrMister » 17. September 2009 15:22

Wieso noch nie Originaldateien gesehen? Habe doch den Inhalt gepostet...?

Naja, hab nu den apache neu installiert und die neue httpd-vhosts.conf mit der unten geposteten überschrieben, nu geht es... versteh tu ichs aber immer noch nicht *schulterzuck*
MrMister
 
Posts: 13
Joined: 30. March 2006 22:57


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 43 guests