Page 1 of 1

Problem mit Subdomains - nur eine!?

Posted: 2003-04-07 22:16
by p2p
Hallo
Folgender Code in der httpd.conf:

Code: Select all

<VirtualHost 217.160.0.0:81>
  ServerName phpmyadmin.pxxxxx.pureserver.info
  DocumentRoot /home/www/phpmyadmin
</VirtualHost>


<VirtualHost 217.160.0.0:81>
  ServerName confixx.pxxxxxx.pureserver.info
  CustomLog /var/log/httpd/pxxxx.pureserver.info_access.log "%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agen$
  ErrorLog /var/log/httpd/pxxxx.pureserver.info_error.log
  DocumentRoot /home/www/confixx/html
  php_admin_value safe_mode_exec_dir /home/www/confixx/bin
  php_admin_value upload_tmp_dir /home/www/confixx/tmp
  ScriptAlias /cgi-bin/ /home/www/confixx/html/cgi-bin/
</VirtualHost>
Egal wie ich die Reihenfolge von beiden schreibe und egal welche Subdomain ich in der Adressleiste aufrufe, es wird immer das jeweils erste geschriebe DocumentRoot aufgerufen.

Irgendjemand eine Idee warum?

Vielen Dank

Re: Problem mit Subdomains - nur eine!?

Posted: 2003-04-07 23:12
by dodolin
http://httpd.apache.org/docs/mod/core.h ... irtualhost
The NameVirtualHost directive is a required directive if you want to configure name-based virtual hosts.
Ebenso lesenswert: http://httpd.apache.org/docs/vhosts/details.html
An In-Depth Discussion of Virtual Host Matching
Beschreibt äusserst detailliert, wie Apache genau entscheidet, welchen vhost er auswählt.

Auch dort ist u.a. zu finden:
Unless a NameVirtualHost directive is used for a specific IP address the first vhost with that address is treated as an IP-based vhost. In 1.3.13 and later that includes the IP address *.

Re: Problem mit Subdomains - nur eine!?

Posted: 2003-04-08 08:31
by captaincrunch
Schon wieder ein Fall von "ich sag euch meine IP nicht, weil ich mich damit sooo viel sicherer fühle" ? :wink:

Ich glaube nämlich kaum, dass dein Apache auf die Netzadresse 217.160.0.0 lauschen wird ... falls es sich hierbei wirklich nur wieder um "Verschleierungstaktik" handeln sollte, siehe dodolin ...

Re: Problem mit Subdomains - nur eine!?

Posted: 2003-04-08 08:38
by p2p
CaptainCrunch wrote:Ich glaube nämlich kaum, dass dein Apache auf die Netzadresse 217.160.0.0 lauschen wird ...
Richtig geglaubt :)
Aber danke für den Link, der hat mir weitergeholfen!

Gruß p2p