Problem mit Virtual Hosts

Apache, Lighttpd, nginx, Cherokee
Post Reply
*removed*
 

Problem mit Virtual Hosts

Post by *removed* »

Hi!

Ich bin auf einen frischen Debian umgesattelt und habe mittlerweile alles eingerichtet.

Nun habe ich das Problem, dass alle Domains auf den ersten Virtual Host zeigen...was ist denn an folgenden Zeilen falsch?

Code: Select all

Include /etc/apache/conf.d
NameVirtualHost 111.111.111.111

<VirtualHost 111.111.111.111>
    ServerAdmin webmaster@domain.de
    ServerName www.domain.de
    ServerAlias www.domain2.de www.domain3.de www.domain4.de
#    ServerPath /domain
    DocumentRoot /var/www/sites/domain/html
    <Directory "/var/www/sites/domain/html">
        allow from all
        Options +Indexes
	php_flag session.use_trans_sid off
    </Directory>
    ServerSignature Off
    CustomLog /var/www/sites/domain/log/access_log common
    ErrorLog /var/www/sites/domain/log/error_log
    
    php_admin_value open_basedir /var/www/sites/domain/html
    php_admin_value upload_tmp_dir /var/www/sites/domain/tmp
    php_admin_value session.save_path /var/www/sites/domain/tmpsession
</VirtualHost>

<VirtualHost 111.111.111.111>
    ServerName www.otherdomain.de
    ServerAdmin webmaster@otherdomain.de
    DocumentRoot /var/www/sites/otherdomain/html
    <Directory "/var/www/sites/otherdomain/html">
	allow from all
	Options +Indexes
    </Directory>
    ServerSignature Off
    CustomLog /var/www/sites/otherdomain/log/access_log common
    ErrorLog /var/www/sites/otherdomain/log/error_log
    
    php_admin_value open_basedir /var/www/sites/otherdomain/html
    php_admin_value upload_tmp_dir /var/www/sites/otherdomain/tmp
    php_admin_value session.save_path /var/www/sites/otherdomain/tmpsession
</VirtualHost>

usw...
mydani
Posts: 152
Joined: 2003-08-18 19:34
 

Re: Problem mit Virtual Hosts

Post by mydani »

Haut mich nicht aber müssten die virtualhosts nicht verschiedene tags bekommen?

<virtualhost name1>
..
</virtuahlhost>
<virtualhost name2>
..
</virtuahlhost>

usw.?
*removed*
 

Re: Problem mit Virtual Hosts

Post by *removed* »

Nein, das ist nicht so...von http://httpd.apache.org/docs-2.1/de/vho ... based.html:
Vorausgesetzt, Sie bedienen z.B. die Domain http://www.domain.tld und möchten den virtuellen Host http://www.otherdomain.tld hinzufügen, welcher auf die gleiche IP-Adresse zeigt. Dann fügen Sie einfach Folgendes der httpd.conf hinzu:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName http://www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *:80>
ServerName http://www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
Der Indianer prüft das ja anhand des Hostnames im HTTP-Header der Client-Anfrage...

Aber das Problem hat sich erledigt: Ich habe festgestellt, dass es nur bestimmte Domains betrifft (die noch nicht umgezogen sind wg. Fertigstellung des Mail-Systems).

Trotzdem danke :-)
mydani
Posts: 152
Joined: 2003-08-18 19:34
 

Re: Problem mit Virtual Hosts

Post by mydani »

Gut zu wissen *merk* :)
Post Reply