LoginSignup
0
1

More than 1 year has passed since last update.

Google Compute EngineのWordpressをHTTPS化する

Posted at

CertbotでSSL証明書を作る

sudo apt install certbot python3-certbot-apache

必要なプログラムをaptでインストール。

sudo certbot --apache

certbotを起動。質問に答えるだけでSSL証明書を作ってくれる。

Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):

メールアドレスとドメインを聞かれるので入力する。

Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory

規約に同意する。

Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.

「お知らせメールを送ってもいいですか?」→どっちでもいいです。

No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter 'c' to cancel):

ドメインを入力する。

We were unable to find a vhost with a ServerName or Address of 403world.net.
Which virtual host would you like to choose?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: 000-default.conf | | | Enabled
2: wordpress-https.conf | | HTTPS | Enabled
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):

どのconfファイルに仮想ホストの設定を書き込むか。とりあえず「2」を選んだ。

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. > You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):

HTTPアクセスをHTTPSに自動リダイレクトするか。「2」を選択。

これで完了。

Wordpressの設定変更

phpmyadminで、wp_optionssiteurlhomeを手で書き換える。(もっといい方法ないものかなあ)

adminのパスワードを忘れた

デプロイメントマネージャ見て。

0
1
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
1