The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

wildcard dns (subdomains)

Discussion in 'Bind / DNS / Nameserver Issues' started by HH-Steven, Jan 11, 2005.

  1. HH-Steven

    HH-Steven Well-Known Member

    Joined:
    Aug 29, 2004
    Messages:
    284
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Ok, ive managed to setup wildcard subdomains to some extent but im coming across 2 problems :

    1.) works with :

    http://www.*.domain.tld
    &
    www.*.domain.tld

    but not

    http://*.domain.tld

    ==================

    2.) It overides existing sub domains setup via cpanel.

    ==================

    Any suggestions?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You have to add a ServerAlias of *.domain.tld to the VirtualHost container. It will always override cPanel subdomain configurations. The only way around that is to place the subdomain VirtualHost containers before the main domains in httpd.conf.
     
  3. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    Hi Chirpy.

    Would it be a good idea to go the mod_vhost_alias route if it's a mass virtual hosting with following added to httpd.conf (after a wildcarded DNS entry to a separate IP altogether for each of those domains with subdomain):

    <VirtualHost *:80>
    UseCanonicalName Off
    VirtualDocumentRoot /home/.../.../%-1/%-2/%-3
    </VirtualHost>

    Any pitfalls?

    TIA
    Anup
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    The advantage of using a wildcard ScriptAlias is that apache logs will be retained and so should the bandwidth monitoring. You would need to beef up that VirtualHost directive as you've quoted it to do the same, though. Other than that, whatever works best given the circumstances. Order within httpd.conf with any solution is critical though.
     
  5. TiGG

    TiGG Registered

    Joined:
    Jan 22, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Did you ever get this working? I'm having the same problems. What steps have you done thus far?

    Thanks,
    TiGG - tigg@tiggman.com
     
Loading...

Share This Page