Switching to new cloud instance
Some background info -
I'm running cPanel on a 4GB RAM cloud instance (IP: 10.0.0.5), with a separate volume as the 'root-disk'. It has a public-facing IP which is registered with cPanel.
I needed more computing power and RAM, so upgraded the instance to 8GB RAM - the provisioned IP is 10.0.0.8.
When I attached the original root-disk to this new instance, it is showing the original IP (10.0.0.5) - i.e. all the VirtualHosts in the httpd.conf is using the old IP (10.0.0.5).
So I had to manually change the IP to the new one, 10.0.0.8
However, whenever I make any changes with easyApache, the IP reverts back to the old one, i.e. "10.0.0.5".
How can I change the IP from .5 to the new one, .8 ?
I found this file /var/cpanel/root.accts - that has references to old IP. Can I update this file? Any other files to update ?
Many thanks!
-
Hello, Under path /var/cpanel/userdata/ you will see dirs of all users, just replace IPs for all domains using replace command then run easyapache. 0 -
Related to the above, are there any background tasks/cronjobs that would update the /etc/apache2/conf/httpd.conf ? Because I just discovered that after making the manual changes to the IP addr, a few hours later, they were reverted back to the old IP (10.0.0.5) 0 -
Hello, Yes, you should not edit httpd.conf manually. As I said, make the changes in the files that are present under /var/cpanel/userdata/username then run easyapache to fix the issue. Replace username with actual cpanel user name. 0 -
Thanks @GoMummyHosting and @cPanelLauren for responding! I tried to add the new IP via the web Interface, but I get this message that the IP (10.0.0.8) is already an active IP. But when I tried to change the Site's IP (from the "Acccounts Function" section), I don't see this internal IP, but only the Public IP (from the Cloud provider). What else can I do to make this 'switch' ? Re: same potential for irreparable damage. May I ask what kind of 'irreparable damage' that might happen if I follow @GoMummyHosting advice? Thank you. 0 -
Modifying the userdata in the manner suggested can cause the userdata to become corrupted which is what all account information is based on. In the event this happens, it's possible that you will not be able to recover it without a full backup. Further to that the IP is referenced in far more places than just those files and in order to properly switch over you'd need to manually modify every reference. Also, you don't "run easyapache" anymore for anything. EasyApache 4 is package based and there's no need for recompiling using EasyApache as there was in previous versions and because of that, it wouldn't have fixed your issue it would have let the accounts in a broken state. Can you show me the output of the following? (change the actual public IP before submitting) cat /var/cpanel/cpnat
I tried to add the new IP via the web Interface, but I get this message that the IP (10.0.0.8) is already an active IP.
If the IP is already present on the server at WHM>>IP Functions >> Show or Delete current Ip addresses you shouldn't need to add it. The IP address migration tool as I noted previously would be the advised method of moving all the sites to the new ip. If you've not gotten a new public IP it should reference that in the cpnat file I asked you to provide.0 -
Hi @cPanelLauren , cat /var/cpanel/cpnat ==> 10.0.0.8 104.37.196.XX (<-- a valid IP, I just replaced it with 'xx') WHM >> IP Functions >> Show or Delete also shows the same info above. What does this mean? That all is "ok" ? If so, then why does the file "root.accts" and the files in the "userdata" still reflects the old IP ? Thanks! 0 -
This issue - the /etc/apache2/conf/httpd.conf was changed again yesterday - to use back the OLD internal IP. I do not know why. cat /var/cpanel/cpnat - shows the correct info, i.e. correct mapping between the internal IP and public IP This time, though, cat /var/cpanel/root.accts shows the public IP for each of the accounts. Only one of the accounts (in /var/cpanel/userdata/ ) is still using the OLD internal IP. All other accounts are using the new internal IP. How do I get rid of this OLD internal IP addr ? Thanks! 0 -
I'm not sure how that would happen but this would be something best handled through a ticket. Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved. Thanks! 0 -
Hi Lauren, I've opened a ticket already (#93479134) and Eric has replied with instructions. cd /var/cpanel/userdata/ sed -i 's/10.0.0.X/10.0.0.Z/g' * (replace 10.0.0.X with 10.0.0.Z ) /scripts/updateuserdatacache --force (cPanel script to force update on user's data cache) /scripts/rebuildhttpdconf (cPanel script to rebuild httpd.conf) Thanks! 0
Please sign in to leave a comment.
Comments
10 comments