{"id":1070,"date":"2017-11-04T12:00:00","date_gmt":"2017-11-04T03:00:00","guid":{"rendered":"https:\/\/hi3103.net\/notes\/?p=1070"},"modified":"2022-07-09T23:33:54","modified_gmt":"2022-07-09T14:33:54","slug":"htaccess%e3%81%ab%e3%82%88%e3%82%8bbasic%e8%aa%8d%e8%a8%bc%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/hi3103.net\/notes\/web\/1070","title":{"rendered":".htaccess\u306b\u3088\u308bBasic\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3059\u308b"},"content":{"rendered":"<h4>\u53c2\u8003URL<\/h4>\n<ul>\n<li><a href=\"http:\/\/promamo.com\/?p=2976\">Apache\u3067Basic\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h4>\u624b\u9806<\/h4>\n<h5>.htaccess\u306e\u8a2d\u7f6e<\/h5>\n<pre><code class=\"language-sh\">$ vi .htaccess<\/code><\/pre>\n<pre><code class=\"language-apache\">&lt;Files index.html&gt;\nAuthType basic\n\n#\u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u8868\u793a\u3055\u308c\u308b\u6587\u8a00\nAuthName \"Please enter username and password\"\n\n#ID\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a(\u5834\u6240\u3082\u30d5\u30a1\u30a4\u30eb\u540d\u3082\u4efb\u610f)\nAuthUserFile \/home\/{\u30e6\u30fc\u30b6\u30fc\u540d}\/.htpasswd\n\nRequire valid-user\n&lt;\/Files&gt;<\/code><\/pre>\n<h5>.htpasswd\u306e\u4f5c\u6210<\/h5>\n<ul>\n<li>htpasswd\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\n<ul>\n<li>\u4eca\u56de\u306f .htpasswd \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u4f5c\u6210\u3059\u308b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code class=\"language-sh\">$ htpasswd -c .htpasswd {\u30ed\u30b0\u30a4\u30f3ID}\nNew password: #\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\nRe-type new password: #\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\nAdding password for user {\u30ed\u30b0\u30a4\u30f3ID}<\/code><\/pre>\n<pre><code>Usage:\n    htpasswd [-cimBdpsDv] [-C cost] passwordfile username\n    htpasswd -b[cmBdpsDv] [-C cost] passwordfile username password\n\n    htpasswd -n[imBdps] [-C cost] username\n    htpasswd -nb[mBdps] [-C cost] username password\n -c  Create a new file.\n -n  Don't update file; display results on stdout.\n -b  Use the password from the command line rather than prompting for it.\n -i  Read password from stdin without verification (for script usage).\n -m  Force MD5 encryption of the password (default).\n -B  Force bcrypt encryption of the password (very secure).\n -C  Set the computing time used for the bcrypt algorithm\n     (higher is more secure but slower, default: 5, valid: 4 to 31).\n -d  Force CRYPT encryption of the password (8 chars max, insecure).\n -s  Force SHA encryption of the password (insecure).\n -p  Do not encrypt the password (plaintext, insecure).\n -D  Delete the specified user.\n -v  Verify password for the specified user.\nOn other systems than Windows and NetWare the '-p' flag will probably not work.\nThe SHA algorithm does not use a salt and is less secure than the MD5 algorithm.<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003URL Apache\u3067Basic\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[51,48],"class_list":["post-1070","post","type-post","status-publish","format-standard","hentry","category-web","tag-apache","tag-server"],"_links":{"self":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/comments?post=1070"}],"version-history":[{"count":0,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1070\/revisions"}],"wp:attachment":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/media?parent=1070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/categories?post=1070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/tags?post=1070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}