Tuesday, 2 July 2024

let's encrypt ssl certificate update issue in apache2 and nginx in ubuntu

  • First Check You site is working on nginx then check apache2 enable or not.
  • Fire command sudo service apache2 status
  • After you have to fire disable apache2 service using below command
    Command : sudo systemctl disable apache2
  • After Checked /etc/nginx/sites-available/ in this there are same
            Domain two virtual host then you have remove one.in my
            Case example.com virtual host and in default file we have also
            Same thing, so I have changed the default file
    server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /var/www/html; index index.html index.htm index.nginx-debian.html; location / { try_files $uri $uri/ =404; } }
  • Next step is stop service of nginx
            Command : sudo systemctl stop nginx
  • In nginx some time issue happen nginx not stop so we have toKill process below command check how many service working on
            Ubuntu.  you have check any nginx service is running or not if service is running
            then please remove port sudo lsof -i :80 sudo lsof -i :443
  • Next step is we have to remove process of 80 and 433 Command for 80 : sudo lsof -i :80 | awk 'NR>1 {print $2}' | xargs sudo kill Command for 443 : sudo lsof -i :443 | awk 'NR>1 {print $2}' | xargs sudo kill
  • If still not clear process then we have option to process kill forcefully|  sudo lsof -i :80 | awk 'NR>1 {print $2}' | xargs sudo kill -9
    sudo lsof -i :443 | awk 'NR>1 {print $2}' | xargs sudo kill -9
  • renew letsencrypt certificate Command :  sudo certbot renew --verbose
  • Next is start nginx Command : sudo systemctl status nginx
  • Use the following command to renew your SSL certificate. The --force-renewal flag tells Certbot to renew the certificate Command : sudo certbot renew --force-renewal
  • Look for certbot.timer in the list. If it is not present, you can add a cron job manually Command : sudo systemctl list-timers
  • Check all virtual host certificate information below command is used Command : sudo certbot certificates

No comments:

Post a Comment

Thank You For Comment