{"id":42660,"date":"2024-10-03T22:32:38","date_gmt":"2024-10-03T14:32:38","guid":{"rendered":"https:\/\/server.hk\/cnblog\/42660\/"},"modified":"2024-10-03T22:32:38","modified_gmt":"2024-10-03T14:32:38","slug":"centos-6-8-%e6%ba%90%e7%a2%bc%e5%ae%89%e8%a3%9d-httpd-2-4-25","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/42660\/","title":{"rendered":"CentOS 6.8 \u6e90\u78bc\u5b89\u88dd httpd-2.4.25"},"content":{"rendered":"<h1 id=\"centos-6-8-%e6%ba%90%e7%a2%bc%e5%ae%89%e8%a3%9d-httpd-2-4-25-NpnPxYhlYW\">CentOS 6.8 \u6e90\u78bc\u5b89\u88dd httpd-2.4.25<\/h1>\n<p>\u5728\u4f3a\u670d\u5668\u7ba1\u7406\u4e2d\uff0cApache HTTP Server\uff08\u7c21\u7a31 httpd\uff09\u662f\u4e00\u500b\u975e\u5e38\u6d41\u884c\u7684\u7db2\u9801\u4f3a\u670d\u5668\u8edf\u9ad4\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 CentOS 6.8 \u4e0a\u5f9e\u6e90\u78bc\u5b89\u88dd httpd-2.4.25\uff0c\u4e26\u63d0\u4f9b\u8a73\u7d30\u7684\u6b65\u9a5f\u548c\u6ce8\u610f\u4e8b\u9805\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%9c%9f%e6%ba%96%e5%82%99-NpnPxYhlYW\">\u524d\u671f\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u7cfb\u7d71\u5df2\u7d93\u5b89\u88dd\u4e86\u5fc5\u8981\u7684\u958b\u767c\u5de5\u5177\u548c\u5eab\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b89\u88dd\u9019\u4e9b\u5de5\u5177\uff1a<\/p>\n<pre><code>sudo yum groupinstall \"Development Tools\"<\/code><\/pre>\n<p>\u6b64\u5916\uff0c\u9084\u9700\u8981\u5b89\u88dd\u4e00\u4e9b\u4f9d\u8cf4\u5eab\uff0c\u4f8b\u5982 pcre\u3001zlib \u548c openssl\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo yum install pcre-devel zlib-devel openssl-devel<\/code><\/pre>\n<h2 id=\"%e4%b8%8b%e8%bc%89-httpd-%e6%ba%90%e7%a2%bc-NpnPxYhlYW\">\u4e0b\u8f09 httpd \u6e90\u78bc<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u4e0b\u8f09 httpd-2.4.25 \u7684\u6e90\u78bc\u3002\u53ef\u4ee5\u5f9e Apache \u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09\uff1a<\/p>\n<pre><code>wget https:\/\/archive.apache.org\/dist\/httpd\/httpd-2.4.25.tar.gz<\/code><\/pre>\n<p>\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u89e3\u58d3\u7e2e\u6e90\u78bc\u5305\uff1a<\/p>\n<pre><code>tar -zxvf httpd-2.4.25.tar.gz<\/code><\/pre>\n<h2 id=\"%e7%b7%a8%e8%ad%af%e5%92%8c%e5%ae%89%e8%a3%9d-httpd-NpnPxYhlYW\">\u7de8\u8b6f\u548c\u5b89\u88dd httpd<\/h2>\n<p>\u9032\u5165\u89e3\u58d3\u5f8c\u7684\u76ee\u9304\uff1a<\/p>\n<pre><code>cd httpd-2.4.25<\/code><\/pre>\n<p>\u7136\u5f8c\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u914d\u7f6e\u7de8\u8b6f\u9078\u9805\uff1a<\/p>\n<pre><code>.\/configure --prefix=\/usr\/local\/apache2 --enable-so --enable-ssl --with-mpm=event<\/code><\/pre>\n<p>\u9019\u88e1\u7684\u9078\u9805\u89e3\u91cb\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li><code>--prefix=\/usr\/local\/apache2<\/code>\uff1a\u6307\u5b9a\u5b89\u88dd\u8def\u5f91\u3002<\/li>\n<li><code>--enable-so<\/code>\uff1a\u555f\u7528\u52d5\u614b\u6a21\u7d44\u3002<\/li>\n<li><code>--enable-ssl<\/code>\uff1a\u555f\u7528 SSL \u652f\u6301\u3002<\/li>\n<li><code>--with-mpm=event<\/code>\uff1a\u4f7f\u7528\u4e8b\u4ef6\u9a45\u52d5\u7684\u591a\u8655\u7406\u6a21\u7d44\u3002<\/li>\n<\/ul>\n<p>\u914d\u7f6e\u5b8c\u6210\u5f8c\uff0c\u958b\u59cb\u7de8\u8b6f\u548c\u5b89\u88dd\uff1a<\/p>\n<pre><code>make<\/code><\/pre>\n<pre><code>sudo make install<\/code><\/pre>\n<h2 id=\"%e9%85%8d%e7%bd%ae-httpd-NpnPxYhlYW\">\u914d\u7f6e httpd<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u914d\u7f6e httpd\u3002\u914d\u7f6e\u6587\u4ef6\u4f4d\u65bc <code>\/usr\/local\/apache2\/conf\/httpd.conf<\/code>\u3002\u53ef\u4ee5\u4f7f\u7528\u60a8\u559c\u6b61\u7684\u7de8\u8f2f\u5668\u6253\u958b\u8a72\u6587\u4ef6\uff1a<\/p>\n<pre><code>sudo vi \/usr\/local\/apache2\/conf\/httpd.conf<\/code><\/pre>\n<p>\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u60a8\u53ef\u4ee5\u8a2d\u7f6e\u4f3a\u670d\u5668\u540d\u7a31\u3001\u7aef\u53e3\u865f\u3001\u6587\u6a94\u6839\u76ee\u9304\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u914d\u7f6e\u9805\uff1a<\/p>\n<ul>\n<li>\u8a2d\u7f6e\u4f3a\u670d\u5668\u540d\u7a31\uff1a<\/li>\n<pre><code>ServerName localhost:80<\/code><\/pre>\n<li>\u8a2d\u7f6e\u6587\u6a94\u6839\u76ee\u9304\uff1a<\/li>\n<pre><code>DocumentRoot \"\/usr\/local\/apache2\/htdocs\"<\/code><\/pre>\n<\/ul>\n<h2 id=\"%e5%95%9f%e5%8b%95-httpd-NpnPxYhlYW\">\u555f\u52d5 httpd<\/h2>\n<p>\u914d\u7f6e\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u555f\u52d5 httpd \u4f3a\u670d\u5668\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u555f\u52d5\u4f3a\u670d\u5668\uff1a<\/p>\n<pre><code>\/usr\/local\/apache2\/bin\/apachectl start<\/code><\/pre>\n<p>\u8981\u6aa2\u67e5 httpd \u662f\u5426\u6b63\u5e38\u904b\u884c\uff0c\u53ef\u4ee5\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/localhost<\/code>\uff0c\u5982\u679c\u770b\u5230 Apache \u7684\u6b61\u8fce\u9801\u9762\uff0c\u5247\u8868\u793a\u5b89\u88dd\u6210\u529f\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-NpnPxYhlYW\">\u7e3d\u7d50<\/h2>\n<p>\u672c\u6587\u4ecb\u7d39\u4e86\u5982\u4f55\u5728 CentOS 6.8 \u4e0a\u5f9e\u6e90\u78bc\u5b89\u88dd httpd-2.4.25\u3002\u901a\u904e\u9019\u4e9b\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u6210\u529f\u914d\u7f6e\u548c\u904b\u884c Apache HTTP Server\u3002\u82e5\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u4f3a\u670d\u5668\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u9019\u5c07\u70ba\u60a8\u7684\u7db2\u7ad9\u63d0\u4f9b\u7a69\u5b9a\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install httpd-2.4.25 from source on CentOS 6.8 with this step-by-step guide, ensuring optimal performance and customization.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-42660","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/42660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=42660"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/42660\/revisions"}],"predecessor-version":[{"id":42661,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/42660\/revisions\/42661"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=42660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=42660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=42660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}