{"id":19528,"date":"2017-04-23T06:16:40","date_gmt":"2017-04-22T22:16:40","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/04\/23\/apache-web-server-2-4-%e4%bd%bf%e7%94%a8%e5%af%86%e7%a2%bc%e4%be%86%e9%99%90%e5%88%b6%e7%80%8f%e8%a6%bd%e4%be%86%e6%ba%90\/"},"modified":"2021-03-18T17:25:00","modified_gmt":"2021-03-18T09:25:00","slug":"apache-web-server-2-4-%e4%bd%bf%e7%94%a8%e5%af%86%e7%a2%bc%e4%be%86%e9%99%90%e5%88%b6%e7%80%8f%e8%a6%bd%e4%be%86%e6%ba%90","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/04\/23\/apache-web-server-2-4-%e4%bd%bf%e7%94%a8%e5%af%86%e7%a2%bc%e4%be%86%e9%99%90%e5%88%b6%e7%80%8f%e8%a6%bd%e4%be%86%e6%ba%90\/","title":{"rendered":"Apache Web Server 2.4 \u4f7f\u7528\u5bc6\u78bc\u4f86\u9650\u5236\u700f\u89bd\u4f86\u6e90"},"content":{"rendered":"<p>1. \u5efa\u7acb\u4f7f\u7528\u8005\u53ca\u5bc6\u78bc<br \/># <span style=\"color: #ff0000\">\/usr\/bin\/htpasswd -c \/var\/www\/test\/.htpasswd admin<\/span><br \/><span style=\"color: #0000ff\">New password:<\/span><br \/><span style=\"color: #0000ff\">Re-type new password:<\/span><br \/><span style=\"color: #0000ff\">Adding password for user admin<br \/><\/span><br \/>\u7b2c\u4e8c\u500b\u4f7f\u7528\u8005\u5c31\u4e0d\u7528\u52a0\u4e0a -c<br \/># <span style=\"color: #ff0000\">\/usr\/bin\/htpasswd \/var\/www\/test\/.htpasswd abc<\/span>[@more@]<br \/>2. \u5efa\u7acb\u8a2d\u5b9a\u6a94 <span style=\"color: #0000ff\">\/etc\/httpd\/conf.d\/test.conf<\/span><br \/># <span style=\"color: #ff0000\">vim \/etc\/httpd\/conf.d\/test.conf<\/span><br \/><span style=\"color: #0000ff\">Alias \/base \/var\/www\/test<\/span><br \/><span style=\"color: #0000ff\">&lt;Directory \/var\/www\/test\/&gt;<\/span><br \/><span style=\"color: #0000ff\">Order Deny,Allow<\/span><br \/><span style=\"color: #0000ff\">#Deny from all<\/span><br \/><span style=\"color: #0000ff\">#Allow from 192.168.1.0\/24<\/span><br \/><span style=\"color: #0000ff\">Require all denied<\/span><br \/><span style=\"color: #0000ff\">Require ip 192.168.1.0\/24<\/span><\/p>\n<p><span style=\"color: #0000ff\">AuthType Basic<\/span><br \/><span style=\"color: #0000ff\">AuthName &#8220;Restricted Files&#8221;<\/span><br \/><span style=\"color: #0000ff\">AllowOverride AuthConfig<\/span><br \/><span style=\"color: #0000ff\"># (Following line optional)<\/span><br \/><span style=\"color: #0000ff\">AuthBasicProvider file<\/span><br \/><span style=\"color: #0000ff\">AuthUserFile &#8220;\/var\/www\/test\/.htpasswd&#8221;<\/span><br \/><span style=\"color: #0000ff\">Require valid-user<\/span><br \/><span style=\"color: #0000ff\">&lt;\/Directory&gt;<\/span><\/p>\n<p>3. \u91cd\u65b0\u555f\u52d5 Apache Web Server<br \/># <span style=\"color: #ff0000\">systemctl restart httpd<\/span><br \/># <span style=\"color: #ff0000\">systemctl status httpd<\/span><\/p>\n<p>4. \u6e2c\u8a66\u4e00\u4e0b <span style=\"color: #ff0000\">http:\/\/Server&#8217;IP\/test<\/span><br \/><a id=\"res_3786169\" href=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/25793-3786169.png\"><img decoding=\"async\" src=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/previews-med\/25793-3786169.png\" border=\"0\" alt=\"\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5efa\u7acb\u4f7f\u7528\u8005\u53ca\u5bc6\u78bc# \/usr\/bin\/htpasswd -c \/var\/www\/test\/.htpass &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/04\/23\/apache-web-server-2-4-%e4%bd%bf%e7%94%a8%e5%af%86%e7%a2%bc%e4%be%86%e9%99%90%e5%88%b6%e7%80%8f%e8%a6%bd%e4%be%86%e6%ba%90\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008Apache Web Server 2.4 \u4f7f\u7528\u5bc6\u78bc\u4f86\u9650\u5236\u700f\u89bd\u4f86\u6e90\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,137],"tags":[],"class_list":["post-19528","post","type-post","status-publish","format-standard","hentry","category-c-78462","category-c-78482"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["687612"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19528"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=19528"}],"version-history":[{"count":1,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19528\/revisions"}],"predecessor-version":[{"id":21042,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19528\/revisions\/21042"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=19528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=19528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=19528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}