Hi everybody, I am looking to see if there is a way to have a dynamic <VirtualHost> directive. What I have is a local development box that I have several subdomains being pointed to from a live production server. Currently I have over 30 subdomains pointing to the development box and I have wanting to rebuild the server and do some updates.
The way I have it setup now is a line (e.g include conf/sub.domain.com) in the httpd.conf for each subdomain used by the server. In the file sub.domain.com I have the following
*Note the server is behind a firewall therfore the 192. address
CustomLog /www/logs/sub.domain.com-access_log common
This works fine for each file and a corresponding line in the httpd.conf file. What I want is only one VirtualHost directive and a dynamic way to have the domain be put in place of sub.domain.com.
Anybody know of a way or ways?
Im not sure there is a way to do this im afraid, although ive never really looked at it like that. If i see it correctly, Apache looks down the list of virtual servers until it finds one that compares with the headers supplied from the users' client (the browser!), hence the warning about old (very old!) browsers in the name based virtual hosts section of the apache manual. SO, you need to have something specified in the ServerName section.