{"id":350,"date":"2017-07-01T16:28:53","date_gmt":"2017-07-01T07:28:53","guid":{"rendered":"https:\/\/pc-taskal.net\/howto\/?p=350"},"modified":"2020-04-30T18:29:01","modified_gmt":"2020-04-30T09:29:01","slug":"apache24-mod-authz-host","status":"publish","type":"post","link":"https:\/\/pc-taskal.net\/howto\/blog\/apache24-mod-authz-host","title":{"rendered":"Apache\u306e Order Allow,Deny\u306f\u3082\u3046\u53e4\u3044"},"content":{"rendered":"<p>Web\u30b5\u30fc\u30d0\u306eApache\u3067\u3059\u304c\u30012.4\u304b\u3089\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u66f8\u304d\u65b9\u304c\u5909\u308f\u3063\u3066\u3044\u305f\u3093\u3067\u3059\u306d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-410\" src=\"https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/network-cable-ethernet-computer-159304.jpeg\" alt=\"\" width=\"640\" height=\"426\" srcset=\"https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/network-cable-ethernet-computer-159304.jpeg 640w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/network-cable-ethernet-computer-159304-320x213.jpeg 320w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/network-cable-ethernet-computer-159304-530x353.jpeg 530w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/network-cable-ethernet-computer-159304-565x376.jpeg 565w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u30a2\u30d1\u30c3\u30c1\u306e\u30b5\u30fc\u30d0\u3092\u3044\u3058\u3063\u305f\u3053\u3068\u306e\u3042\u308b\u4eba\u306a\u3089\u4e00\u56de\u306f\u76ee\u306b\u3057\u305f\u3053\u3068\u304c\u308b\u3068\u601d\u308f\u308c\u308b\u3053\u306e\u66f8\u304d\u65b9<\/p>\n<pre class=\"lang:default decode:true\">Order Allow,Deny\r\nAllow from All<\/pre>\n<p>\u53e4\u3044\u30a2\u30af\u30bb\u30b9\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u3001 mod_access_compat \u306b\u5165\u3063\u3066\u65b0\u898f\u306b mod_authz_host \u306b\u5909\u308f\u3063\u305f\u3068\u304b\u3002<\/p>\n<p>2.4\u306b\u306a\u3063\u3066\u3082\u00a0 mod_access_compat\u00a0\u304c\u5165\u3063\u3066\u3044\u308c\u3070\u4eca\u307e\u3067\u3068\u540c\u3058\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u3082\u306f\u3084\u6642\u4ee3\u306f\u5909\u308f\u3063\u3066\u30e2\u30c0\u30f3\u306a\u66f8\u304d\u65b9\u306b\u5909\u66f4\u3057\u3066\u3044\u3063\u305f\u307b\u3046\u304c\u3044\u3044\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306b\u899a\u3048\u308b\u306e\u304c\u96e3\u3057\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u304b\u3089\u306f\u3001\u57fa\u672c\u304c\u5168\u3066\u62d2\u5426\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u8a31\u53ef\u306e\u9805\u76ee\u3092\u5165\u308c\u3066\u3044\u304f\u3068\u3044\u3046\u30b9\u30bf\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/howto\/access.html\" target=\"_blank\" rel=\"noopener noreferrer\" data-blogcard=\"1\">Apache2.4 Access Control<\/a><\/p>\n<p>\u307e\u3060\u7ffb\u8a33\u3055\u308c\u3066\u307e\u305b\u3093\u3002<\/p>\n<h2>Order Allow,Deny\u306f<\/h2>\n<p>\u3044\u307e\u307e\u3067<\/p>\n<pre class=\"lang:default decode:true\">Order Allow,Deny\r\nAllow from All<\/pre>\n<p>2.4\u3067\u306f<\/p>\n<pre class=\"lang:default decode:true \">Require all granted<\/pre>\n<p>\u3053\u308c\u3060\u3051\u3067\u5168\u3066\u306e\u30a2\u30af\u30bb\u30b9\u304cOK\u3002<\/p>\n<h2>\u7279\u5b9a\u306eIP\u3084\u30db\u30b9\u30c8\u3092\u62d2\u5426\u3059\u308b<\/h2>\n<p>\u3044\u307e\u307e\u3067<\/p>\n<pre class=\"lang:default decode:true\">Order Allow,Deny\r\nAllow from All\r\nDeny from 169.254.123.123\r\nDeny from 169.254.321\r\nDeny from example.com<\/pre>\n<p>2.4\u3067\u306f\u300cRequireAll\u300d\u3092\u4f7f\u3063\u3066\u304f\u304f\u3063\u3066\u5168\u3066\u8a31\u53ef\u3057\u305f\u4e0a\u3067 \u300cnot\u300d\u3067\u62d2\u5426\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">&lt;RequireAll&gt;\r\n    Require all granted\r\n    Require not ip 169.254.123.123\r\n    Require not ip 169.254.321\r\n    Require not host example.com\r\n&lt;\/RequireAll&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<!-- pctaskal-req --><br \/>\n<ins class=\"adsbygoogle\" style=\"display: inline-block; width: 336px; height: 280px;\" data-ad-client=\"ca-pub-9013483608213524\" data-ad-slot=\"5284676934\"><\/ins><br \/>\n<script>\n(adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<h2>\u74b0\u5883\u5909\u6570\u3092\u4f7f\u3063\u3066\u7279\u5b9a\u306e\u8a31\u53ef\u3092\u3059\u308b<\/h2>\n<p>\u3042\u307e\u308a\u4f7f\u3044\u307e\u305b\u3093\u304c\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u306e\u307f\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p>\u3044\u307e\u307e\u3067<\/p>\n<pre class=\"lang:default decode:true \">SetEnvIf User-Agent \"Wget\" ok_env\r\nSetEnvIf User-Agent \"Google\" ok_env\r\nOrder Deny,Allow\r\nDeny from All\r\nAllow from ok_env\r\nAllow from 169.254.0.0\/16\r\nAllow from example.com<\/pre>\n<p>2.4\u3067\u306f<\/p>\n<pre class=\"lang:default decode:true\">SetEnvIf User-Agent \"Wget\" ok_env\r\nSetEnvIf User-Agent \"Google\" ok_env\r\nrequire env ok_env\r\nrequire ip 169.254.0.0\/16\r\nrequire host example.com<\/pre>\n<p>\u8a31\u53ef\u306e\u9805\u76ee\u3092\u5165\u308c\u3066\u3044\u304f\u3060\u3051\u306a\u306e\u3067\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u74b0\u5883\u5909\u6570\u3092\u4f7f\u3063\u3066\u7279\u5b9a\u306e\u62d2\u5426\u3092\u3059\u308b<\/h2>\n<p>\u74b0\u5883\u5909\u6570\u3092\u5165\u308c\u3066\u5168\u3066\u8a31\u53ef\u3057\u305f\u4e0a\u3067\u62d2\u5426\u306e\u9805\u76ee\u3092\u5165\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">SetEnvIf User-Agent \"Wget\" x_env\r\nSetEnvIf User-Agent \"Google\" x_env\r\n&lt;RequireAll&gt;\r\n\tRequire all granted\r\n\tRequire not ip 169.254.123.123\r\n\tRequire not ip 169.254.321\r\n\tRequire not host example.com\r\n\tRequire not host .cn\r\n\tRequire not env x_env\r\n\tRequire not ip 169.254.222.0\/24\r\n\tRequire not method POST\r\n&lt;\/RequireAll&gt;<\/pre>\n<h2>\u30ed\u30fc\u30ab\u30eb\u30db\u30b9\u30c8\u3060\u3051\u8a31\u53ef\u3059\u308b<\/h2>\n<p>127.0.0.0\/8 \u3068 ::1 \u306e\u307f\u30a2\u30af\u30bb\u30b9\u8a31\u53ef<\/p>\n<pre class=\"lang:default decode:true \">Require local<\/pre>\n<h2>\u7279\u5b9a\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u307f\u62d2\u5426\u3059\u308b<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u306a\u5185\u5bb9\u304c\u66f8\u3044\u3066\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u3001\u7279\u5b9a\u306e\u62e1\u5f35\u5b50\u3092\u62d2\u5426\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">Require all granted\r\n&lt;Files ~ \"\\.(sql|log|dat|sqlite)$\"&gt;\r\n  Require all denied\r\n&lt;\/Files&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u30b5\u30fc\u30d0\u306eApache\u3067\u3059\u304c\u30012.4\u304b\u3089\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u66f8\u304d\u65b9\u304c\u5909\u308f\u3063\u3066\u3044\u305f\u3093\u3067\u3059\u306d\u3002 \u30a2\u30d1\u30c3\u30c1\u306e\u30b5\u30fc\u30d0\u3092\u3044\u3058\u3063\u305f\u3053\u3068\u306e\u3042\u308b\u4eba\u306a\u3089\u4e00\u56de\u306f\u76ee\u306b\u3057\u305f\u3053\u3068\u304c\u308b\u3068\u601d\u308f\u308c\u308b\u3053\u306e\u66f8\u304d\u65b9 Order Allow,Deny Allo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":410,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,37],"tags":[67,51,52,68],"class_list":["post-350","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-server","category-blog","tag-apache","tag-debian","tag-linux","tag-server"],"_links":{"self":[{"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/posts\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":0,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/media\/410"}],"wp:attachment":[{"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}