Hestia IP Migration

Hello, my VPS provider suddenly change my vps ip due to some issue so did update all my dns record to point to the latest IP and did follow the tutorial on this post How to change the server IP? - #8 by schiwe

After I did this, it change the ip in the hestia panel.
v-update-sys-ip
v-rebuild-mail-domains of al users …

I did tried to access my wordpress sites but it says internal Server Error?

Please help, Thanks!

I also did cat /etc/exim4/domains/HEREYOURDOMAIN/ip

and it’s showing the new IP why my website not working?

I did cat /var/log/apache2/domains/mydomain.com.error.log | grep 500 on my every domain and can’t seem to find the error.

I can also do
systemctl restart nginx,php,apache,mariadb,sql fine so I can’t seem to get what seems to be the issue?

Check if the old ip is still in /etc/hosts and replace it with the new ip.

This means there is an error in configuration somewhere.

Were the domains mapped to a specific public directory, like /public, etc?

What about the Nameserver, is the new IP pointing to the domains?

There is no Host on my cd directory? any way where I can check if it’s still using the old ip.

``Host No Such filie or directory detected```

All DNS has been pointed to the new IP, and I have followed a tutorial on this forum on how to rebuild all with the new IP but for some reason all of my web server is saying internal server error?

The Panel is already using the new IP on the frontend ui on my end.

The file is /etc/hosts it isn’t in your home directory.

As root you can search for your old ip (replace 203.0.113.1 by the real old ip):

sudo grep -Rf '203.0.113.1' /etc/

it did say grep: 23.247.50.197: No such file or directory

Sorry, I mistyped the f, it is F

sudo grep -RF '23.247.50.197' /etc/

The output is

grep: /etc/rc1.d/KO1multipath-tools: No such file or directory
grep: /etc/rc4.d/SO1multipath-tools: No such file or directory
grep: /etc/rc3.d/SO1multipath-tools: No such file or directory
grep: /etc/rc5.d/SO1multipath-tools: No such file or directory
grep: /etc/rc2.d/SO1multipath-tools: No such file or directory
grep: /etc/rc6.d/KO1multipath-tools: No such file or directory
grep: /etc/rc0.d/KO1multipath-tools: No such file or directory
/etc/iptables.rules:-A INPUT -s 23.247.50.197/32 -j ACCEPT

What should I do next? Removed that IP table? Thanks.

No. you don’t need to edit manually that file.

Well, seems you are not using the old ip in any of the conf files so I suppose the problem is in Wordpress, main conf or plugin conf, maybe some plugin you configured is still trying to use the old ip or whatever, to know the reason you must check the log files for your sites.

I don’t know if you are using nginx or nginx+apache2 so you should review these log files:

Note: I will use example.net as the domain name, you must replace it by the actual one.

/var/log/nginx/error.log
/var/log/nginx/domains/example.net.error.log
/var/log/apache2/error.log
/var/log/apache2/domains/example.net.error.log

So you can reproduce the error visiting your site and just after that, check the log files.

tail /var/log/nginx/error.log
tail /var/log/nginx/domains/example.net.error.log
tail /var/log/apache2/error.log
tail /var/log/apache2/domains/example.net.error.log

For some reason all logs are showing webmail

webmail.bigmeediacompany.com.error.log
webmail.bigbeemediacompany.com
webmail.luminoushorizonspressandmedia.com.error.log
webmail.luminoushorizonspressandmedia.com.log

There is no error for my domain, only subdomain with webmail is showing so I assume it’s a webmail issue, how do I fix this? Thank you again for your help.

For the Apache, I have seen this error in one of my domain.
error 518186 *1835 upstream time out while connecting to upstream request

This domain bigmeediacompany.com doesn’t exist.

bigbeemediacompany.com exists but webmail.bigbeemediacompany.com doesn’t.

Domain luminoushorizonspressandmedia.com exists but webmail.luminoushorizonspressandmedia.com doesn’t have an A record pointing to your server.

Again, you must have something in the logs, check again in all the logs.

Also, the error is a 504 gateway error so maybe apache is not working as it should.

nginx -t
apache2ctl configtest
systemctl status nginx --no-pager -l
systemctl status apache2 --no-pager -l

The Output of the code below are all active and running

nginx -t
systemctl status nginx --no-pager -l
systemctl status apache2 --no-pager -l

but when I do apache2ctl configtest it says this warning (Could not reliably determine the server’s fully qualified domain name, using dash.avianserver.com. Set the “Servername” directive globally to suppress this message.

Also for the webmail, I did use it before but now I am not using does it matter if it’s pointed? Thank you again for your help.

That’s ok, no problem.

If you removed your mail domain or at least you are not using the webmail, then you don’t need to add an A record for the webmail.

Again, you must check the logs or we won’t be able to help you.

Sorry about that was on my phone when I posted this

here’s a log on one of my site

root@dash:~# tail /var/log/apache2/domains/zeokinawabulktrash.com.error.log
2024/08/13 22:43:58 [error] 58186#58186: *2264 upstream timed out (110: Connection timed out) while connecting to upstream, client: 110.54.229.3, server: zeokinawabulktrash.com, request: "GET / HTTP/2.0", upstream: "https://158.51.78.80:8443/", host: "zeokinawabulktrash.com"
2024/08/13 22:44:32 [error] 58186#58186: *2264 upstream timed out (110: Connection timed out) while connecting to upstream, client: 110.54.229.3, server: zeokinawabulktrash.com, request: "GET /favicon.ico HTTP/2.0", upstream: "https://158.51.78.80:8443/favicon.ico", host: "zeokinawabulktrash.com", referrer: "https://zeokinawabulktrash.com/"
2024/08/13 23:29:44 [error] 77481#77481: *225 upstream timed out (110: Connection timed out) while connecting to upstream, client: 52.167.144.214, server: zeokinawabulktrash.com, request: "GET /faq/ HTTP/2.0", upstream: "https://158.51.78.80:8443/faq/", host: "zeokinawabulktrash.com"
2024/08/13 23:50:31 [error] 77481#77481: *283 upstream timed out (110: Connection timed out) while connecting to upstream, client: 196.70.252.214, server: zeokinawabulktrash.com, request: "POST /xmlrpc.php HTTP/1.1", upstream: "https://158.51.78.80:8443/xmlrpc.php", host: "zeokinawabulktrash.com"
2024/08/14 00:04:38 [error] 77481#77481: *331 upstream timed out (110: Connection timed out) while connecting to upstream, client: 110.54.228.254, server: zeokinawabulktrash.com, request: "GET / HTTP/2.0", upstream: "https://158.51.78.80:8443/", host: "zeokinawabulktrash.com"
2024/08/14 00:05:08 [error] 77481#77481: *331 upstream timed out (110: Connection timed out) while connecting to upstream, client: 110.54.228.254, server: zeokinawabulktrash.com, request: "GET /favicon.ico HTTP/2.0", upstream: "https://158.51.78.80:8443/favicon.ico", host: "zeokinawabulktrash.com", referrer: "https://zeokinawabulktrash.com/"
2024/08/14 01:04:49 [error] 77481#77481: *563 upstream timed out (110: Connection timed out) while connecting to upstream, client: 108.165.243.158, server: zeokinawabulktrash.com, request: "GET / HTTP/2.0", upstream: "https://158.51.78.80:8443/", host: "zeokinawabulktrash.com"
2024/08/14 01:06:10 [error] 77481#77481: *563 upstream timed out (110: Connection timed out) while connecting to upstream, client: 108.165.243.158, server: zeokinawabulktrash.com, request: "GET / HTTP/2.0", upstream: "https://158.51.78.80:8443/", host: "zeokinawabulktrash.com", referrer: "https://www.google.com/"
2024/08/14 01:07:21 [error] 77481#77481: *586 upstream timed out (110: Connection timed out) while connecting to upstream, client: 108.165.243.155, server: zeokinawabulktrash.com, request: "GET / HTTP/2.0", upstream: "https://158.51.78.80:8443/", host: "zeokinawabulktrash.com"
2024/08/14 01:22:06 [error] 77481#77481: *667 upstream timed out (110: Connection timed out) while connecting to upstream, client: 110.54.187.229, server: zeokinawabulktrash.com, request: "GET / HTTP/2.0", upstream: "https://158.51.78.80:8443/", host: "zeokinawabulktrash.com", referrer: "https://www.google.com/"```

