Apache2 ignoriert 2. Virtual Host

Apache, Lighttpd, nginx, Cherokee
Post Reply
kworth2
Posts: 69
Joined: 2002-10-22 18:17
 

Apache2 ignoriert 2. Virtual Host

Post by kworth2 »

Hi,

Ich habe erst neulich meinen Apache2 komplett neu kompiliert,
die neuste Version downgeloadet und mit mysql und php5.0.3

Alles lief soweit auch ganz gut aber als ich einen zweiten Virtual Host einrichten wollte stiess ich auf das Problem,
dass er einfach alle domains egal wie sie in der vhost file festgelegt sind auf den DocumentRoot des ersten umleitet.

Also in meinem fall leitet der apache dom1.de und dom2.de
in den Ordner /var/www/page4/html/ (d.h. er nimmt es für beide als Document Root)

Hab schon gegoogelt mit weniger Erfolg,

Hier die anonymisierte Version des Endes meiner httpd.conf

Code: Select all

NameVirtualHost 62.4.**.**

<VirtualHost 62.4.**.**>
  ServerAdmin webmaster@dom1.de
  ServerName dom1.de

  DocumentRoot /var/www/page4/html/
</VirtualHost>

<VirtualHost 62.4.**.**>
  ServerAdmin webmaster@dom2.de
  ServerName dom2.de

  DocumentRoot /var/www/page2/html/
</VirtualHost>
Hat wer eine Idee was ich falsch gemacht haben könnte?


Vielen Dank für alle Antworten im Vorraus,

Gruss Markus
kworth2
Posts: 69
Joined: 2002-10-22 18:17
 

Re: Apache2 ignoriert 2. Virtual Host

Post by kworth2 »

Hab im IRC schon hilfe gefunden.

Für die Nachwelt hier die korrekte Version des Ende der httpd.conf

Code: Select all

NameVirtualHost 62.4.**.**

<VirtualHost 62.4.**.**>
  ServerAdmin webmaster@dom1.de
  ServerName www.dom1.de
  ServerAlias dom1.de

  DocumentRoot /var/www/page4/html/
</VirtualHost>

<VirtualHost 62.4.**.**>
  ServerAdmin webmaster@dom2.de
  ServerName www.dom2.de
  ServerAlias dom2.de

  DocumentRoot /var/www/page2/html/
</VirtualHost>
Post Reply