{"id":1248,"date":"2016-09-19T03:13:32","date_gmt":"2016-09-18T19:13:32","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=1248"},"modified":"2016-09-19T03:13:32","modified_gmt":"2016-09-18T19:13:32","slug":"apache%e7%9a%84httpd-2-4-23-server%e6%ba%90%e6%96%87%e4%bb%b6%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/uncategorized\/apache%e7%9a%84httpd-2-4-23-server%e6%ba%90%e6%96%87%e4%bb%b6%e5%ae%89%e8%a3%85\/","title":{"rendered":"Apache\u7684httpd-2.4.23 Server\u6e90\u6587\u4ef6\u5b89\u88c5"},"content":{"rendered":"<p>Apache \u7684HTTP Server\u662f\u76ee\u524d\u6700\u6d41\u884c\u7684HTTP\u670d\u52a1\u5668\u8f6f\u4ef6\u4e4b\u4e00\u3002\u5176\u4f18\u52bf\u4e3b\u8981\u5728\u4e8e\u5feb\u901f\u3001\u53ef\u9760\u3001\u53ef\u901a\u8fc7\u7b80\u5355\u7684API\u6269\u5c55\uff0cPerl\/Python\u89e3\u91ca\u5668\u53ef\u88ab\u7f16\u8bd1\u5230\u670d\u52a1\u5668\u4e2d\uff0c\u5b8c\u5168\u514d\u8d39\u800c\u4e14\u5b8c\u5168\u6e90\u4ee3\u7801\u5f00\u653e\u3002\u5982\u679c\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u6bcf\u5929\u6709\u6570\u767e\u4e07\u4eba\u8bbf\u95ee\u7684Web\u670d\u52a1\u5668\uff0cApache HTTP Server\u4f1a\u662f\u6700\u4f73\u7684\u9009\u62e9\uff0c\u5177\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a<\/p>\n<p>1\u3001\u4e3b\u8981\u7528\u4e8e\u89e3\u6790\u9759\u6001\u6587\u672c\uff0c\u5e76\u53d1\u6027\u80fd\u9ad8\uff0c\u4fa7\u91cd\u4e8eHTTP\u670d\u52a1\uff1b<\/p>\n<p>2\u3001\u652f\u6301\u9759\u6001\u9875\uff08HTML\uff09\uff0c\u4e0d\u652f\u6301\u52a8\u6001\u8bf7\u6c42\u5982\uff1aCGI\u3001Servlet\/JSP\u3001PHP\u3001ASP\u7b49\uff1b<\/p>\n<p>3\u3001\u5177\u6709\u5f88\u5f3a\u7684\u53ef\u6269\u5c55\u6027\uff0c\u53ef\u4ee5\u901a\u8fc7\u63d2\u4ef6\u652f\u6301PHP\uff0c\u8fd8\u53ef\u4ee5\u5355\u5411Apache\u8fde\u63a5Tomcat\u5b9e\u73b0\u8fde\u901a\uff1b<\/p>\n<p>4\u3001Apache\u662f\u4e16\u754c\u4f7f\u7528\u6392\u540d\u7b2c\u4e00\u7684Web\u670d\u52a1\u5668\u3002<\/p>\n<p>\u4e00\u3001Apache\u6e90\u6587\u4ef6\u5b89\u88c5\u7684\u4f9d\u8d56\u6587\u4ef6\u5b89\u88c5<\/p>\n<p>#\u00a0 yum -y install gcc \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #\u7f16\u8bd1\u5668\u4f9d\u8d56\u6587\u4ef6<\/p>\n<p>#\u00a0 yum -y install zlib-devel pcre pcre-devel apr apr-devel\u00a0\u00a0\u00a0 #\u7f16\u8bd1\u4f9d\u8d56\u7684\u4e00\u4e9b\u5e93\u6587\u4ef6<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e8c\u3001\u5728<a title=\"https:\/\/mirrors.cnnic.cn\/apache\/\" href=\"https:\/\/mirrors.cnnic.cn\/apache\/\" target=\"_blank\">https:\/\/mirrors.cnnic.cn\/apache\/<\/a>\u5b98\u7f51\u4e2d\u4e0b\u8f7d\u6700\u65b0\u7248Apache\u7684httpd\u6587\u4ef6\u53ca\u4f9d\u8d56\u6587\u4ef6<\/p>\n<p># cd \/usr\/local\/src<\/p>\n<p># wget <a href=\"https:\/\/mirrors.cnnic.cn\/apache\/httpd\/httpd-2.4.23.tar.gz\" target=\"_blank\">https:\/\/mirrors.cnnic.cn\/apache\/httpd\/httpd-2.4.23.tar.gz<\/a>\u00a0 \u00a0 \u00a0#\u6838\u5fc3\u670d\u52a1<\/p>\n<p># wget <a href=\"https:\/\/mirrors.cnnic.cn\/apache\/apr\/apr-util-1.5.4.tar.gz\" target=\"_blank\">https:\/\/mirrors.cnnic.cn\/apache\/apr\/apr-util-1.5.4.tar.gz<\/a>\u00a0\u00a0\u00a0\u00a0 #\u4f9d\u8d56\u6587\u4ef6<\/p>\n<p># wget <a href=\"https:\/\/mirrors.cnnic.cn\/apache\/apr\/apr-1.5.2.tar.gz\" target=\"_blank\">https:\/\/mirrors.cnnic.cn\/apache\/apr\/apr-1.5.2.tar.gz<\/a>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #\u4f9d\u8d56\u6587\u4ef6<\/p>\n<p>\u4e09\u3001\u89e3\u538b\u6587\u4ef6<\/p>\n<p># tar vxf httpd-2.4.23.tar.gz<\/p>\n<p># tar -zxvf apr-1.5.2.tar.gz<\/p>\n<p># tar -vxf apr-util-1.5.4.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>\u56db\u3001\u628aapr-1.5.2.tar.gz\u53caapr-util-1.5.4.tar.gz\u89e3\u538b\u7f29\u7684\u6587\u4ef6\u79fb\u52a8\u5230httpd-2.4.23\/srclib\/apr\u53cahttpd-2.4.23\/srclib\/apr-util\u76ee\u5f55\u4e0b\uff0c\u4e0d\u7136\u7f16\u8bd1\u65f6\u4f1a\u51fa\u9519\u3002<\/p>\n<p># mkdir -p httpd-2.4.23\/srclib\/apr httpd-2.4.23\/srclib\/apr-util<\/p>\n<p># mv apr-1.5.2 httpd-2.4.23\/srclib\/apr<\/p>\n<p># mv apr-util-1.5.4 httpd-2.4.23\/srclib\/apr-util<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e94\u3001\u914d\u7f6e\u7f16\u8bd1\u53c2\u6570<\/p>\n<p># cd httpd-2.4.23<\/p>\n<p># .\/configure \\<\/p>\n<p>&#8211;prefix=\/usr\/local\/apache2 \\\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u6307\u5b9a\u5b89\u88c5\u5230\u54ea\u91cc<\/p>\n<p>&#8211;with-included-apr \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #\u8868\u793a\u542f\u7528DSO\uff08\u52a8\u6001\u5171\u4eab\u76ee\u6807\uff09\u7684\u7f29\u5199\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u5728\u8fd0\u884c\u65f6\u5c06\u7279\u6b8a\u683c\u5f0f\u7684\u4ee3\u7801\u5728\u7a0b\u5e8f\u8fd0\u884c\u9700\u8981\u65f6\uff0c\u5c06\u9700\u8981\u7684\u90e8\u5206\u4ece\u5916\u5b58\u8c03\u5165\u5185\u5b58\u6267\u884c\u7684\u65b9\u6cd5\u3002apache \u652f\u6301\u52a8\u6001\u5171\u4eab\u6a21\u5757\uff0c\u4e5f\u652f\u6301\u9759\u6001\u6a21\u5757\uff0c\u9759\u6001\u7684\u8bdd\uff0c\u4f1a\u628a\u9700\u8981\u7684\u76ee\u6807\u76f4\u63a5\u7f16\u8bd1\u8fdbapache\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u76f8\u6bd4\u8f83\u52a8\u6001\uff0c\u867d\u7136\u7701\u53bb\u4e86\u52a0\u8f7d\u5171\u4eab\u6a21\u5757\u7684\u6b65\u9aa4\uff0c\u4f46\u662f\u4e5f\u52a0\u5927\u4e86\u4e8c\u8fdb\u5236\u6267\u884c\u6587\u4ef6\u7684\u7a7a\u95f4\uff0c\u53d8\u5f97\u81c3\u80bf\u3002<\/p>\n<p>&#8211;enable-so \\<\/p>\n<p>&#8211;enable-deflate=shared \\\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u8868\u793a\u5171\u4eab\u7684\u65b9\u5f0f\u7f16\u8bd1deflate<\/p>\n<p>&#8211;enable-expires=shared \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #\u8868\u793a\u5171\u4eab\u7684\u65b9\u5f0f\u7f16\u8bd1expires<\/p>\n<p>&#8211;enable-rewrite=shared \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #\u8868\u793a\u5171\u4eab\u7684\u65b9\u5f0f\u7f16\u8bd1rewrite<\/p>\n<p>&#8211;with-pcre<\/p>\n<p># echo $?\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u9a8c\u8bc1\u8fd9\u4e00\u6b65\u662f\u5426\u6210\u529f\uff0c\u8fd4\u56de\u503c\u5982\u679c\u662f&#8220;0&#8221; \u5219\u6267\u884c\u6210\u529f\uff0c\u5426\u5219\u5c31\u662f\u6ca1\u6709\u6210\u529f<\/p>\n<p>0<\/p>\n<p>&nbsp;<\/p>\n<p>\u516d\u3001\u8fdb\u884c\u7f16\u8bd1<\/p>\n<p># make \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #\u7f16\u8bd1\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u51fa\u73b0\u7c7b\u4f3c\u4e71\u4e03\u516b\u7cdf\u7684\u4fe1\u606f\uff0c\u7f16\u8bd1\u7684\u65f6\u95f4\u6bd4\u8f83\u957f<\/p>\n<p># echo $?\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u9a8c\u8bc1\u8fd9\u4e00\u6b65\u662f\u5426\u6210\u529f\uff0c\u8fd4\u56de\u503c\u5982\u679c\u662f&#8220;0&#8221; \u5219\u6267\u884c\u6210\u529f\uff0c\u5426\u5219\u5c31\u662f\u6ca1\u6709\u6210\u529f<\/p>\n<p>0<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e03\u3001\u5b89\u88c5<\/p>\n<p># make install<\/p>\n<p># echo $?\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u9a8c\u8bc1\u8fd9\u4e00\u6b65\u662f\u5426\u6210\u529f\uff0c\u8fd4\u56de\u503c\u5982\u679c\u662f&#8220;0&#8221; \u5219\u6267\u884c\u6210\u529f\uff0c\u5426\u5219\u5c31\u662f\u6ca1\u6709\u6210\u529f<\/p>\n<p>0<\/p>\n<p>&nbsp;<\/p>\n<p>\u516b\u3001<\/p>\n<p># cd\u00a0 \/usr\/local\/apache2\u00a0\u00a0\u00a0 #Apache\u5b89\u88c5\u7684\u76ee\u5f55<\/p>\n<p># vim conf\/httpd.conf\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u4fee\u6539\u5982\u4e0b\u5185\u5bb9<\/p>\n<p>&nbsp;<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014httpd.conf \u5185\u5bb9\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p>ServerName localhost:80 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#\u672c\u5730\u6d4b\u8bd5\u4fee\u6539\u6210\u4e3b\u673a\u540d<\/p>\n<p>&lt;Directory \/&gt;<br \/>\nAllowOverride none<br \/>\nRequire all denied<br \/>\n&lt;\/Directory&gt;<\/p>\n<p>DocumentRoot &#8220;\/home\/web&#8221; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #\u8bbe\u5b9a\u53d1\u5e03\u4e3b\u9875\u76ee\u5f55<br \/>\n&lt;Directory &#8220;\/home\/web&#8221;&gt; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#\u8bbe\u5b9a\u53d1\u5e03\u4e3b\u9875\u76ee\u5f55<\/p>\n<p>\u2026<\/p>\n<p>&lt;IfModule dir_module&gt;<br \/>\nDirectoryIndex index.html index.php\u00a0\u00a0\u00a0\u00a0\u00a0 #\u6dfb\u52a0php\u7684\u4e3b\u9875<br \/>\n&lt;\/IfModule&gt;<br \/>\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014httpd.conf \u5185\u5bb9\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache \u7684HTTP Server\u662f\u76ee\u524d\u6700\u6d41\u884c\u7684HTTP\u670d\u52a1\u5668\u8f6f\u4ef6\u4e4b\u4e00\u3002\u5176\u4f18\u52bf\u4e3b\u8981\u5728\u4e8e\u5feb\u901f\u3001\u53ef\u9760\u3001\u53ef\u901a\u8fc7\u7b80 &#8230; <a title=\"Apache\u7684httpd-2.4.23 Server\u6e90\u6587\u4ef6\u5b89\u88c5\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/uncategorized\/apache%e7%9a%84httpd-2-4-23-server%e6%ba%90%e6%96%87%e4%bb%b6%e5%ae%89%e8%a3%85\/\" aria-label=\"\u9605\u8bfb Apache\u7684httpd-2.4.23 Server\u6e90\u6587\u4ef6\u5b89\u88c5\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[85,38],"class_list":["post-1248","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-apache","tag-linux"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=1248"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1248\/revisions"}],"predecessor-version":[{"id":1249,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/1248\/revisions\/1249"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=1248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=1248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=1248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}