Fehler nach erstelen von VirtualHosts

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

Fehler nach erstelen von VirtualHosts

Postby Special-A » 31. August 2006 17:23

Hallo Apache-Freunde!

Ich habe in der httpd.conf VirtualHosts erstellt. Hier der Ausschnitt:

httpd.conf

Code: Select all
NameVirtualHost 127.0.0.1:80

<VirtualHost localhost:80>
    ServerName localhost:80
    DocumentRoot "c:/Programe/xampp/htdocs"
    <Directory "c:/Programme/xampp/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>



<VirtualHost web1.root.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web1"
    <Directory "c:/Programme/xampp/htdocs/www/web1">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost web2.root.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web2"
    <Directory "c:/Programme/xampp/htdocs/www/web2">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost web3.root.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web3"
    <Directory "c:/Programme/xampp/htdocs/www/web3">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost script.root.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/script"
    <Directory "c:/Programme/xampp/htdocs/www/script">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost phpmyadmin.root.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/phpmyadmin"
    <Directory "c:/Programme/xampp/phpmyadmin">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>



<VirtualHost churchms.web1.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web1/church_ms"
    <Directory "c:/Programme/xampp/htdocs/www/web1/church_ms">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost notice.web2.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web2/notice"
    <Directory "c:/Programme/xampp/htdocs/www/web2/notice">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost smarty.script.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/script/smarty/Smarty/libs"
    <Directory "c:/Programme/xampp/htdocs/www/script/smarty/Smarty/libs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost tinymce.script.local:80>
    ServerName localhost:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/script/tiny_mce"
    <Directory "c:/Programme/xampp/htdocs/www/script/tiny_mce">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>



hosts

Code: Select all
127.0.0.1       localhost
127.0.0.1       localhost
127.0.0.1       web1.root.local
127.0.0.1       web2.root.local
127.0.0.1       web3.root.local
127.0.0.1       script.root.local
127.0.0.1       phpmyadmin.root.local
127.0.0.1       churchms.web1.local
127.0.0.1       notice.web2.local
127.0.0.1       smarty.script.local
127.0.0.1       tinymce.script.local



Es klappt auch alles perfekt, nur wenn ich auf http://localhost gehe, um in den Ordner xampp/ umgeleitet zu werden, kommt eine Error 403 Meldung.

Was muss ich ändern, damit es wieder funktioniert?

Vielen Dank im Vorraus! :D
Special-A
 
Posts: 11
Joined: 03. January 2006 19:53

Postby kleinweby » 31. August 2006 17:49

also du hast einige dinge vertauscht ;)

als erstes mal mal lieber ein
Code: Select all
NameVirtualHost *:80

Deins ist zwar richtig aber der hört dann nur auf die 127.0.0.1 ;)

Dann:
Code: Select all
<VirtualHost hier_steht_die_ip_auf_den_der_vhost_hört>
    ServerName hier_steht_der_name_auf_den_der_vhost_hört
    DocumentRoot "c:/Programe/xampp/htdocs"
    <Directory "c:/Programme/xampp/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>


Ein Beispiel:
Code: Select all
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "c:/Programe/xampp/htdocs"
    <Directory "c:/Programme/xampp/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>


kleinweby
User avatar
kleinweby
AF Moderator
 
Posts: 393
Joined: 03. August 2005 19:52
Location: Magdeburg
Operating System: Mac OS X 10.7

Postby Special-A » 31. August 2006 17:54

ich hatte mal *:80, nur da haben die subdomains nicht richtig funktioniert...

ich werde das jetzt aber ausprobieren und mich melden, falls es (nicht) funktioniert.
Special-A
 
Posts: 11
Joined: 03. January 2006 19:53

Postby Special-A » 31. August 2006 18:01

ich habe das jetzt so gemacht, wie du es mir gesagt hast. funktioniert alles perfekt, nur es kommt bei localhost immer noch die error 403-meldung.

ich habe in das htdocs/-verzeichnis keine .htaccess oder so verstaut. nur den ordner www/ erstellt, wo auch die ordner drin sind, wo die subdomains hinverlinken.

also es funktioniert nur http://localhost nicht.

edit:

httpd.conf

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost:80
    DocumentRoot "c:/Programe/xampp/htdocs"
    <Directory "c:/Programme/xampp/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>



<VirtualHost *:80>
    ServerName web1.root.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web1"
    <Directory "c:/Programme/xampp/htdocs/www/web1">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName web2.root.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web2"
    <Directory "c:/Programme/xampp/htdocs/www/web2">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName web3.root.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web3"
    <Directory "c:/Programme/xampp/htdocs/www/web3">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName script.root.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/script"
    <Directory "c:/Programme/xampp/htdocs/www/script">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName phpmyadmin.root.local:80
    DocumentRoot "c:/Programme/xampp/phpmyadmin"
    <Directory "c:/Programme/xampp/phpmyadmin">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>



<VirtualHost *:80>
    ServerName churchms.web1.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web1/church_ms"
    <Directory "c:/Programme/xampp/htdocs/www/web1/church_ms">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName notice.web2.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web2/notice"
    <Directory "c:/Programme/xampp/htdocs/www/web2/notice">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName smarty.script.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/script/smarty/Smarty/libs"
    <Directory "c:/Programme/xampp/htdocs/www/script/smarty/Smarty/libs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName tinymce.script.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/script/tiny_mce"
    <Directory "c:/Programme/xampp/htdocs/www/script/tiny_mce">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>
