How to reconfigure existing cPanel installation to use NAT ?
Hi All,
I did try to find within cpanel forum and google for a solution, but nothing satisfactory i found. Lots of old posts about the pre 11.40 version.
We are running cPanel for a while, which was running fine. Yesterday we needed to resize the root partition on our AWS-EC2 instance. After rebooting we got a new internal IP (10.x.x.x). Because the IP changed, all websites went to default web page (i'm sure this something familiar). I quickly fixed the 'default page' problem by replacing the old ip address with the new one in /etc/httpd/conf/httpd.conf. So for the moment it works, but i know you should not make changes to this file directly.
Since 11.40 there is NAT support, however we installed our server before 11.40.
I want to use the NAT functionality (currently we run WHM 11.42.1 (build 12)).
I Tried:
[LIST]
/scripts/build_cpnat
/scripts/rebuildhttpdconf
The NAT is shown correctly on the 'Show or Delete Current IP Addresses'. But when I restart httpd, i'm back to the default pages for all websites :mad:
Then there are a bunch of files that still have the old 10.x.x.x IP.
So my question is whats the correct way to reconfigure a existing cPanel installation to use NAT?
There also a bunch of files that still contains the old IP (10.x.x.x)
[LIST]
/etc/*
/var/cpanel/userdata/*/*
Do i need to replace the old ip in all these files by hand? Or is there a script that can fix this?
Many thanks!
-
Hello :) Please review the contents of: /var/cpanel/cpnat Per our documentation: The list of the public IPs that are associated with the internal IPs will be written to the /var/cpanel/cpnat file one mapping per line: local_ip remote_ip Also, are the accounts assigned the old IP addresses in Web Host Manager? Thank you. 0 -
[quote="cPanelMichael, post: 1628821"> Please review the contents of: /var/cpanel/cpnat
it has one line: 10.246.xx.xx 54.x.x.x [QUOTE] Also, are the accounts assigned the old IP addresses in Web Host Manager?
I'm not sure what you mean? Where would you like exactly to look?0 -
For instance, when you browse to "WHM Home " Account Information " List Accounts", are the accounts assigned the correct IP address? Thank you. 0 -
Ah, ok. Well the problem is i see both.But i did edit the httpd.conf and did a global find and replace on the old 10.x with the new 10.x IP. 99% having the local 10.37.xx.xx IP, just a few have the external IP (EC2 elastic IP). BUt those i updated with the 'change site ip' function. 0 -
It's better to change the IP addresses via: "WHM Home " Multi Account Functions " Change Multiple Sites" IP Addresses" Rebuilding the Apache configuration file via /scripts/rebuildhttpdconf should revert the changes unless you used the distiller. Thank you. 0 -
But, in that screen it already show the external IP address (54.x.x.x). If i select a domain it tells me 'domain.tld is already using ip 54.x.x.x'. Where in account list it shows the 10.x.x.x IP's :confused: 0 -
Did you already rebuild the Apache configuration file via /scripts/rebuildhttpdconf to revert the manual edits you made? Thank you. 0 -
ok, i now run /scripts/rebuildhttpdconf . Now i see on 'Change Multiple Sites" IP Addresses' all domains are set to the elastic IP address (54.x.x.x). On the 'list accounts' i see the OLD 10.37.xx.xx IP's which should be 10.246.xx.xx? If I grep 10.246.xx.xx from /etc/httpd/conf/httpd (date time is changed) i see all websites be set to 10.246.xx.xx (thats the new IP, which looks good). 0 -
Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome. Thank you. 0 -
@cPanelMichael, it seems to be solved. Al files look good after the rebuildhttpdconf, thanks! 0 -
I am happy to see the issue is now resolved. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
11 comments