0
0

More than 1 year has passed since last update.

Xserver VPSでhttps化【SSL化】

Posted at

certbotのインストール

# Ubuntu/Debian系
sudo apt install -y certbot

# CentOS/AlmaLinux/RockyLinux系
sudo dnf install -y certbot

証明書の取得

独自ドメインを使用する場合は、AレコードにVPSのIPアドレスを設定し、$HOSTNAME.static.xvps.ne.jpを独自ドメインに置き換えてください

# XAMPPを使用する場合
sudo certbot certonly --webroot -w /opt/lampp/htdocs --register-unsafely-without-email --agree-tos --non-interactive -d $HOSTNAME.static.xvps.ne.jp

# XAMPPを使用しない場合
sudo certbot certonly --standalone --register-unsafely-without-email --agree-tos --non-interactive -d $HOSTNAME.static.xvps.ne.jp

証明書を設置し、Apacheを再起動

sudo cp /etc/letsencrypt/live/$HOSTNAME.static.xvps.ne.jp/fullchain.pem /opt/lampp/etc/ssl.crt/server.crt
sudo cp /etc/letsencrypt/live/$HOSTNAME.static.xvps.ne.jp/privkey.pem /opt/lampp/etc/ssl.key/server.key
sudo /opt/lampp/lampp reloadapache

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0