{"id":255,"date":"2023-01-27T23:09:22","date_gmt":"2023-01-27T14:09:22","guid":{"rendered":"https:\/\/origin.intinfinity.com\/?p=255"},"modified":"2023-02-11T18:09:13","modified_gmt":"2023-02-11T09:09:13","slug":"certbot-lets-encrypt-%e3%81%a7-%e8%a8%bc%e6%98%8e%e6%9b%b8%e6%9b%b4%e6%96%b0%e3%81%ae%e5%89%8d%e5%be%8c%e3%81%ab%e5%87%a6%e7%90%86%e3%82%92%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/intinfinity.com\/index.php\/archives\/255","title":{"rendered":"certbot (Let&#8217;s Encrypt) \u3067 \u8a3c\u660e\u66f8\u66f4\u65b0\u306e\u524d\u5f8c\u306b\u51e6\u7406\u3092\u3059\u308b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u80cc\u666f<\/h2>\n\n\n\n<p>TLS\u8a3c\u660e\u66f8\u306bLet's Encrypt \u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5b9f\u88c5\u3067\u3042\u308bcertbot\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002<br>certbot\u3067\u306fHTTP-01\u30c1\u30e3\u30ec\u30f3\u30b8\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3002<br>\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u305f\u3044\u30c9\u30e1\u30a4\u30f3\u306e80\/tcp\u304c\u5229\u7528\u3067\u304d\u308c\u3070\u767a\u884c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/intinfinity.com\/index.php\/archives\/223\" data-type=\"URL\" data-id=\"https:\/\/intinfinity.com\/index.php\/archives\/223\" target=\"_blank\" rel=\"noreferrer noopener\">\u67d0\u30b5\u30fc\u30d0\u30fc<\/a>\u306b\u304a\u3044\u3066\u3001\u666e\u6bb5\u306f80\/tcp\u3092\u4f7f\u7528\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u30d5\u30a1\u30a4\u30a2\u30fc\u30a6\u30a9\u30fc\u30eb\u3092\u9589\u3058\u3066\u3044\u308b\u304c\u3001\u4f7f\u7528\u3059\u308b\u6642\u3060\u305180\/tcp\u3092\u8a31\u53ef\u3059\u308b\u3002<\/p>\n\n\n\n<p>Let's Encrypt \u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u3057\u3066 certbot\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002<br>certbot \u306e pre-hook \u3068 post-hook \u3067\u30d5\u30a1\u30a4\u30a2\u30fc\u30a6\u30a9\u30fc\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u306a\u304a\u3001\u8a3c\u660e\u66f8\u66f4\u65b0\u3057\u305f\u5f8c\u306b\u30b5\u30fc\u30d3\u30b9\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3044\u3046\u52d5\u4f5c\u3082\u3053\u308c\u3092\u5fdc\u7528\u3057\u3066\u5b9f\u73fe\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u8a3c\u660e\u66f8\u3092\u66f4\u65b0\u3057\u305f\u969b\u3001Nextcloud\u306b\u901a\u77e5\u3092\u9001\u308b\u5b9f\u88c5\u3092\u884c\u3046\u3002\u4e88\u3081<a rel=\"noreferrer noopener\" href=\"https:\/\/intinfinity.com\/?p=265\" data-type=\"post\" data-id=\"265\" target=\"_blank\">OS\u306e\u901a\u77e5\u3092Nextcloud\u306b\u9001\u308b<\/a>\u304c\u5fc5\u8981\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u88c5<\/h2>\n\n\n\n<p>\u305d\u308c\u305e\u308c\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/letsencrypt\/renewal-hooks\/pre\/ufw.sh<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nufw allow 80\/tcp<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/letsencrypt\/renewal-hooks\/post\/ufw.sh<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nufw delete allow 80\/tcp<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/letsencrypt\/renewal-hooks\/deploy\/notification_nextcloud.sh<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\/root\/sh\/nextcloud_notification.sh \"certbot renewed $RENEWED_DOMAINS\"<\/code><\/pre>\n\n\n\n<p>\u305d\u308c\u305e\u308c\u306b\u5b9f\u884c\u6a29\u9650\u3092\u4e0e\u3048\u308b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod +x \/etc\/letsencrypt\/renewal-hooks\/pre\/ufw.sh\nsudo chmod +x \/etc\/letsencrypt\/renewal-hooks\/post\/ufw.sh\nsudo chmod +x \/etc\/letsencrypt\/renewal-hooks\/deploy\/notification_nextcloud.sh<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u78ba\u8a8d<\/h2>\n\n\n\n<p>\u52d5\u4f5c\u306f\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo certbot renew --dry-run<\/code><\/pre>\n\n\n\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u3042\u308c\u3070\u3001\u30d5\u30a1\u30a4\u30a2\u30fc\u30a6\u30a9\u30fc\u30eb\u306f\u958b\u3044\u3066\u9589\u3058\u308b\u3068\u3044\u3046\u52d5\u4f5c\u3092\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nHook 'pre-hook' ran with output:\n Rule added\n Rule added (v6)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nHook 'post-hook' ran with output:\n Rule deleted\n Rule deleted (v6)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f TLS\u8a3c\u660e\u66f8\u306bLet&#8217;s Encrypt \u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5b9f\u88c5\u3067\u3042\u308bcertbot\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002certbot\u3067\u306fHTTP-01\u30c1\u30e3\u30ec\u30f3\u30b8\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3002\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u305f\u3044\u30c9\u30e1\u30a4\u30f3\u306e80\/tcp\u304c\u5229\u7528\u3067\u304d\u308c\u3070\u767a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,5],"tags":[],"class_list":["post-255","post","type-post","status-publish","format-standard","hentry","category-linux","category-server-application"],"_links":{"self":[{"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":7,"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":301,"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/posts\/255\/revisions\/301"}],"wp:attachment":[{"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/intinfinity.com\/index.php\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}