{"id":237,"date":"2016-09-30T23:06:20","date_gmt":"2016-09-30T14:06:20","guid":{"rendered":"http:\/\/okamurax.com\/?p=237"},"modified":"2021-11-02T21:26:12","modified_gmt":"2021-11-02T12:26:12","slug":"apache%e3%81%ae%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=237","title":{"rendered":"Ubuntu Apache(htaccess) \u8a2d\u5b9a"},"content":{"rendered":"<h2>Basic\u8a8d\u8a3c<\/h2>\n<p>.htaccess\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3002<\/p>\n<p><span style=\"color: #0000ff;\">AuthUserFile \/home\/okamura\/.pwd<\/span><\/p>\n<p><span style=\"color: #0000ff;\">AuthName &#8220;please enter&#8221;<\/span><\/p>\n<p><span style=\"color: #0000ff;\"> AuthType Basic<\/span><\/p>\n<p><span style=\"color: #0000ff;\">Require valid-user<\/span><\/p>\n<p>.pwd\u306e\u540d\u79f0\u306f\u306a\u3093\u3067\u3082\u3044\u3044\u304c\u6307\u5b9a\u306f\u30d5\u30eb\u30d1\u30b9\u306b\u3059\u308b\u3002<\/p>\n<p>\u4e00\u822c\u7684\u306b\u306f.htpasswd\u3068\u3059\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">htpasswd -c \/home\/okamura\/.pwd taro<\/span><\/p>\n<p><span style=\"color: #0000ff;\">New password:xxx<\/span><\/p>\n<p><span style=\"color: #0000ff;\">Re-type new password:xxx<\/span><\/p>\n<p>-c\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u306a\u304fhtpasswd\u30b3\u30de\u30f3\u30c9\u3060\u3051\u3060\u3068\u3001\u8ffd\u52a0\u3001\u5909\u66f4\u3002-d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u308b\u3068\u3068\u524a\u9664\u3068\u306a\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">apache2ctl -M<\/span><\/p>\n<p>\u6709\u52b9\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">sudo a2enmod rewrite<\/span><\/p>\n<p>rewrite\u3092\u6709\u52b9\u5316\u3059\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">\/etc\/apache2\/apache2.conf<\/span><\/p>\n<p>\u3067\u3001\u8a72\u5f53\u3059\u308bDirectory\u306bAllowOverride all\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">sudo \/etc\/init.d\/apache2 restart<\/span><\/p>\n<h2>\u8ee2\u9001<\/h2>\n<p>301\u306f\u6052\u4e45\u7684(\u5143\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u6d88\u3048\u308b)\u306a\u8ee2\u9001302(\u5143\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u6b8b\u308b)\u306f\u4e00\u6642\u7684\u306a\u8ee2\u9001\u3002<\/p>\n<p>\u5916\u90e8\u30b5\u30a4\u30c8\u306b\u8ee2\u9001\u3057\u3066\u3044\u308b\u8a2d\u5b9a\u3002R\u306b\u6570\u5b57\u3092\u3044\u308c\u306a\u3044\u3068302\u8ee2\u9001\u3002<\/p>\n<p><span style=\"color: #0000ff;\">RewriteEngine On<\/span><\/p>\n<p><span style=\"color: #0000ff;\">RewriteRule ^ http:\/\/start-affiliate-life.com [R,L]<\/span><\/p>\n<p>\u30e1\u30a4\u30f3\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30b5\u30d6\u306b\u98db\u3070\u3059\u8a2d\u5b9a\u3002<\/p>\n<p><span style=\"color: #0000ff;\">RewriteEngine On<\/span><\/p>\n<p><span style=\"color: #0000ff;\">RewriteCond %{REQUEST_URI} !\/w<\/span><\/p>\n<p><span style=\"color: #0000ff;\">RewriteRule ^(.*)$ \/w\/ [R,L]<\/span><\/p>\n<p>RewriteCond\u3000\u304c true \u306e\u6642\u3000RewriteRule\u304c\u5b9f\u884c\u3055\u308c\u308b\u3002<\/p>\n<p>RewriteCond %\u5909\u6570\u540d(\u30c6\u30b9\u30c8\u6587\u5b57\u5217) \u6761\u4ef6\u30d1\u30bf\u30fc\u30f3(\u6b63\u898f\u8868\u73fe) [\u30d5\u30e9\u30b0]\u3002<\/p>\n<h2>PHP\u95a2\u9023<\/h2>\n<p>\u5909\u6570\u767b\u9332\u306e\u512a\u5148\u9806\u4f4d<\/p>\n<p><span style=\"color: #0000ff;\">variables_order = &#8220;EGPCS&#8221;<\/span><\/p>\n<p>\u5916\u90e8\u30db\u30b9\u30c8\u3078\u306e\u30a2\u30af\u30bb\u30b9<\/p>\n<p><span style=\"color: #0000ff;\">allow_url_fopen = off<\/span><\/p>\n<p>\u30a8\u30e9\u30fc\u30ec\u30dd\u30fc\u30c8<\/p>\n<p><span style=\"color: #0000ff;\">error_reporting = E_ALL &amp; ~E_NOTICE &amp; E_STRICT<\/span><\/p>\n<p>E_NOTICE\u3068E_STRICT\u4ee5\u5916\u306f\u5168\u3066\u3068\u3044\u3046\u610f\u5473 ~ \u306f\u5426\u5b9a\u306e\u610f\u5473<\/p>\n<p>\u753b\u9762\u3078\u30a8\u30e9\u30fc\u3092\u8868\u793a<\/p>\n<p><span style=\"color: #0000ff;\">display_errors = off<\/span><\/p>\n<p>\u30a8\u30e9\u30fc\u306e\u30ed\u30b0\u3092\u51fa\u529b(Windows\u306e\u5834\u5408\u306f\u30a4\u30d9\u30f3\u30c8\u30ed\u30b0\u306b\u30a8\u30e9\u30fc\u304c\u3044\u304f\u3089\u3057\u3044)<\/p>\n<p><span style=\"color: #0000ff;\">log_errors = On<\/span><\/p>\n<p><span style=\"color: #0000ff;\">error_log = file name<\/span><\/p>\n<p>\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9<\/p>\n<p><span style=\"color: #0000ff;\">safe_mode_gid = On<\/span><\/p>\n<p>\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9\u306f\u30d5\u30a1\u30a4\u30eb\u30aa\u30fc\u30d7\u30f3\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u540c\u3058\u6240\u6709\u8005\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u307f\u306b\u306a\u308b\u3002<\/p>\n<p>\u91cd\u8981\u306a\u306e\u306f\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9\u3092\u4f7f\u3046\u3068\u304d\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u6240\u6709\u8005\u3092\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u306b\u3057\u3066\u304a\u304f\u3053\u3068\u3002<\/p>\n<p>\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9\u306fdl\u3084(&#8220;)\u3084shell_exec\u304c\u4f7f\u3048\u306a\u3044\u3002<\/p>\n<p>exec,system,passthru,popen\u306fsafe_mode_exec_dir\u3067\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5236\u9650\u3055\u308c\u308b\u3002<\/p>\n<p>open_base_dir \u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u3067\u304d\u308b\u30d5\u30a9\u30eb\u30c0\u3092\u9650\u5b9a\u3002<\/p>\n<p>disable_functions \u4f7f\u3048\u308b\u95a2\u6570\u3092\u5236\u9650\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Basic\u8a8d\u8a3c .htaccess\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3002 AuthUserFile \/home\/okamura\/.pwd AuthName &#8220;please enter&#8221; AuthType  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=237\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Ubuntu Apache(htaccess) \u8a2d\u5b9a&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[42],"class_list":["post-237","post","type-post","status-publish","format-standard","hentry","category-1","tag-apache"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=237"}],"version-history":[{"count":8,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":4611,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/237\/revisions\/4611"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}