{"id":1818,"date":"2016-01-18T01:35:50","date_gmt":"2016-01-17T16:35:50","guid":{"rendered":"https:\/\/ecpplus.net\/weblog\/?p=1818"},"modified":"2021-06-07T22:44:44","modified_gmt":"2021-06-07T13:44:44","slug":"caddy-http-server","status":"publish","type":"post","link":"https:\/\/ecpplus.net\/weblog\/caddy-http-server\/","title":{"rendered":"\u304a\u624b\u8efd\u306a HTTP\/2 \u30b5\u30fc\u30d0 caddy"},"content":{"rendered":"<p><a target=\"_blank\" href=\"https:\/\/caddyserver.com\" rel=\"noreferrer noopener\">Caddy<\/a> \u3068\u3044\u3046 web server \u304c\u30c7\u30d5\u30a9\u30eb\u30c8TLS\u3068\u3044\u3046\u30dd\u30ea\u30b7\u30fc\u3067\u3001<a target=\"_blank\" href=\"https:\/\/letsencrypt.org\/\" rel=\"noreferrer noopener\">Let&#8217;s Encrypt<\/a> \u3092\u7c21\u5358\u306b\u8a2d\u5b9a\u51fa\u6765\u3066\u3001\u8a3c\u660e\u66f8\u306e\u81ea\u52d5\u66f4\u65b0\u3092\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u3060\u3063\u305f\u306e\u3067\u4f7f\u3063\u3066\u307f\u305f\u3002Let&#8217;s Encrypt \u306f\u7121\u6599\u3067TLS\u8a3c\u660e\u66f8\u4f7f\u3048\u308b\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002<\/p>\n<h2>Caddy \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p><a href=\"https:\/\/caddyserver.com\/download\"><a href=\"https:\/\/caddyserver.com\/download\">https:\/\/caddyserver.com\/download<\/a><\/a> \u304b\u3089\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3068\u30d0\u30a4\u30ca\u30ea\u304c\u843d\u3061\u3066\u304f\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3059\u3002\u30d0\u30a4\u30ca\u30ea\u751f\u6210\u6642\u306b\u3001Select Features \u3068\u3057\u3066\u3001\u8ffd\u52a0\u6a5f\u80fd\u3092\u5165\u308c\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>Caddy \u306e\u8a2d\u5b9a<\/h2>\n<p><code>\/path\/to\/caddy.conf<\/code><\/p>\n<pre><code>hoge.example.com {\n  tls hoge@example.com\n}<\/code><\/pre>\n<p>\u6700\u5c0f\u69cb\u6210\u3060\u3068\u3001\u30c9\u30e1\u30a4\u30f3\u306b\u5bfe\u3057\u3066\u81ea\u5206\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3057\u305f\u3089\u52d5\u304f\u307f\u305f\u3044\u3067\u3059\u3002<code>ecpplus.net<\/code> \u306e\u30c9\u30e1\u30a4\u30f3\u3060\u3068\u52d5\u3044\u305f\u3051\u308c\u3069\u3001 <code>ecp.plus<\/code> \u306e\u30c9\u30e1\u30a4\u30f3\u3060\u3068\u52d5\u304b\u306a\u304b\u3063\u305f\u3002\u3042\u307e\u308a\u8abf\u3079\u3066\u3044\u306a\u3044\u3051\u308c\u3069\u3001Let&#8217;s Encrypt \u5074\u3067\u4f55\u304b\u3084\u308b\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3002<\/p>\n<h2>Caddy \u306e\u8d77\u52d5<\/h2>\n<p>80, 443 \u30dd\u30fc\u30c8\u3092Listen\u3059\u308b\u306e\u3067\u3001sudo \u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-sh\">sudo caddy --conf \/path\/to\/caddy.conf --agree -email=&quot;hoge@example.com&quot;<\/code><\/pre>\n<p><code>--agree<\/code> \u306f\u3001Agree to Let&#8217;s Encrypt Subscriber Agreement \u3067\u3001<code>-email<\/code>\u306f Default Let&#8217;s Encrypt account email address \u3068\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001 <a href=\"https:\/\/example.com\"><a href=\"https:\/\/example.com\">https:\/\/example.com<\/a><\/a> \u3068\u3057\u3066\u30b5\u30fc\u30d0\u304c\u7acb\u3061\u4e0a\u304c\u308a\u307e\u3059\u3002http \u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3082\u81ea\u52d5\u7684\u306b https \u306b\u9077\u79fb\u3057\u307e\u3059\u3002<\/p>\n<h2>Caddy \u306e\u30b3\u30de\u30f3\u30c9\u5f15\u6570<\/h2>\n<pre><code class=\"language-bash\">$ caddy --help\nUsage of caddy:\n-agree=false: Agree to Let&#039;s Encrypt Subscriber Agreement\n-ca=&quot;https:\/\/acme-v01.api.letsencrypt.org\/directory&quot;: Certificate authority ACME server\n-conf=&quot;&quot;: Configuration file to use (default=Caddyfile)\n-cpu=&quot;100%&quot;: CPU cap\n-email=&quot;&quot;: Default Let&#039;s Encrypt account email address\n-grace=5s: Maximum duration of graceful shutdown\n-host=&quot;&quot;: Default host\n-http2=true: HTTP\/2 support\n-log=&quot;&quot;: Process log file\n-pidfile=&quot;&quot;: Path to write pid file\n-port=&quot;2015&quot;: Default port\n-quiet=false: Quiet mode (no initialization output)\n-revoke=&quot;&quot;: Hostname for which to revoke the certificate\n-root=&quot;.&quot;: Root path to default site\n-version=false: Show version<\/code><\/pre>\n<h3>Caddy \u306e\u6a5f\u80fd<\/h3>\n<p><a href=\"https:\/\/caddyserver.com\/docs\"><a href=\"https:\/\/caddyserver.com\/docs\">https:\/\/caddyserver.com\/docs<\/a><\/a> \u306b\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u6c17\u306b\u306a\u3063\u305f\u6a5f\u80fd<\/p>\n<ul>\n<li><code>markdown<\/code> \u3067\u3001Caddy \u81ea\u4f53\u304c Markdown \u3092 HTML \u306b\u5909\u63db\u3057\u3066\u304f\u308c\u308b\u3002\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u6307\u5b9a\u3082\u3067\u304d\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5165\u3063\u3066\u308b\u306e\u306f\u9762\u767d\u3044\u304b\u3082\u3002<\/li>\n<li><code>git<\/code>\u3067\u3001<code>git push<\/code> \u3067\u81ea\u52d5\u7684\u306b\u30b5\u30a4\u30c8\u66f4\u65b0\u51fa\u6765\u308b\u306e\u3067\u3001<code>markdown<\/code> \u3068\u5408\u308f\u305b\u3066\u304a\u624b\u8efd\u306a\u30b5\u30a4\u30c8\u306b\u4fbf\u5229\u305d\u3046\u3002<\/li>\n<li><code>gzip<\/code> \u306f\u4f7f\u3048\u308b\u307d\u3044\u3067\u3059\u304c\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u7cfb\u306e\u6a5f\u80fd\u306f\u307e\u3060\u306a\u3044\u3063\u307d\u3044\u306e\u3067\uff4d\u73fe\u72b6\u3060\u3068\u5225\u3067\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/li>\n<li><code>fastcgi<\/code> \u3067\u6307\u5b9a\u3059\u308c\u3070\u3001\u88cf\u3067Wordpress\u3068\u304b\u52d5\u304b\u3057\u3066\u3082\u5927\u4e08\u592b\u305d\u3046\u3067\u3059\u3002<\/li>\n<li><code>proxy<\/code> \u3067\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u306e\u8a2d\u5b9a\u3082\u3067\u304d\u308b\u306e\u3067\u3001Rails \u3068\u304b\u88cf\u306b\u304a\u3044\u3066\u3082\u5927\u4e08\u592b\u305d\u3046\u3067\u3059\u3002<\/li>\n<li><code>websocket<\/code> \u3067\u3001WebSocket \u306e\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u304c\u5f35\u3089\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u304c\u6307\u5b9a\u3067\u304d\u308b\u3002<\/li>\n<li><code>startup<\/code>, <code>shutdown<\/code> \u3067\u3001\u8d77\u52d5\u30fb\u505c\u6b62\u6642\u306b\u4efb\u610f\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3067\u304d\u308b\u3002\u4f8b\u3048\u3070 Rails \u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u3092\u7acb\u3061\u4e0a\u3052\u308b\u3068\u304b\u3002<br \/>\n\u5b89\u3044TLS\u8a3c\u660e\u66f8\u4f7f\u3063\u3066\u305f\u3051\u3069\u3001\u5931\u52b9\u3057\u305f\u3089\u4e57\u308a\u63db\u3048\u3066\u3082\u826f\u3044\u304b\u3082\u3068\u3044\u3046\u611f\u3058\u304c\u3057\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u3068\u3044\u3046 web server \u304c\u30c7\u30d5\u30a9\u30eb\u30c8TLS\u3068\u3044\u3046\u30dd\u30ea\u30b7\u30fc\u3067\u3001 \u3092\u7c21\u5358\u306b\u8a2d\u5b9a\u51fa\u6765\u3066\u3001\u8a3c\u660e\u66f8\u306e\u81ea\u52d5\u66f4\u65b0\u3092\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u3060\u3063\u305f\u306e\u3067\u4f7f\u3063\u3066\u307f\u305f\u3002Let&#8217;s Encrypt \u306f\u7121\u6599\u3067TLS\u8a3c\u660e\u66f8\u4f7f\u3048\u308b\u30b5\u30fc\u30d3\u30b9\u3067\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[7],"class_list":["post-1818","post","type-post","status-publish","format-standard","hentry","category-development","tag-linux"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/1818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/comments?post=1818"}],"version-history":[{"count":2,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/1818\/revisions"}],"predecessor-version":[{"id":3837,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/1818\/revisions\/3837"}],"wp:attachment":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media?parent=1818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/categories?post=1818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/tags?post=1818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}