Closed9

HugoとCloudflare Pagesで静的ホスティング環境準備

めっぱんだめっぱんだ

https://zenn.dev/catnose99/scraps/6780379210136f
この記事見たようだとCloudflare Pagesが良さそうということで物は試しと登録まで。
静的サイトジェネレータ配置+ドメイン取得(meppanda.com)までで試してみる。ドメイン取得は自分への誕生日祝い。

構築要件

  • hugoで個人サイト構築まで
  • CloudFlare新規登録から公開までの手順をここに載せる
  • CloudFlarePagesへのデプロイ(github連携)、ドメイン取得まで

公式サイト

めっぱんだめっぱんだ

購入後のwhois。個人情報はない(はず。千葉県民なの以外。)

panda-telecoms@iMac ~ % whois meppanda.com
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

refer:        whois.verisign-grs.com

domain:       COM

organisation: VeriSign Global Registry Services
address:      12061 Bluemont Way
address:      Reston VA 20190
address:      United States of America (the)

contact:      administrative
name:         Registry Customer Service
organisation: VeriSign Global Registry Services
address:      12061 Bluemont Way
address:      Reston VA 20190
address:      United States of America (the)
phone:        +1 703 925-6999
fax-no:       +1 703 948 3978
e-mail:       info@verisign-grs.com

contact:      technical
name:         Registry Customer Service
organisation: VeriSign Global Registry Services
address:      12061 Bluemont Way
address:      Reston VA 20190
address:      United States of America (the)
phone:        +1 703 925-6999
fax-no:       +1 703 948 3978
e-mail:       info@verisign-grs.com

nserver:      A.GTLD-SERVERS.NET 192.5.6.30 2001:503:a83e:0:0:0:2:30
nserver:      B.GTLD-SERVERS.NET 192.33.14.30 2001:503:231d:0:0:0:2:30
nserver:      C.GTLD-SERVERS.NET 192.26.92.30 2001:503:83eb:0:0:0:0:30
nserver:      D.GTLD-SERVERS.NET 192.31.80.30 2001:500:856e:0:0:0:0:30
nserver:      E.GTLD-SERVERS.NET 192.12.94.30 2001:502:1ca1:0:0:0:0:30
nserver:      F.GTLD-SERVERS.NET 192.35.51.30 2001:503:d414:0:0:0:0:30
nserver:      G.GTLD-SERVERS.NET 192.42.93.30 2001:503:eea3:0:0:0:0:30
nserver:      H.GTLD-SERVERS.NET 192.54.112.30 2001:502:8cc:0:0:0:0:30
nserver:      I.GTLD-SERVERS.NET 192.43.172.30 2001:503:39c1:0:0:0:0:30
nserver:      J.GTLD-SERVERS.NET 192.48.79.30 2001:502:7094:0:0:0:0:30
nserver:      K.GTLD-SERVERS.NET 192.52.178.30 2001:503:d2d:0:0:0:0:30
nserver:      L.GTLD-SERVERS.NET 192.41.162.30 2001:500:d937:0:0:0:0:30
nserver:      M.GTLD-SERVERS.NET 192.55.83.30 2001:501:b1f9:0:0:0:0:30
ds-rdata:     19718 13 2 8acbb0cd28f41250a80a491389424d341522d946b0da0c0291f2d3d771d7805a

whois:        whois.verisign-grs.com

status:       ACTIVE
remarks:      Registration information: http://www.verisigninc.com

created:      1985-01-01
changed:      2023-12-07
source:       IANA

# whois.verisign-grs.com

  Domain Name: MEPPANDA.COM
  Registry Domain ID: 2877317361_DOMAIN_COM-VRSN
  Registrar WHOIS Server: whois.cloudflare.com
  Registrar URL: http://www.cloudflare.com
  Updated Date: 2024-05-01T06:52:48Z
  Creation Date: 2024-05-01T06:52:45Z
  Registry Expiry Date: 2025-05-01T06:52:45Z
  Registrar: CloudFlare, Inc.
  Registrar IANA ID: 1910
  Registrar Abuse Contact Email:
  Registrar Abuse Contact Phone:
  Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
  Name Server: CAMERON.NS.CLOUDFLARE.COM
  Name Server: TESSA.NS.CLOUDFLARE.COM
  DNSSEC: unsigned
  URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of whois database: 2024-05-01T06:52:55Z <<<

