vhosts & Subdomains

Alles, was den Apache betrifft, kann hier besprochen werden.

vhosts & Subdomains

Postby chriss713 » 15. December 2004 14:50

Hallo!

Ich habe eine Frage zu vhosts und Subdomains. Wenn ich das richtig verstanden habe, muss ich doch für eine Subdomain lediglich einen weiteren vhost-Eintrag in der httpd.conf vornehmen?!
Mit "normalen" vhosts funktioniert das auch, nur wenn ich das mit einer Subdomain mache, lande ich auf der Hauptseite des Servers.

Das funktioniert:
Code: Select all
NameVirtualHost domain.tld
<VirtualHost domain.tld *>
ServerAdmin xyz@domain.tld
ServerName domain.tld

DocumentRoot /srv/www/htdocs/websites/domain.tld/content

<Directory /srv/www/htdocs/websites/domain.tld/content/>
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>

<Directory /srv/www/htdocs/websites/domain.tld/content/>
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
</Directory>

</VirtualHost>


Das jedoch nicht:
Code: Select all
NameVirtualHost subdomain.domain.tld
<VirtualHost subdomain.domain.tld *>
ServerAdmin xyz@domain.tld
ServerName subdomain.domain.tld

DocumentRoot /srv/www/htdocs/websites/subdomain.domain.tld/content

<Directory /srv/www/htdocs/websites/subdomain.domain.tld/content/>
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>

<Directory /srv/www/htdocs/websites/subdomain.domain.tld/content/>
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
</Directory>

</VirtualHost>
chriss713
 
Posts: 1
Joined: 15. December 2004 14:26

Postby c-we » 18. December 2004 17:50

Hi,

hast du vor der VirtualHost Definition "NameVirtualHost *" eingetragen?

So hab ich das und es funktioniert wunderbar:

Code: Select all
NameVirtualHost *

<VirtualHost *>
ServerName subdomain.domain.tld
DocumentRoot /path/irgendwo/
</VirtualHost>
c-we
 
Posts: 22
Joined: 29. September 2004 14:55

Postby Guest » 11. January 2005 19:21

c-we wrote:Hi,

hast du vor der VirtualHost Definition "NameVirtualHost *" eingetragen?

So hab ich das und es funktioniert wunderbar:

Code: Select all
NameVirtualHost *

<VirtualHost *>
ServerName subdomain.domain.tld
DocumentRoot /path/irgendwo/
</VirtualHost>


ihr könnte statt * auch einen namen eingeben, dann müsstet ihr nur noch ne IP in der tcp/ip - Datei vergeben und denn namen dahinter schreiben.

siehe:
http://community.apachefriends.org/f/viewtopic.php?t=9528
Guest
 


Return to Apache

Who is online

Users browsing this forum: No registered users and 202 guests