Halo, kalau kamu merasa tulisan saya ngebantu, kamu bisa ucapkan terima kasih lewat saweria .

If you feel this website help you, you can donate at saweria .



What I Used in This Tutorial

  1. Ubuntu Server 20.04 LTS

  2. Nginx v1.22.1 .

  3. Certbot 0.40.0. You should upgrade your certbot by installing it using snap . Standard installation apt-get certbot version was obsolete.


Search What Cause This Error

Before follow this tutorial, you can read how other fix this error

  1. Infiniroot - Nginx Crash Reload Twice Perl Bug

  2. Serverfault - Nginx sometimes gets killed after reloading it using systemd

But what really cause this error? What if you need perl modules on your nginx?

Turn out the one who cause this was your expired/unexist certbot certificates on server

To check this error, you can use certbot renew then your nginx will die unexpectedly.

Error At service nginx status. Not Really Helpfull

Error At service nginx status. Not Really Helpfull

Error at /var/log/syslog Was More Detailed

Error at /var/log/syslog Was More Detailed


How To Fix This Without Remove Perl Modules

  1. List all certbot certificates using certbot certificates, write down your expire certificates

    Notes: If this command still makes nginx stopped, you can remove temporary perl modules sudo rm /etc/nginx/modules-enabled/50-mod-http-perl.conf and restart your nginx.

  2. Remove your expired/unexist certificates sudo certbot delete --nginx --cert-name your-expire-domain.com or sudo certbot delete then you can remove expired/unexist certificates by typing it number (you can delete multiple certificates with this).

  3. Try again to renew your certicates certbot renew. Then you can re-enable perl modules sudo ln -s /usr/share/nginx/modules-available/mod-http-perl.conf /etc/nginx/modules-enabled/50-mod-http-perl.conf, don’t forget to restart your nginx service.


It Doesnt Work, What Should I Do Then?

1. Upgrade your nginx to latest version

2. Upgrade your OS to latest version

3. Upgrade your certbot to latest version

4. Remove your unused certbot certificates

5. If you used Cloudflare, try to renew your certificates. If it failed you can follow this post to use certbot behind Cloudflare

6. If you not using Perl module in your nginx, it was safe to disable it