How do I solve this problem?
v-change-web-domain-ip user domain-com 1.2.3.4
grep: /usr/local/hestia/data/ips/1.2.3.4: No such file or directory
grep: /usr/local/hestia/data/ips/1.2.3.4: No such file or directory
Error: Parsing error
The problem is actually that I added the following ip address 192.168.2.x/32 on the server, but hestia automatically added it to the panel in a way that was NAT’ted to the external ip, then when I moved, every site received this ip address. I changed the websites assigned to this ip address to the other ip address I use, but I encountered too many errors. I cannot define it as Default IP. When I try to add a new webdomain, the other ip I added later is automatically selected, how can I overcome this problem?
When a new web domain is added, the ip address of the website is assigned as 1.2.3.4 (192.168.2.147).
But I use the public ip address 1.2.3.5. This ip address was there when I set up the server.
(192.168.2.147) is the ip address I added as eth1 via netplan.
How can I set this configuration as the default IP address.
1.2.3.5 ip address should be selected by default when adding a new web domain or when I add it via cli, it should automatically create records with this ip address.
Hestia doesn’t allow setting a default shared IP address directly. While you could modify the script /usr/local/hestia/bin/v-list-user-ips and the function /usr/local/hestia/func/ip.sh to make Hestia always use 1.2.3.5 as the default IP for your domains, this approach is not recommended. Any changes you make will be overwritten during the next update.
Anyway, if you want to test it:
In /usr/local/hestia/bin/v-list-user-ips replace this:
ips="$(echo -e "$user_ips\n$owner_ips" | sort -u | sed "/^$/d")"
by this
ips="$(echo -e "$user_ips\n$owner_ips" | sort -ru | sed "/^$/d")"
In /usr/local/hestia/func/ip.sh inside function get_user_ip replace this:
ip=$(get_user_ips | head -n1)
by this
ip=$(get_user_ips | tail -n1)
Again, you shouldn’t modify any of those files. Instead, select the correct IP when adding a web domain or specify it as a parameter when adding the domain from the command line.