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.

Shared IP, Apache Virtual Hosts and DNS

Discussion in 'Bind / DNS / Nameserver Issues' started by tlovrec, May 21, 2008.

  1. tlovrec

    tlovrec Member

    Joined:
    Apr 11, 2008
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    we have the cPanel machine located behind a local firewall. The cPanel machine is on 192.168.15.0/24 network, and has a local IP 192.168.15.3, so this is it's shared IP in cPanel.
    So the problem is now, when I add a new user with it's domain, the points to the cPanel shared IP, the local IP. So the domain is unreachable from the outside, unless if I manualy change the DNS records.

    But, if I set the Shared IP to the external networks IP, 1.1.1.1, then the domain works ok, outside world can reach it, but the problem starts with Apache Virtual Domain, then it shows the wrong(the main) web page of the server and not the domains page.

    Now I've solved this so, that I've changed the Shared IP back to the local IP address of the server, so that the apache virtual hosts work, and change the DNS Zone Templates, to input IP 1.1.1.1 instead of %ip% (which refers to Shared IP right?)

    I'm only posting this to find out if this is ok, or if there is a more elegant solution to this problem?
     
  2. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    That's one solution that will work. We currently don't have support for NAT built into cPanel. This is something we plan on building into the product in the future.

    Until then, putting the public IP in the DNS templates and the private IP in WHM works. Alternatively, you could put the public IP in WHM and put the private IP in Apache vhost templates. No reason to change what you have though if it's working.


    Of note: Some other features requiring the public/private IP to be accurate may also be affected.
     
  3. tlovrec

    tlovrec Member

    Joined:
    Apr 11, 2008
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Until now only DNS "flaw" was discovered here, and if there isn't any better solution for now (except the other way around) I'm leaving it like this. Don't fix what ain't broken.
     
Loading...

Share This Page