Posts

Nginx, OCSP stapling, booting, systemd and Debian 9

Noticed these lines in journalctl when nginx didn’t start after a reboot:

Dec 10 17:43:30 mail1 nginx[3485]: nginx: [warn] "ssl_stapling" ignored, host not found in OCSP responder "ocsp.int-x3.letsencrypt.org" in the certificate "/etc/letsencrypt/live/www.example.com/fullchain.pem"
Dec 10 17:43:30 mail1 nginx[3485]: nginx: [emerg] bind() to [<IPv6 address>]:80 failed (99: Cannot assign requested address)
Dec 10 17:43:30 mail1 nginx[3485]: nginx: configuration file /etc/nginx/nginx.conf test failed
Dec 10 17:43:30 mail1 systemd[1]: nginx.service: Control process exited, code=exited status=1
Dec 10 17:43:30 mail1 systemd[1]: nginx.service: Unit entered failed state.
Dec 10 17:43:30 mail1 systemd[1]: nginx.service: Failed with result 'exit-code'.
Dec 10 17:52:35 mail1 systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument

Hmmm…

Script: Update Linode DNS Records with WAN IPs (Dynamic DNS)

Either of these scripts will grab both the IPv4 and IPv6 (if any) addresses assigned to any WAN I’m behind, and, using Linode’s DNS API, will update my DNS records with same and log changes/errors using logger. In effect, it’s a homemade Dynamic DNS updater. Linode’s developing a new API so that’s why  two versions exist.

Download from Bitbucket

To use the script, you need:

  1. A Linode API key (for version 3 of Linode’s DNS API) or Personal Access Token (for version 4 of Linode’s DNS API),
  2. the domain ID, and
  3. the resource (called record in v4) IDs of the DNS records you want to update.

The IDs don’t change, whether you’re using version 3 or version 4.

Drush cron's not so quiet --quiet flag

I use drush to execute cron on my Drupal sites. After upgrading drush from version 5 to version 8, I started receiving empty emails from cron each time drush was executed. Checked my cron entries and everything looked fine. Researched a whole bunch on the Internet. Couldn’t find much of anything about empty emails related to drush so I redirected the output to a log. Sure enough, even with the –quiet option, drush cron still outputs a blank line. Why? I’ve no clue.

One-Liners

#Handy One-Liners

This page is a collection of random one-liners I’ve used and wanted to keep track of.

list contents of all crontabs

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

Let's Encypt SSL Certificates with Exim, Dovecot & NGINX

I ran into two issues when setting up Let’s Encrypt SSL certificates on two of my servers - permission issues for Exim and the certbot cron job supplied by the package doesn’t handle the renew very well for nginx, exim or dovecot.

Resolving Exim’s Permission Problems

1. Create a new group. I named it sslcerts. Add the exim user to that group. If you’re not using Debian, adjust the user in the command below.