== certbot == [[https://josh-weatherly.com/2018/08/freebsd-ssl-apache-lets-encrypt-certbot/]] [[https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-freebsd-12-0]] ====== Apache with Let's Encrypt ====== pkg install -y py39-certbot py39-certbot-apache echo 'weekly_certbot_enable="YES"' >> /etc/periodic.conf echo "LoadModule ssl_module libexec/apache24/mod_ssl.so" >> /usr/local/etc/apache24/Includes/httpd.conf echo "LoadModule rewrite_module libexec/apache24/mod_rewrite.so" >> /usr/local/etc/apache24/Includes/httpd.conf ee /usr/local/etc/apache24/Includes/your_domain.com.conf # ServerAdmin your_email@your_domain.com DocumentRoot "/usr/local/www/apache24/data/" ServerName your_domain.com # ServerAlias www.your_domain.com ScriptAlias /cgi-bin/ "/usr/local/www/apache24/cgi-bin/" DirectoryIndex index.html service apache24 restart certbot --apache -d your-domain -d www.your-domain certbot renew --dry-run certbot certificates Saving debug log to /var/log/letsencrypt/letsencrypt.log - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Found the following certs: Certificate Name: my.example.ua Serial Number: 3d3578a221edc86906c4eeee76bdefeed23 Key Type: RSA Domains: my.example.ua Expiry Date: 2022-04-30 22:19:36+00:00 (VALID: 89 days) Certificate Path: /usr/local/etc/letsencrypt/live/my.example.ua/fullchain.pem Private Key Path: /usr/local/etc/letsencrypt/live/my.example.ua/privkey.pem - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - certbot certificates -d my.example.ua For Zabbix monitoring on FreeBSD [[https://github.com/lightvik/zabbix-templates/blob/master/LE-certificates-information/le-certificates.sh]] certbot certificates | grep Certificate\ Name | awk '{ print $3 }' ===== fix ===== if error with shared library freebsd-version -uk freebsd-upgrade fetch freebsd-upgrade install shutdown -r now freebsd-upgrade install if error in python curl https://sh.rustup.rs -sSf | sh make symlinks from $HOME/.cargo/bin to /usr/local/bin or export CRYPTOGRAPHY_DONT_BUILD_RUST=1 pip install --upgrade cryptography pip install --upgrade pyOpenSSL > 22.1 pip install --upgrade pip pyOpenSSL cryptography certbot certificates