• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs IP Addresses "Default site" change every time I create a new (sub)domain

Azurel

Silver Pleskian
User name: Azurel

TITLE

IP Addresses "Default site" change every time I create a new (sub)domain

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Exists since Plesk 11.x to 18.x with CentOS 7

PROBLEM DESCRIPTION

IP Addresses "Default site" change every time I create a new (sub)domain

STEPS TO REPRODUCE

Create a subdomain, go to
Tools & Settings > IP Addresses
and IPv4 and IPv6 have as "Default site" to new created subdomain.

I have issued this years ago Issue - Create/Update domain/subdomain change every time default site

ACTUAL RESULT

New created subdomain is set as default site in IP Addresses

EXPECTED RESULT

Default site was set as "NONE" and should not change with creating new subdomains.

ANY ADDITIONAL INFORMATION



YOUR EXPECTATIONS FROM PLESK SERVICE TEAM


Confirm bug
 
  • Like
Reactions: Hex
Thank you.
The bug was confirmed and submitted as PPP-48685
 
I see this behavior since Plesk Onyx 17.X but never bother to report it. lol
 
Hello.

Do you have any news about the resolution of this bug ?
How can we help debug and fix it ?

Example of consequences of this bug for the SEO of your websites or client's websites (we have been impacted) :

1) Domain D1 exists for several years on the server and is well referenced by google (top 1)
2) Domain D50 is the last created and start to be well referenced by google too (top 3)
3) Domain D1 is deleted (out of business) and the DNS Zone is not managed by us (so the domain still resolve to the server IP)
4) As the "Default site" for this IP has been changed by this bug to Domain D50, Domain D1 now show the content of Domain D50 (like an alias)
5) Google now see the exact same website with 2 different domains names and flag D50 with duplicated content
6) Problem is identified (and corrected by reverting back to "Default site : None") a little bit too late : Domain D50 lose SEO position (client not happy ?)


Help ?


Plesk Version 18.0.37
 
Hello,

We are at the version 18.0.52 and the problem is still present.
Can you at least give us a direction on how to implement a cron task that can update the default site for an IP . Is there any plesk command line that can help mitigate this particularly annoying bug ?

This bug is also present when using plesk migrator.
 
Hello,

Following an exchange with Melvin from Plesk support, here is a command line which can be used has a scheduled task (executed as Root)

Bash:
/usr/sbin/plesk db "UPDATE IP_Addresses SET default_domain_id = '0' WHERE ip_address = '1.2.3.4';"

We have tested and applied this method to our servers.

Again, thanks to Peter for the suggestion to contact the support and thanks to Melvin for the solution.
 
I know it's just a template, but isn't there something missing anyway? At least for me it is IPv4 and IPv6 that are changing.

/usr/sbin/plesk db "UPDATE IP_Addresses SET default_domain_id = '0' WHERE ip_address IN ('1.2.3.4', '2001:xxx::x:x');"

And shouldn't it apply to all IPs of the server anyway? Then the WHERE is completely unnecessary?

/usr/sbin/plesk db "UPDATE IP_Addresses SET default_domain_id = '0';"
 
Some "bad news".
The command to update the entry in the Plesk database is not enough.

When the "Default site" for an IP is set, there is also a symlink added in the folder /etc/nginx/plesk.conf.d/ip_default
E.g :
Code:
domain-demo-a.tld.conf -> /var/www/vhosts/system/domain-demo-a.tld/conf/nginx_ip_default.conf

The action to choose "None" for the "Default site" of an IP from the Plesk interface does more than just updating the database : it also remove the symlink (and maybe do other changes too ?).

If only the database is updated, that can lead to the following problem when adding a new subscription (on this IP) :
Code:
stderr:
nginx: [emerg] a duplicate default server for XX.XX.XX.XX:80 in /etc/nginx/plesk.conf.d/ip_default/domain-demo-a.tld.conf:17
nginx: configuration file /etc/nginx/nginx.conf test failed

ERR [panel] Apache config (16854297040.81991700) generation failed: Template_Exception: nginx: [emerg] a duplicate default server for XX.XX.XX.XX:80 in /etc/nginx/plesk.conf.d/ip_default/domain-demo-a.tld.conf:17
nginx: configuration file /etc/nginx/nginx.conf test failed

file: /opt/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
ERR [panel] nginx: [emerg] a duplicate default server for XX.XX.XX.XX:80 in /etc/nginx/plesk.conf.d/ip_default/domain-demo-a.tld.conf:17
nginx: configuration file /etc/nginx/nginx.conf test failed

ERR [panel.ui] nginx: [emerg] a duplicate default server for XX.XX.XX.XX:80 in /etc/nginx/plesk.conf.d/ip_default/domain-demo-a.tld.conf:17
nginx: configuration file /etc/nginx/nginx.conf test failed


For the time being, we have disabled these scheduled tasks on our servers.
 
Back
Top