Thank you again for helping.

Are you sure those logs are from Apache2 and not Nginx?

Well, the problem is that the upstream https://158.51.78.80:8443/ is not accepting connections.

Show the output of this commands:

lsof -Pn +c0 -i:8080,8443 -sTCP:LISTEN

I guess there isn’t a conf file for your new ip, check it:

ls -l /etc/apache2/conf.d/

If you don’t have a file like 158.51.78.80.conf you should create it with this content:

Listen 158.51.78.80:8443
Listen 158.51.78.80:8080
<VirtualHost 158.51.78.80:8080>
    ServerName 158.51.78.80
    DocumentRoot /var/www/html/
    Alias /error/ /var/www/document_errors/

</VirtualHost>

<VirtualHost 158.51.78.80:8443>
    ServerName 158.51.78.80
    DocumentRoot /var/www/html/
    Alias /error/ /var/www/document_errors/

    SSLEngine on
    SSLVerifyClient none
    SSLCertificateFile         /usr/local/hestia/ssl/certificate.crt
    SSLCertificateKeyFile      /usr/local/hestia/ssl/certificate.key

</VirtualHost>

Note: If you have a file with the old ip, you must remove it (back it up before remove it).

After the file is created, restart Apache2:

systemctl restart apache2

This solved the issue, Thank you so much for you help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.