build httpd conf sub-domain with two IPs

sameeh.harfoush

Registered
Feb 17, 2014
2
0
1
cPanel Access Level
Website Owner
Hello,
i want to build httpd conf to include a sub-domain that listens to two IPs 127.0.0.1 (for internal access) and xx.xx.xxx.xxx (for external access). how can i configure /var/cpanel/userdata/USERNAME/sub.exmple.com to have two IPs and when building using /scripts/rebuildhttpdconf i end up with something like the below?

<VirtualHost 127.0.0.1:80 xx.xx.xxx.xxx:80>
ServerName sub.exmple.com
...
</VirtualHost>

assigning two IPs, separated by space, in the "ip" field for sub.exmple.com file is causing a compile error .

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello :)

Using multiple IP addresses in a single VirtualHost is not natively supported with cPanel. However, since this is for an internal IP address, have you considered setting up a NAT environment instead? It's documented here:

cPanel - NAT

Thank you.
 

cPanelPeter

Technical Analyst III
Staff member
Sep 23, 2013
575
21
143
cPanel Access Level
Root Administrator
Twitter
Hello,

Thank you for reporting that. I believe this has to do because cPanel is in the middle of switching to a new documentation system.
The correct link for 1:1 NAT can be found here.