Alias redirect don't work

Discussion in 'ISPConfig 3 Priority Support' started by chsdaiguil, Jan 9, 2025.

Tags:
  1. chsdaiguil

    chsdaiguil Member HowtoForge Supporter

    Hello

    the name of our domain changes, so I changed the name of the domain.old with the domain.new in the website panel of Websites

    But when I redirect the domain.old to the domain.new in Aliasdomains the rediection does not work. domain.old remains active and not redirected to domain.new.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Ensure that you change the domain name in the CMS of your website as well.
     
  3. chsdaiguil

    chsdaiguil Member HowtoForge Supporter

    both domains work domain.old and domain.new and send to the same drupal site. I think the problem comes from elsewhere
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    But that's exactly what shall happen when you have one domain as website domain and the other as alias domain. Technically, there is no difference between the main domain of the site and the alias domains, they are just two equal names for the same website.

    What the site itself displays or if it directs domain A to domain B when you enter domain A depends on your CMS. So, you must change the domain in Drupal, as I mentioned. If you configured any additional redirects, either in ISPConfig or in a .htaccess file, then you must change them as well.
     
    chsdaiguil likes this.
  5. chsdaiguil

    chsdaiguil Member HowtoForge Supporter

    I managed to get around this redirection problem. However, there is probably a problem I think I messed up the .vhosts files of /etc/apache2/site-enables/

    Indeed, I did not find how to automatically renew the Let's Encrypt certificates generated by the ISPConfig interface.
    I then used the Cerbot command and configured a CrontTab (to automatically renew them).

    How can I properly delete the Cerbot-generated certificates and set up automatic renewal of Let's Encrypt certificates from the ISpconfig interface?
     
  6. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    sudo certbot delete --cert-name server.domain.tld

    just tick the 'letsencrypt ssl' checkbox in the website settings. as long as everything is correct (all dns records exist and point to the correct server) it'll create, and apply the certificates for you, and they'll renew automatically.
    you don't need to do anything else.
     
    chsdaiguil likes this.
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you have any files with -le in the file name in sites-enabled or sites-available folder? If yes, these were created certbot and and cause now any actions and config for the site to be blocked. Also, take care to remove any cronjobs you created for certbot, they will cause proper removal to fail, too.

    As mentioned by @nhybgtvfr , all certs get renewed automatically, no manual config needed. And to create them, all you have to do is to enable Let's encrypt checkbox and SSL checkbox of a site. In case this fails, see Let's Encrypt error FAQ post.
     
  8. chsdaiguil

    chsdaiguil Member HowtoForge Supporter

    What do you mean by "any files with -le"?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Check if you have any files with -le in the file name there. Like somedomain.com-le.vhost or sinilar.
     
  10. chsdaiguil

    chsdaiguil Member HowtoForge Supporter

    no, I don't have any, I do have domain.com.vhost.err files though
     
  11. chsdaiguil

    chsdaiguil Member HowtoForge Supporter

    I deleted the cerbot and the crontab, apache is now crashed. Here is the error

    systemctl status apache2.service

    apache2.service - The Apache HTTP Server
    Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Fri 2025-01-10 14:31:26 CET; 12s ago
    Docs: https://httpd.apache.org/docs/2.4/
    Process: 986764 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
    CPU: 96ms

    Jan 10 14:31:26 server1 systemd[1]: Starting The Apache HTTP Server...
    Jan 10 14:31:26 server1 apachectl[986767]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.vhost:7
    Jan 10 14:31:26 server1 apachectl[986767]: AH00526: Syntax error on line 171 of /etc/apache2/sites-enabled/100-alamanon.fr.vhost:
    Jan 10 14:31:26 server1 apachectl[986767]: SSLCertificateFile: file '/etc/letsencrypt/live/domain.com/fullchain.pem' does not exist or is empty
    Jan 10 14:31:26 server1 apachectl[986764]: Action 'start' failed.
    Jan 10 14:31:26 server1 apachectl[986764]: The Apache error log may have more information.
    Jan 10 14:31:26 server1 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
    Jan 10 14:31:26 server1 systemd[1]: apache2.service: Failed with result 'exit-code'.
    Jan 10 14:31:26 server1 systemd[1]: Failed to start The Apache HTTP Server.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Delete the symlink /etc/apache2/sites-enabled/100-alamanon.fr.vhost, start Apache, then enable SSL and Let's Encrypt checkbox in that website again.
     
    chsdaiguil likes this.
  13. chsdaiguil

    chsdaiguil Member HowtoForge Supporter

    works thank-you
     

Share This Page