1. 概要
2026年1月13日に、本記事を書いております。
「FreeBSD 15.0 RELEASE」で、「python311」を「python312」へアップグレードいたしましたので、「certbot」を使おうと思いまして、インストールしなおします。
2. インストール
まず、「py-setuptools」が必要になるのですが・・・。
これが。
/usr/ports/devel/py-setuptools
では、「make」に失敗するので・・・。
pkg install py312-setuptools
でインストールするのですが、「pkg」で多数のプログラムがダウングレードされてしまいます・・・。
ダウングレードされたものをアップグレードしなおします。
これが一番最初。
make deinstall clean
make NO_DIALOG=yes
make install
あらかじめ、下記のものをインストールします。
/usr/ports/security/py-acme
/usr/ports/sysutils/py-distro
各々。
cd ディレクトリ
make deinstall clean
make NO_DIALOG=yes
make install
していくのですが、「make」「make install」時に、依存関係とは別に、「conflict」が発生して、エラーになることがあります。
これは、「make deinstall clean」では、削除されない「pkg」が存在するためで、これらは
pkg delete pyxx-パッケージ名
で、削除していくしかありません。
最終的に。
cd /usr/ports/security/py-certbot
make
make install
で、インストールまで行きます。
インストール時のメッセージを残しておきます。
===> Installing for py312-certbot-4.2.0,1
===> Checking if py312-certbot is already installed
===> Registering installation for py312-certbot-4.2.0,1
Installing py312-certbot-4.2.0,1...
This port installs the "standalone" client only, which does not use and
is not the certbot-auto bootstrap/wrapper script.
The simplest form of usage to obtain certificates is:
# sudo certbot certonly --standalone -d <domain>, [domain2, ... domainN]>
NOTE:
The client requires the ability to bind on TCP port 80 or 443 (depending
on the --preferred-challenges option used). If a server is running on that
port, it will need to be temporarily stopped so that the standalone server
can listen on that port to complete the challenge authentication process.
For more information on the 'standalone' mode, see:
https://certbot.eff.org/docs/using.html#standalone
The certbot plugins to support apache and nginx certificate installation
will be made available in the following ports:
* Apache plugin: security/py-certbot-apache
* Nginx plugin: security/py-certbot-nginx
In order to automatically renew the certificates, add this line to
/etc/periodic.conf:
weekly_certbot_enable="YES"
More config details in the certbot periodic script:
/usr/local/etc/periodic/weekly/500.certbot-3.12
どうやら、「py311-certbot」になっているようで安心しました。
ウィークリーに、実行するスクリプトファイルがあって。
/etc/periodic.conf
を上記のようにいじればよろしいと書いてありますが。
わたしの場合、バーチャルホストも同時に動作させているので、オリジナルのままではあかんのです。
なので、もともと書いてあるスクリプトで動作させます。
そのスクリプトを動作させるには、上記のメッセージに書いてあるように「py-certbot-apache」をいれなければなりません。
cd /usr/ports/security/py-certbot-apache
make deinstall clean
make NO_DIALOG=yes
make install