ISPCONFIG change domain of server - cannot create new SSL certificate

Discussion in 'ISPConfig 3 Priority Support' started by Petar, Jun 30, 2021.

  1. Petar

    Petar Member HowtoForge Supporter

    Dear colleagues,
    I have an created ISPC with Th0m's new auto install, which i'm using as a clone for creating several VM ISPC servers.
    If i leave the same domain as in installation, i can create again the letsencrypt certificate during ISPconfig 3.2.5 update.
    But if i previously change the domain of the server everywhere (hosts, hostname, postfix, ftp, ISPC controller) the process doesnt succseed and it starts with manual unsigned ssl cert creation.

    During the creation, apache is restarted, finds some errors and doesn't start again.
    ---
    Create new ISPConfig SSL certificate (yes,no) [no]: yes
    Checking / creating certificate for sub.server.com
    Using certificate path /etc/letsencrypt/live/sub.server.com
    Using apache for certificate validation
    acme.sh is installed, overriding certificate path to use /root/.acme.sh/sub.server.com
    sub.server.com:Verify error:Fetching http://sub.server.com/.well-known/acme-challenge/HqzpU-o6hSCgDmCv25q45Gwl324UbGJ489J9NhDhI: Timeout during connect
    ---

    Apache error log
    ---
    Passenger core shutdown finished
    AH00526: Syntax error on line 20 of /etc/apache2/sites-enabled/000-apps.vhost:
    SSLCertificateFile: file '/usr/local/ispconfig/interface/ssl/ispserver.crt' does not exist or is empty
    ---

    I guess that i should delete all traces of the previous cert from acme.sh and vhosts or other files, and only the start the update with new cert.
    WHICH folders, and files should i change, so that the acme.sh doesn't find its previous certs and issue a new one for the new domain?

    Best regards and many thanks for your help and support upfront

    Peter
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Is sub.server.com the old or the changed name?
     
  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I cloned the minimal Debian server. Then I set up it's IP-number and hostname like the install tutorial tells, and install ISPConfig.
    You make things complicated by changing the hostname after ISPConfig is installed.
     
  4. Petar

    Petar Member HowtoForge Supporter

    Its the new domain of the server. Acme cannot get the file because in meanwhile the apache service is falling with the error.
     
  5. Petar

    Petar Member HowtoForge Supporter

    I have a ton of customizations like Iptables, ssh, fail2ban filters and jail, ipset with tons of ips, psad, ispconfig template, settings, postfix customizations, custom ports, postgresql, shared folders, backup scripts, etc...
    Besides, everything was working fine until recently with 5-6 changes of domain name like i mentioned in the post.
    Thanks for your advice
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, but then your issue is not caused by the previous cert as mentioned in first post. What you cyn try is to remove the symlinks for the apps vhost and ispconfig vhost in the folder /etc/apache2/sites-enabled/ and recreate them later again.
     
  7. Petar

    Petar Member HowtoForge Supporter

    I will try that immediately.
    Just to be clear: If the old domain remains, every update or force update is working.
    Only when i rename the server (everywhere, and as previously working for years), now its having this problem with the new cert.
     
  8. Petar

    Petar Member HowtoForge Supporter

    NO LUCK:
    ---
    Create new ISPConfig SSL certificate (yes,no) [no]: yes

    Checking / creating certificate for new.server.com
    Using certificate path /root/.acme.sh/new.server.com
    Using apache for certificate validation
    acme.sh is installed, overriding certificate path to use /root/.acme.sh/new.server.com

    new.server.com:Verify error:Fetching http://new.server.com/.well-known/acme-challenge/n_sV4pxT6i69yMqr7daZ-QYVD12354oSpg1s: Timeout during connect (likely firewall problem - comment:NOT BUT APACHE DOWN)

    Please add '--debug' or '--log' to check more details.

    See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
    Issuing certificate via acme.sh failed. Please check that your hostname can be verified by letsencrypt

    Could not issue letsencrypt certificate, falling back to self-signed.
    Generating a RSA private key
    .....++++
    .....................................................................++++
    writing new private key to '/usr/local/ispconfig/interface/ssl/ispserver.key'
    -----


    APACHE:
    Reloaded The Apache HTTP Server.
    Syntax error on line 20 of /etc/apache2/sites-enabled/000-apps.vhost:
    SSLCertificateFile: file '/usr/local/ispconfig/interface/ssl/ispserver.crt' does not exist or is empty

    Action 'stop' failed.
    The Apache error log may have more information.
    Control process exited, code=exited, status=1/FAILURE
    Failed with result 'exit-code'.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    You removed /etc/apache2/sites-enabled/000-apps.vhost before, right? This means that the updater recreated the symlink before he tried to get the SSL cert.
     
  10. Petar

    Petar Member HowtoForge Supporter

    Yes i removed both vhosts (should i remove ispconfig.conf also?) and check the time of the apps.vhost it was at the same moment when updating, so yes it recreates it
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    No. I gues we'll have to investigate that further in the code to see if there is a workaround.
     
  12. Petar

    Petar Member HowtoForge Supporter

  13. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

  14. Petar

    Petar Member HowtoForge Supporter

    I can confirm, that by changing rename into copy, following the proposed changes here:
    https://git.ispconfig.org/ispconfig/ispconfig3/-/issues/6121
    i can now update the system with the new domain name...
     

Share This Page