How to Change IP Address in VestaCP ?

Tác giả: Dương Nguyễn Phú Cường
Ngày đăng: 4 năm trước


Solution 1:

xx.xx.xx.xx — old private IP yy.yy.yy.yy — new private IP

1) run instruction from first post

2) grep -r “xx.xx.xx.xx” /etc/ grep -r “xx.xx.xx.xx” /home/ grep -r “xx.xx.xx.xx” /usr/local/ and replace all “xx.xx.xx.xx”/”xx-xx-xx-xx” on “yy.yy.yy.yy”/”yy-yy-yy-yy”

Replace all with command

[root@customer nginx]# clear
[root@customer nginx]# sed -i 's/45.32.21.174/45.77.45.167/g' /etc/sysconfig/iptables
[root@customer nginx]# find /usr/local -type f -exec sed -i 's/45.32.21.174/45.77.45.167/g' {} \;
[root@customer nginx]# grep -r "45.32.21.174" /usr/local
[root@customer nginx]# grep -r "45.77.45.167" /usr/local
 

3) rename files /etc/apache2/conf.d/xx.xx.xx.xx.conf in yy.yy.yy.yy.conf /etc/nginx/conf.d/xx.xx.xx.xx.conf in yy.yy.yy.yy.conf

4) set new public IP in NAT Vesta control panel

5) restart server

And may be you need change public IP on WEB and DNS sections in Vesta control panel

Solution 2:

touch /usr/local/vesta/bin/v-change-server-ip chmod 0755 /usr/local/vesta/bin/v-change-server-ip

v-change-server-ip OLDIP NEWIP