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.

Editing VirtualHost templates to allow for NAT

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

  1. keithl

    keithl Member

    Joined:
    Jan 14, 2010
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    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 %]>

    to

    <VirtualHost 192.168.0.1:80>

    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?

    Thanks
    Keith
     
Loading...

Share This Page