Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section 3rd Party Software
  • Search

How to Auto Change IP Address in VestaCP

Section with additional software for Vesta
Post Reply
  • Print view
Advanced search
35 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
mericson
Posts: 44
Joined: Thu Apr 06, 2017 12:37 am

Re: How to Auto Change IP Address in VestaCP
  • Quote

Post by mericson » Mon Apr 23, 2018 8:16 pm

Is this script still current? Been a lot of changes to VestaCP in 4 years.

What is the latest and greatest way to update all the IP addresses when migrating to a new server (including a floating IP I have behind NAT) ?

Did any v-* cli script get created for IP migration?

Basically my scenario is I have created a VM image which has my OS and VestaCP all preconfigured with my preferred setitngs, apps, security, etc. I like to create a new VM instance from that image and easily update to all the new IP addresses. After that I have a new instance, for hosting more websites, or for adding to a cluster.

Recommendations?
Top

plutocrat
Posts: 203
Joined: Fri Jan 27, 2017 9:16 am

Os: Ubuntu 18x
Web: apache + nginx
Re: How to Auto Change IP Address in VestaCP
  • Quote

Post by plutocrat » Tue Apr 24, 2018 3:26 am

mericson wrote: ↑
Mon Apr 23, 2018 8:16 pm
What is the latest and greatest way to update all the IP addresses when migrating to a new server (including a floating IP I have behind NAT) ?
Vesta will always need to use the local IP assigned inside the VM, not the NATted floating IP. The reason for this is that Apache/nginx bind to the local IP.

Was thinking I might have a go at updating the script. What OS are you running?

You might also look at this: viewtopic.php?f=19&t=15055. It works on OSes which have /etc/apache2 as opposed to /etc/httpd
Top

mehargags
Forum team
Posts: 1093
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 9x
Web: apache + nginx
Re: How to Auto Change IP Address in VestaCP
  • Quote

Post by mehargags » Tue Apr 24, 2018 11:05 am

I don't know why you really need a script to do this actually?

Just change your IPs in your /etc/network/interfaces,
then

Code: Select all

/usr/local/vesta/bin/v-update-sys-ip
or goto WebUI >> IP >> Re-Read IP

then do

Code: Select all

/usr/local/vesta/bin/v-change-web-domain-ip
for your domains one by one or batch them

After that just rebuild Web/DNS/Email for your users and reboot your server.

I know its not a straightforward thing to change your IPs but Vesta has the functionality built in already. Changing your NIC IP is a bit of an invasive thing... so there isn't really an easier way.
Top

mericson
Posts: 44
Joined: Thu Apr 06, 2017 12:37 am

Re: How to Auto Change IP Address in VestaCP
  • Quote

Post by mericson » Wed Apr 25, 2018 12:18 am

plutocrat wrote: ↑
Tue Apr 24, 2018 3:26 am
Was thinking I might have a go at updating the script. What OS are you running?
CentOS 7
Top

pablolp
Posts: 3
Joined: Wed Jul 25, 2018 1:07 pm

Os: CentOS 7x
Web: apache + nginx
Re: How to Auto Change IP Address in VestaCP
  • Quote

Post by pablolp » Wed Jul 25, 2018 1:27 pm

mehargags wrote: ↑
Tue Apr 24, 2018 11:05 am
I don't know why you really need a script to do this actually?

Just change your IPs in your /etc/network/interfaces,
then

Code: Select all

/usr/local/vesta/bin/v-update-sys-ip
or goto WebUI >> IP >> Re-Read IP

then do

Code: Select all

/usr/local/vesta/bin/v-change-web-domain-ip
for your domains one by one or batch them

After that just rebuild Web/DNS/Email for your users and reboot your server.

I know its not a straightforward thing to change your IPs but Vesta has the functionality built in already. Changing your NIC IP is a bit of an invasive thing... so there isn't really an easier way.
I think you're right

The external ip (WAN) is not needed for hosting but is necessary for the DNS server.

VestaCP automatically changes the current external IP to the new one in all domains and registries when you run v-update-sys-ip

I use a dynamic domain that is updated automatically with the current IP through a router (DD-WRT)

Code: Select all

DDNS: host.ddns.net > X.X.X.X
What I did was execute a CRON task that does this every 10 minutes, so everything stays updated.

Code: Select all

CRON: sudo /usr/local/vesta/bin/v-update-sys-ip */10 * * * *
This is the best I could do to avoid having to pay for a static IP. It's not the most efficient, but it works
Top


Post Reply
  • Print view

35 posts
  • Previous
  • 1
  • 2
  • 3
  • 4

Return to “3rd Party Software”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password