Skip to main content

[Case CPANEL-20422] New account redirects to defaultwebpage in 70

Comments

15 comments

  • swbrains
    FYI: I have found if I restart Apache (httpd) manually through cPanel after creating the new account, it works fine immediately. This is very consistent when creating new accounts. The problem is, on my old server I didn't have this issue and didn't need to restart Apache manually each time I added an account, and I didn't have to wait. Since my accounts are created by a script that needs to access the new account itself, this won't work as a solution. Hopefully the additional info may be useful in diagnosing this issue. Thanks!
    0
  • cPanelMichael
    Hello @swbrains, Thanks for the report. Check to see if you notice the following message in /usr/local/cpanel/logs/queueprocd.log upon creating an account: warn [queueprocd] install_best_available_certificate_for_domain exited with value 127 at /usr/local/cpanel/Cpanel/LoggerAdapter.pm line 27.
    If so, note that internal case CPANEL-20422 is open to address an issue in cPanel & WHM version 70 where Apache is not automatically restarted upon the creation of a new account in cases where /usr/local/cpane/bin/install_best_available_certificate_for_domain fails to install a certificate during the account creation process. I'll monitor this case and update this thread again once the solution is published. The temporary workaround is to manually restart Apache after creating new accounts. Thank you.
    0
  • swbrains
    Hi Michael, I created a new account just now (which is experiencing the issue) and then checked the log file. Here's the section at the end relevant to this new site's creation: apache_php_fpm restarted successfully. WARNING: key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf) Updating FTP passwords for vinnie17 FTP password files updated. FTP vhost passwords synced WARNING: key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf) WARNING: key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf) zone reload up-to-date WARNING: key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf) zone reload up-to-date There is no certificate available for the domain: vinnie17.xxxxxxx.com. [2018-05-14 10:33:41 -0500] info [queueprocd] PHPFPM: ensure_fpm_on_boot executing [2018-05-14 10:33:43 -0500] info [queueprocd] PHPFPM: ensure_fpm_on_boot completed
    I did see one instance of "install_best_available_certificate_for_domain" earlier in the log, but I think this one was issued during the time the accounts were being restored from a backup during server migration to this server from the old one, and it was a different exit value than you specified (2): [2018-05-12 22:53:05 -0500] warn [queueprocd] install_best_available_certificate_for_domain exited with value 2 at /usr/local/cpanel/Cpanel/LoggerAdapter.pm line 27. Cpanel::LoggerAdapter::warn(Cpanel::LoggerAdapter=HASH(0xae3c88), "install_best_available_certificate_for_domain exited with val"...) called at /usr/local/cpanel/Cpanel/TaskQueue/FastSpawn.pm line 74
    Not sure if it's relevant, but since this appears to be related to installing certificates (SSL I presume), we have AutoSSL turned off on the new server as we don't want self-signed certs being installed and we have our own apps that handle installing and renewal SSL certs for our customers. Unfortunately for us, the temporary workaround of restarting apache won't work, as our sites are created by a script automatically for customers when they sign up, and part of that script is to access the new site after creation and run some scripts on that site, which it now can't reach, so this is a blocking issue for us with regard to accepting new customers. Hope this helps! Let me know if you need any additional information.
    0
  • Seyed
    Hello I have the same problem Please support the C-Panel to solve this problem. But I found a temporary solution You must have the following code: service httpd restart Place the code above in the following file /usr/local/cpanel/scripts/legacypostwwwacct To reset apachi after account creation
    0
  • swbrains
    That's an interesting workaround. Is this script applicable to CentOS 7 and cPanel 70? I'd like to hear what cPanel think of this workaround, and exactly where in the legacypostwwwacct script the restart command should be placed. Any negative impacts expected from doing this?
    0
  • Seyed
    I tested On cpanel 70 and CentOS6 and CentOS7 I do not know about negative impacts:(:(
    0
  • swbrains
    Thanks!
    0
  • swbrains
    I've been poking around the cPanel docs, and it looks like the "script hooks" are deprecated and now cPanel is changing to "Standardized Hooks" (which unfortunately looks significantly more complicated to implement than simply editing a script): Tutorial - Create a Standardized Hook - Developer Documentation - cPanel Documentation While I think the script method would work just fine, I'm now concerned that it will simply stop working without warning one day since it's deprecated. :( While I felt confident editing a script to add one line to restart Apache, I don't feel confident (although I can write Perl scripts) with the 12-step hook registering process described in the link above. Seems a shame they made the hooking process so complicated. Having simple scripts that run before and after key processes seemed like a pretty simple and effective solution.
    0
  • swbrains
    For what it's worth, I did try the postwwwacct script to restart httpd after an account is created, but it had an unintended consequence. My account creation script that lets customers sign up for a site calls the cPanel API to create an account while displaying a page with a "please wait" message for about 30 seconds before forwarding them to another page that says their site is ready (and sends a welcome email at the same time). Unfortunately, restarting Apache in the middle of all that causes the browser to issue it's "no data error" or something like that before being able to redirect. Did I just restart the service that the script was running under? Regardless, even this workaround won't work for me. Oddly this all worked perfectly on the old server with the same Centos7 and and cPanel 68, so I don't know now if it's a bug in 70 or if there's just some difference in how the new server (or cPanel) is configured. Both servers were deployed at the same server farm, so they should have been fairly similarly configured by default.
    0
  • swbrains
    I've been doing some additional troubleshooting and I did finally come up with a solution that works for me, even if it uses the deprecated script hooks method. :) Working of Seyed's idea of the postwwwacct script, I noticed first I didn't have one, so I created it in the /scripts folder. Next, I added: service httpd restart, but that killed my site creation script midstream and aborted at the browser, so I needed something else. I tried a graceful restart of httpd, and while that allowed the site be available after creation, my script -- while it was running -- still couldn't access the site in order to execute a script on the new site (likely a DNS issue). So I figured maybe I could restart httpd gracefully (which would wait for my script to finish), but also restart named and that would allow my script to execute the other script on the new account. The combination of the following works for me: apachectl -k graceful service named restart
    It allows my creation script to continue running, reloads named to get the new site's dns loaded so the creation script can call a script on the new site immediately, then reloads httpd gracefully after my script finishes. In my tests, the creation script ran to completion, the script it called on the new site ran properly during that process, and the browser can get to the new site without any trouble right after creation (unique subdomain, browser cache cleared, just to make sure it worked). So in my case, if this were to be changed inside cPanel, I would need a new account creation to not only issue a graceful restart of httpd, but also reload named. I can't see why you wouldn't *always* want to reload httpd and named immediately upon creation of a new account to make sure it's available right away.
    0
  • Seyed
    This problem is solved in Cpanel v70.0.41
    0
  • cPanelMichael
    Hello, To update, this is solved in cPanel & WHM version 70.0.41 (as mentioned in the previous post): Fixed case CPANEL-20422: Ensure Apache is restart when install best certificate fails. This version is currently published to the CURRENT build tier, and should reach the RELEASE build tier soon. Can you let me know if the issue persists upon updating the affected system to this version? Thank you.
    0
  • Seyed
    hello @
    0
  • cPanelMichael
    Hello, To update, this is solved in cPanel & WHM version 70.0.41 (as mentioned in the previous post): Fixed case CPANEL-20422: Ensure Apache is restart when install best certificate fails. This version is currently published to the CURRENT build tier, and should reach the RELEASE build tier soon. Can you let me know if the issue persists upon updating the affected system to this version? Thank you.

    cPanel & WHM version 70.0.41 is now published to the RELEASE build tier.
    0
  • swbrains
    Thanks! I renamed my postwwwacct script to _postwwwacct and tested a new account creation and it ran fine and was available immediately. Thanks again for getting this fix implemented so quickly.
    0

Please sign in to leave a comment.