{"id":851,"date":"2014-08-21T23:25:33","date_gmt":"2014-08-21T14:25:33","guid":{"rendered":"http:\/\/tech.akat.info\/?p=851"},"modified":"2014-09-16T01:12:23","modified_gmt":"2014-09-15T16:12:23","slug":"%e3%80%90apache%e3%80%91digest%e3%83%bbbasic%e8%aa%8d%e8%a8%bc","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=851","title":{"rendered":"\u3010apache\u3011Basic\u30fbDigest\u8a8d\u8a3c"},"content":{"rendered":"<h1>\u6982\u8981<\/h1>\n<p>Basic\u8a8d\u8a3c\u3060\u3068\u30e6\u30fc\u30b6\u30fc\u540d\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5e73\u6587\u3067\u6d41\u308c\u308b<br \/>\nDigest\u8a8d\u8a3c\u3060\u3068\u30e6\u30fc\u30b6\u30fc\u540d\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u6697\u53f7\u5316\u3055\u308c\u308b\u305f\u3081\u591a\u5c11\u30de\u30b7<\/p>\n<h1>Basic\u8a8d\u8a3c<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n## \u8a8d\u8a3c\u306b\u5fc5\u8981\u306aapache\u30e2\u30b8\u30e5\u30fc\u30eb\u8aad\u307f\u8fbc\u307f ##\r\nroot@hostname:\/etc\/apache2# a2enmod auth_basic authn_file\r\nModule auth_basic already enabled\r\nModule authn_file already enabled\r\n\r\n## \u30b5\u30a4\u30c8\u306e\u8a2d\u5b9a\u5909\u66f4 ##\r\nroot@hostname:\/home\/shimizu# vi \/etc\/apache2\/sites-enabled\/000-default\r\n=\u4ee5\u4e0b\u3092\u8ffd\u8a18=\r\n&lt;Location \/wp-admin&gt;\r\n        AuthType Basic\r\n        AuthName &quot;secret&quot;\r\n        AuthUserFile \/etc\/apache2\/.htpasswd\r\n        Require valid-user\r\n&lt;\/Location&gt;\r\n===========\r\n\r\n## Digest\u8a8d\u8a3c\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210 ##\r\n## htpasswd \u30aa\u30d7\u30b7\u30e7\u30f3(&quot;-c&quot; \u3092\u4ed8\u3051\u308b\u3068\u305d\u306e\u6b21\u306e\u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3059\u308b\u3001\u3064\u3051\u306a\u3051\u308c\u3070\u8ffd\u52a0\u3059\u308b) \u30d1\u30b9\u30ef\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb\u540d \u30e6\u30fc\u30b6\u30fc\u540d\r\nroot@hostname:\/etc\/apache2# htpasswd -c .htpasswd user\r\nNew password:\r\nRe-type new password:\r\nAdding password for user user\r\nroot@hostname:\/etc\/apache2# cat .htpasswd\r\nuser:$apr1$As7TC2oV$sbI625W54uEVH0woDGHgZ.\r\n\r\n## apache\u306e\u518d\u8d77\u52d5 ##\r\nroot@hostname:\/home\/shimizu# apache2ctl configtest\r\nSyntax OK \r\nroot@hostname:\/etc\/apache2# \/etc\/init.d\/apache2 reload\r\n&#x5B; ok ] Reloading web server config: apache2.\r\n<\/pre>\n<h1>Digest\u8a8d\u8a3c<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n## \u8a8d\u8a3c\u306b\u5fc5\u8981\u306aapache\u30e2\u30b8\u30e5\u30fc\u30eb\u8aad\u307f\u8fbc\u307f ##\r\nroot@hostname:\/home\/shimizu# a2enmod auth_digest authz_owner authz_user authn_file\r\nEnabling module auth_digest.\r\nEnabling module authz_owner.\r\nModule authz_user already enabled\r\nModule authn_file already enabled\r\nTo activate the new configuration, you need to run:\r\n  service apache2 restart\r\n\r\n## \u30b5\u30a4\u30c8\u306e\u8a2d\u5b9a\u5909\u66f4 ##\r\nroot@hostname:\/home\/shimizu# vi \/etc\/apache2\/sites-enabled\/000-default\r\n=\u4ee5\u4e0b\u3092\u8ffd\u8a18=\r\n&lt;Location \/wp-admin&gt;\r\n        AuthType Digest\r\n        AuthName &quot;secret&quot;\r\n        AuthUserFile \/etc\/apache2\/.htdigest\r\n        Require valid-user\r\n&lt;\/Location&gt;\r\n===========\r\n\r\n## Digest\u8a8d\u8a3c\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210 ##\r\n## htdigest \u30aa\u30d7\u30b7\u30e7\u30f3(&quot;-c&quot; \u3092\u4ed8\u3051\u308b\u3068\u305d\u306e\u6b21\u306e\u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3059\u308b\u3001\u3064\u3051\u306a\u3051\u308c\u3070\u8ffd\u52a0\u3059\u308b) \u30d1\u30b9\u30ef\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb\u540d \u9818\u57df\u540d \u30e6\u30fc\u30b6\u30fc\u540d\r\nroot@hostname:\/etc\/apache2# htdigest -c .htdigest 'secret' user\r\nAdding password for user in realm secret.\r\nNew password:\r\nRe-type new password:\r\nroot@hostname:\/etc\/apache2# cat .htdigest\r\nuser:secret:9d5a877dbb653780fd6715e1cd96c61a\r\n\r\n## apache\u306e\u518d\u8d77\u52d5 ##\r\nroot@hostname:\/home\/shimizu# apache2ctl configtest\r\nSyntax OK \r\nroot@hostname:\/etc\/apache2# \/etc\/init.d\/apache2 reload\r\n&#x5B; ok ] Reloading web server config: apache2.\r\n<\/pre>\n<h1>\u53c2\u8003URL<\/h1>\n<p>\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb<br \/>\nhttp:\/\/blog.h2o-feeling.com\/?p=249<br \/>\n\u6982\u8981\u3068\u8a2d\u5b9a<br \/>\nhttp:\/\/fun4life.jpn.ph\/diary\/2012\/07\/18\/wordpress-%E3%81%ABdigest-%E8%AA%8D%E8%A8%BC-%E4%BD%BF%E3%81%86\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 Basic\u8a8d\u8a3c\u3060\u3068\u30e6\u30fc\u30b6\u30fc\u540d\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5e73\u6587\u3067\u6d41\u308c\u308b Digest\u8a8d\u8a3c\u3060\u3068\u30e6\u30fc\u30b6\u30fc\u540d\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u6697\u53f7\u5316\u3055\u308c\u308b\u305f\u3081\u591a\u5c11\u30de\u30b7 Basic\u8a8d\u8a3c ## \u8a8d\u8a3c\u306b\u5fc5\u8981\u306aapache\u30e2\u30b8\u30e5\u30fc\u30eb\u8aad\u307f\u8fbc\u307f ## root@hos [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/851"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=851"}],"version-history":[{"count":4,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/851\/revisions"}],"predecessor-version":[{"id":855,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/851\/revisions\/855"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}