Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to tweak 'Subdomain adder' setup script

Discussion in 'General Discussion' started by alwaysweb, Sep 15, 2002.

  1. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    306
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    Hi Nick,

    I have Cpanel deployed in a load-balanced setup, and it works great (ok, a few tweaks ;) )

    For various reasons, Cpanel requires us to have domains resolving like this:

    'domain.com' --& xx.xx.xx.147

    and

    'www.domain.com' --& xx.xx.xx.xx.148


    It sets up new accounts properly (we edited /scripts/wwwacct to add two virtualhosts to httpd.conf)

    However, when a customer adds a subdomain, it sets it up with the .148 IP address. However, subdomains NEED to go to the .147 IP address. My question is this. What script or file does the 'subdomain adder' run? What can I edit to make this simple change in the IP it sets subdomains up with?

    I have contacted my cpanel distributor and they did little more than repeatedly refer me to /scripts/wwwacct :(

    If you can help I'd really appreciate it! downloading, doing a massive search-and-replace, and re-uploading (of course with the subdomain not working from the time the customer added it till then) is really wearing me out.

    I've looked through the 'themes' and found the &cpanel...& call for it, but haven't found where I can edit it (hopefully its not in the binary!)

    Thanks for any help! I can submit as a 'bug' request if you prefer Nick!

    Ronnie
    http://AlwayswebHosting.com
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    306
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    With Nick's help (you rule dude!),

    Build 5.0-56 of Cpanel will now look for an 'A' record on the domain's zone file of the name 'subdomainip' and set up the subdomain in httpd.conf with that IP address.

    For example, I just modified /scripts/wwwacct to stick on the zone file:

    subdomainip IN A xx.xx.xx.147


    Then when client created subdomain via &Manage SubDomains& the VirtualHost container contained the .147 IP address.

    If you leave the 'subdomainip' off the 'A' record, then it will default to the IP address of the 'www.domain.com' in its DNS.

    THANKS NICK !
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    316
    Is subdomainip a literal string or is it a variable?
     
  4. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    306
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    Literal...


    Example zone file:

    thomasostergard.com. 14400 IN NS dns1.alwayswebhosting.com.
    thomasostergard.com. 14400 IN NS dns2.alwayswebhosting.com.
    thomasostergard.com. 14400 IN A 66.220.25.147
    localhost.thomasostergard.com. 14400 IN A 127.0.0.1
    thomasostergard.com. 14400 IN MX 0 thomasostergard.com.
    mail 14400 IN CNAME thomasostergard.com.
    www 14400 IN A 66.220.25.148
    subdomainip 14400 IN A 66.220.25.147
    ftp 14400 IN CNAME thomasostergard.com.
    glider 14400 IN A 66.220.25.147
    supra 14400 IN A 66.220.25.147
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    316
    Got it. Thanks.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice