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!

Editing VirtualHost templates to allow for NAT

Discussion in 'General Discussion' started by keithl, Jan 14, 2010.

  1. keithl

    keithl Member

    Jan 14, 2010
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    DataCenter Provider
    We've got a new cPanel installation which is running on a server in a 1-to-1 NAT environment. I understand cPanel doesn't properly support NAT, but at the same time I'm not in a position to change the existing network infrastructure in front of the server.

    Since the DNS records automatically created are based on the IP address of the server I've obviously got the server configured to use its external IP, however, for the websites to be accessible they need to be running on the internal IP address.

    Since the main purpose of the server is to provide web hosting only, I'm trying to work around this by editing the VirtualHosts template file to explicitely state the IP address to use, rather than detect it from the server. I've tried editing /var/cpanel/templates/apache2/vhost.local from :

    <VirtualHost[% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %]:[% ipblock.port %][% END %]>



    however when I create a new account the new entry in httpd.conf still has still be completed with the external IP address.

    Am I wrong to think this should work, am I perhaps editing the wrong template file, or is there a different way I should be doing this?


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