# whois.cloudflare.com

Domain Name: MEPPANDA.COM
Registry Domain ID: 2877317361_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.cloudflare.com
Registrar URL: https://www.cloudflare.com
Updated Date: 2024-05-01T06:52:48Z
Creation Date: 2024-05-01T06:52:45Z
Registrar Registration Expiration Date: 2025-05-01T06:52:45Z
Registrar: Cloudflare, Inc.
Registrar IANA ID: 1910
Domain Status: clienttransferprohibited https://icann.org/epp#clienttransferprohibited
Domain Status: addperiod https://icann.org/epp#addperiod
Registry Registrant ID:
Registrant Name: DATA REDACTED
Registrant Organization: DATA REDACTED
Registrant Street: DATA REDACTED
Registrant City: DATA REDACTED
Registrant State/Province: Chiba-pref
Registrant Postal Code: DATA REDACTED
Registrant Country: JP
Registrant Phone: DATA REDACTED
Registrant Phone Ext: DATA REDACTED
Registrant Fax: DATA REDACTED
Registrant Fax Ext: DATA REDACTED
Registrant Email: https://domaincontact.cloudflareregistrar.com/meppanda.com
Registry Admin ID:
Admin Name: DATA REDACTED
Admin Organization: DATA REDACTED
Admin Street: DATA REDACTED
Admin City: DATA REDACTED
Admin State/Province: DATA REDACTED
Admin Postal Code: DATA REDACTED
Admin Country: DATA REDACTED
Admin Phone: DATA REDACTED
Admin Phone Ext: DATA REDACTED
Admin Fax: DATA REDACTED
Admin Fax Ext: DATA REDACTED
Admin Email: https://domaincontact.cloudflareregistrar.com/meppanda.com
Registry Tech ID:
Tech Name: DATA REDACTED
Tech Organization: DATA REDACTED
Tech Street: DATA REDACTED
Tech City: DATA REDACTED
Tech State/Province: DATA REDACTED
Tech Postal Code: DATA REDACTED
Tech Country: DATA REDACTED
Tech Phone: DATA REDACTED
Tech Phone Ext: DATA REDACTED
Tech Fax: DATA REDACTED
Tech Fax Ext: DATA REDACTED
Tech Email: https://domaincontact.cloudflareregistrar.com/meppanda.com
Registry Billing ID:
Billing Name: DATA REDACTED
Billing Organization: DATA REDACTED
Billing Street: DATA REDACTED
Billing City: DATA REDACTED
Billing State/Province: DATA REDACTED
Billing Postal Code: DATA REDACTED
Billing Country: DATA REDACTED
Billing Phone: DATA REDACTED
Billing Phone Ext: DATA REDACTED
Billing Fax: DATA REDACTED
Billing Fax Ext: DATA REDACTED
Billing Email: https://domaincontact.cloudflareregistrar.com/meppanda.com
Name Server: cameron.ns.cloudflare.com
Name Server: tessa.ns.cloudflare.com
DNSSEC: unsigned
Registrar Abuse Contact Email: registrar-abuse@cloudflare.com
Registrar Abuse Contact Phone: +1.4153197517
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: 2024-05-01T06:53:11Z <<<

panda-telecoms@iMac ~ %
めっぱんだめっぱんだ

最後にドメインとpagesの紐付けをしたい。
ダッシュボードからカスタムドメインを設定する > カスタムドメインを設定をクリックし、作ったドメインを入力、ドメインをアクティブにするを選択してCNAMEレコードを作成。
しばらくすると作ったドメインに作ったサイトが表示される(meppanda.com)




めっぱんだめっぱんだ

感想:
S3+CloudFrontより早く、細かい設定抜きでWAFが使えるホスティング環境が作れるのいいなーと思った
(全くの未経験ながらCloudFlare+Hugoテストデプロイをこの記事書きながらで1h弱)
もちろんS3と守備範囲は異なるので比較は野暮だと思うが個人サイト運営であれば必要条件は十分揃うのではと思った。

このスクラップは2024/05/01にクローズされました