Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Dynamic <VirtualHosts>

    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/ in the httpd.conf for each subdomain used by the server. In the file I have the following

        DocumentRoot /www/html/
        ErrorLog /www/logs/
        CustomLog /www/logs/ common
    *Note the server is behind a firewall therfore the 192. address

    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

    Anybody know of a way or ways?

  2. #2
    Just Joined!
    Join Date
    Jan 2005
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts