Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic virtual host

Status
Not open for further replies.

LittleHavoc

IS-IT--Management
Nov 28, 2001
56
GB
Hello

I have space on a friends dedicated server and he is not available all the time to carry out work for me. Therefore I want to configure a virtual host in apache to cope with all my subdomains in one configuration. I am basically after some wildcard or re-write information.

e.g.
normally I would do the following, adding each subdomain as another virtual host.

<VirtualHost *>
ServerName domain.com
DocumentRoot /</VirtualHost>

<VirtualHost *>
ServerName subdomain.domain.com
DocumentRoot /</VirtualHost>


BUT what I would like is something like:-

<VirtualHost *.domain.com:80>
ServerName %S.domain.com
DocumentRoot /</VirtualHost>


If I want a new subdomain (eg sub) I would point it to the server and make sure I create the directory, and thats it, no editing of the httpd.conf would be needed.
 
so if %0 matches the *, the would the following fit with my question?

<VirtualHost *.domain.com>
UseCanonicalName off
ServerName %0.domain.com
VirtualDocumentRoot /</VirtualHost>
 

I think the FAQ says %0 would match the entire domain, not just the glob match. Now that you've been pointed in the right direction you might try referring to the Apache docs.
 
I have checked the docs prior to posting the question (as always) I just couldnt find anything relavant.

Where is the %0 in the manual?
 
Yes, that page uses %0, and I assume it is like the pattern matches of grep. But it is not a reference to how to use it and therefore is not really where %0 is located in the manual.

ericbrunson:"I think the FAQ says %0 would match the entire domain, not just the glob match". A link to this is what I was expecting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top