SHARE

Step 1: go to folder /etc/nginx/conf.d/ you will see the file oldip.conf like 23.227.177.193.conf with content:

[root@tutorialspots ~]# cat /etc/nginx/conf.d/23.227.177.193.conf
server {
    listen       23.227.177.193:80 default;
    server_name  _;
    #access_log  /var/log/nginx/23.227.177.193.log main;
    location / {
        proxy_pass  http://23.227.177.193:8080;
   }
}

vestacp nginx conf

You must make new file: newip.conf like 111.111.111.111.conf with content

server {
    listen       111.111.111.111:80 default;
    server_name  _;
    #access_log  /var/log/nginx/111.111.111.111.log main;
    location / {
        proxy_pass  http://111.111.111.111:8080;
   }
}

and delete the old file: oldip.conf.

Step 2: restart nginx

service nginx restart
[root@tutorialspots /]# service nginx restart
Stopping nginx:                                            [  OK  ]
Starting nginx:                                            [  OK  ]

Step 3: go to folder /etc/httpd/conf.d/ you will see the file oldip.conf like 23.227.177.193.conf with content:

[root@tutorialspots ~]# cat /etc/httpd/conf.d/23.227.177.193.conf
NameVirtualHost 23.227.177.193:8080
Listen 23.227.177.193:8080
NameVirtualHost 23.227.177.193:8443
Listen 23.227.177.193:8443

vestacp httpd conf

Note: with debian or ubuntu you must go to folder /etc/apache2/conf.d

You must make new file: newip.conf like 111.111.111.111.conf with content

NameVirtualHost 111.111.111.111:8080
Listen 111.111.111.111:8080
NameVirtualHost 111.111.111.111:8443
Listen 111.111.111.111:8443

and delete the old file: oldip.conf.

Step 4: replace oldip by newip in all .conf files in /home/

cd /home/
find . -name "*.conf" -print | xargs sed -i 's/23.227.177.193/111.111.111.111/g'

Step 5: restart apache

service httpd restart

Done!

Recent search terms:

  • Error: cant delete main IP address vestacp
  • how to set dynamic ip to vestacp

NO COMMENTS