Special-A
 
Posts: 11
Joined: 03. January 2006 19:53

Postby kleinweby » 31. August 2006 18:08

der 403-Fehler bedeutet Zugriff verweigert, dies kann davon kommen das es nicht zugreifenkann oder das keine index-datei drinne ist.

kleinweby
User avatar
kleinweby
AF Moderator
 
Posts: 393
Joined: 03. August 2005 19:52
Location: Magdeburg
Operating System: Mac OS X 10.7

Postby Special-A » 31. August 2006 18:12

index.php und index.htm vorhanden. das er nicht zugreifen kann, steht da ja. nur ich frage mich warum!? er kann ja auf den rest zugreifen.

ich habe deshalb vorhin versucht, es durch verschieben der dateien zu lösen. ich habe dafür im ordner www/ den ordner test/ angelegt und dann alles bis auf den ordner www/ (logisch ;) ) dort hin geschoben. wenn ich dann in diesen ordner test/ gehe, kommt ie gleiche meldung.

was brauchst du denn an infos etc., um das problem zu lösen? mir ist das noch nie passiert...
Special-A
 
Posts: 11
Joined: 03. January 2006 19:53

Postby Kenshin » 31. August 2006 18:31

Da ich grad auch an meinen vHosts werkel stell ich meine Frage gleich hier:
Wo finde ich denn diese host-Datei in der Special-A z.B. folgendes geschrieben hat:

Code: Select all
127.0.0.1       localhost
127.0.0.1       localhost
127.0.0.1       web1.root.local
127.0.0.1       web2.root.local
127.0.0.1       web3.root.local
127.0.0.1       script.root.local
127.0.0.1       phpmyadmin.root.local
127.0.0.1       churchms.web1.local
127.0.0.1       notice.web2.local
127.0.0.1       smarty.script.local
127.0.0.1       tinymce.script.local
User avatar
Kenshin
 
Posts: 23
Joined: 30. August 2006 10:55
Location: Munich (Germany)

Postby Special-A » 31. August 2006 18:35

das kann ich beantworten ;)

du findest die datei hosts (die datei hat keine dateiendung!) unter C:\WINDOWS\system32\drivers\etc
Special-A
 
Posts: 11
Joined: 03. January 2006 19:53

Postby Kenshin » 31. August 2006 18:44

omg, Vielen Dank! Da haett ich echt als allerletztes gesucht ^^

edit: Kann man die vHosts denn auch uebers Netzwerk ansprechen, oder funktioniert das nur vom localhost aus? Bei mir gehts naemlich nur vom lhost aus, deshalb die Frage ^^

So long,
Kenshin
User avatar
Kenshin
 
Posts: 23
Joined: 30. August 2006 10:55
Location: Munich (Germany)

Postby kleinweby » 31. August 2006 19:02

ja dies, geht.

zu dem zugriff problem, sry, hab gerade keine ahung :D

kleinweby
User avatar
kleinweby
AF Moderator
 
Posts: 393
Joined: 03. August 2005 19:52
Location: Magdeburg
Operating System: Mac OS X 10.7

Postby Kenshin » 31. August 2006 19:10

Nun wuerde mich noch interessieren, wie das geht. Bei mir funktionierts naemlich nicht :(
muss ich in der hosts Datei dafuer andere Einstellungen machen? evtl nicht 127.0.0.1 sondern die richte IP?


hier meine httpd-vhosts.conf:
Code: Select all
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "f:/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
    ServerName mydb.cyrus
    DocumentRoot "f:/xampp/htdocs/mydb"
</VirtualHost>


und die hosts:

Code: Select all
127.0.0.1       localhost
127.0.0.1       localhost
127.0.0.1       mydb.cyrus
User avatar
Kenshin
 
Posts: 23
Joined: 30. August 2006 10:55
Location: Munich (Germany)

Postby kleinweby » 31. August 2006 19:15

also am einfachsten wäre wenn du die hosts datei auf dem client-rechner auch editierst.
du änderst einfach 127.0.0.1 in die IP deines Servers.

Aber Achtung! Ändere nicht den eintrag 127.0.0.1 localhost dies könnte folgen ;)

kleinweby
User avatar
kleinweby
AF Moderator
 
Posts: 393
Joined: 03. August 2005 19:52
Location: Magdeburg
Operating System: Mac OS X 10.7

Postby Special-A » 31. August 2006 19:22

neues problem:

nun werde ich, wenn ich localhost eingebe, auf den 2. virtual host umgeleitet:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost:80
    DocumentRoot "c:/Programe/xampp/htdocs"
    <Directory "c:/Programme/xampp/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName web1.root.local:80
    DocumentRoot "c:/Programme/xampp/htdocs/www/web1"
    <Directory "c:/Programme/xampp/htdocs/www/web1">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>


der rest steht ja oben. ich habe keine änderungen vorgenommen!

edit: und nun wieder 403...
Special-A
 
Posts: 11
Joined: 03. January 2006 19:53

Postby Special-A » 02. September 2006 10:39

mein kollege hat den fehler gefunden. ich habe den ordner programme nur mit einem m geschrieben :lol:
Special-A
 
Posts: 11
Joined: 03. January 2006 19:53

Postby Kenshin » 02. September 2006 13:15

omg, sowas kenn ich nur zu gut ^^
User avatar
Kenshin
 
Posts: 23
Joined: 30. August 2006 10:55
Location: Munich (Germany)


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 42 guests