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.

Multiple IPs and confusion between external/internal

Discussion in 'General Discussion' started by kbuser, Sep 29, 2009.

  1. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    The situation one server with 2 ips:
    Internal IP 10.0.0.27 points to 74.x.x.x
    Internal IP 10.0.0.33 points to 70.x.x.x

    eth0 is .27, eth0:1 is .33

    cPanel 11.24.5-R38506 - WHM 11.24.2 - X 3.9
    REDHAT Enterprise 5.2 i686 standard on cp1


    Originally we only had the first IP which was hosting all of our sites, we have since added the 2nd IP address which is taking over all new accounts (this is how we want it).

    I added the internal address to the server pool and specified it as the Main Shared Virtual Host IP under Edit Setup. I have adjusted all of the DNS templates to point to 70.x.x.x

    Issues that arise:
    When attempting to move a site from the old IP to the new IP (as we have to do in some situations) using "Change a site's IP address" adjusts the DNS entries as well to point to 10.0.0.33, making the site unreachable. (I just tried adding the external IP address and setting that as main default, but I got the impression after the first site I checked had lost the ability to get assigned to any IP address and disappeared from the IP usage pool that that was a mistake).

    Accounts cannot have a domain on one IP and an alias on another.

    Accounts that are assigned to an IP which isn't coordinated with their DNS (eg, 10.0.0.27 with dns of 70.x)will have their websites replaced by the first account listed in httpd.conf with the IP that the DNS references.

    The server seems to be confused/doesn't know the difference between the external and internal addresses. I assume that it is because of my configuration, but am at a loss as to how to fix these issues.

    Please advise.
     
  2. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Bumping:

    The main problem here is that when an account is assigned to the original IP address and the DNS is pointing to the new IP address, a different client's website shows up. It's always the first site listed in httpd.conf that is assigned to the IP the aforementioned site is pointing to.
     
  3. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    To help clarify my understanding, are you needing to update all existing accounts or domains that were on the older IP address to now use to the newer IP address, or are you needing some accounts or domains to (intentionally) remain using the older IP address?

    It may be possible to manually update or modify the configuration, but what to change varies greatly depending on the existing situation and what the specific requirements are.
     
  4. aspardeshi

    aspardeshi Member

    Joined:
    Oct 22, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    you need not do anything from your end, just tell your host provider to do natting properly. it is their mistake. :)
     
  5. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    No.

    Yes, we've left several hundred accounts on the original IP address which is as desired. All of those work flawlessly.


    The situation occurs when an account is assigned to the original IP but the DNS entry points to the new IP. This is usually only a temporary situation as it should be, but clients get pissed off because somebody elses website is being displayed at their domain.

    Example: Account A is created, 1 day before the new IP address of .33 was set as the default shared address, giving it an assigned IP of .27. 1 day after the .33 address is set as default, a support rep gets around to setting the DNS entry of Account A and points it to .33. He doesn't know that the site is assigned to .27 in WHM. He looks at the page and sees Account B's website, since account B is the first site listed in httpd.conf assigned to .33. While it is only a temporary inconvenience for us, we lose a bit of credibility with clients because of it. In this situation I would prefer an error page or almost anything other than another accounts website to appear.
     
  6. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    This should be relatively easy to workaround, at least for future DNS changes.

    If neither IP is solely a dedicated IP for any one account, the following should work. What I would do is ensure there is a default virtual host in-place for both IP addresses (instead of just one for current main shared IP); this is possible through the use of a basic virtual host entry such as the example detailed below, placed in httpd.conf before all other account virtual hosts.

    The easiest way to implement this may be to add the custom virtual host into an Apache configuration include file, such as the following:
    /usr/local/apache/conf/includes/pre_virtualhost_global.conf

    If your Apache configuration "httpd.conf" file already has an entry similar to one of these then it should only be necessary to add the one that does not yet exist (preferrably copying and pasting the existing default virtual host and only changing the IP address):

    Code:
    <VirtualHost 10.0.0.27:80>
        ServerName server.domain.tld
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin root@server.domain.tld
    </VirtualHost>
    
    <VirtualHost 10.0.0.33:80>
        ServerName server.domain.tld
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin root@server.domain.tld
    </VirtualHost>
    After updating an include file, as a precaution I would test to verify Apache can restart successfully.

    For additional information about editing the include files via WHM (or via SSH), and for more EasyApache-related documentation about customizing the "httpd.conf" file, please refer to the following documentation links:
    IncludeEditor < AllDocumentation/WHMDocs < TWiki
    Apache & cPanel/WHM
     
Loading...

Share This Page