{"id":36812,"date":"2023-02-16T03:21:53","date_gmt":"2023-02-17T14:30:26","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/"},"modified":"2024-04-29T14:47:39","modified_gmt":"2024-04-29T06:47:39","slug":"%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/","title":{"rendered":"\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e"},"content":{"rendered":"<h2>\u603b\u7ed3\u4e00\u4e0b<\/h2>\n<p>\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u4f7f\u7528\uff0c\u6211\u4eec\u5c06\u914d\u7f6e\u5728macOS\u4f7f\u7528brew\u5b89\u88c5\u7684apache httpd\u3002<\/p>\n<p>\u901a\u8fc7\u8bbf\u95ee http:\/\/localhost\/ \uff0c\u53ef\u4ee5\u8bbf\u95ee\u5230 ~\/Sites \u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7\u7528\u6237\u6743\u9650\u8fdb\u884c\u7f16\u8f91\u3002<\/p>\n<h2>\u7f16\u8f91httpd.conf<\/h2>\n<p>\u8bf7\u7f16\u8f91 \/usr\/local\/etc\/httpd\/httpd.conf \u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u641c\u7d22\u6bcf\u4e2a\u8bcd\u8bed\u4ee5\u627e\u5230\u76f8\u5e94\u7684\u4f4d\u7f6e\u5e76\u8fdb\u884c\u66f4\u6539\u3002<\/p>\n<h3>\u7aef\u53e3\u66f4\u6539<\/h3>\n<pre class=\"post-pre\"><code>#\r\n# Listen: Allows you to bind Apache to specific IP addresses and\/or\r\n# ports, instead of the default. See also the &lt;VirtualHost&gt;\r\n# directive.\r\n#\r\n# Change this to Listen on specific IP addresses as shown below to \r\n# prevent Apache from glomming onto all bound IP addresses.\r\n#\r\nListen 80\r\n<\/code><\/pre>\n<h3>\u7f51\u7ad9\u6839\u76ee\u5f55<\/h3>\n<p>\u66f4\u6539DocumentRoot\u548c\u5176\u540e\u7684Directory\u76ee\u5f55\u3002<br \/>\n\uff08\u5c06\u5176\u66f4\u6539\u4e3a\u4ee5ls -d ~\/Sites\u663e\u793a\u7684\u76ee\u5f55\uff09<\/p>\n<pre class=\"post-pre\"><code># DocumentRoot: The directory out of which you will serve your\r\n# documents. By default, all requests are taken from this directory, but\r\n# symbolic links and aliases may be used to point to other locations.\r\n#\r\nDocumentRoot \"\/Users\/&lt;user&gt;\/Sites\"\r\n&lt;Directory \"\/Users\/&lt;user&gt;\/Sites\"&gt;\r\n<\/code><\/pre>\n<p>\u8bf7\u5c06\u4e2d\u7684AllowOverride\u66f4\u6539\u4e3aall\u3002<\/p>\n<pre class=\"post-pre\"><code>    #\r\n    # AllowOverride controls what directives may be placed in .htaccess files.\r\n    # It can be \"All\", \"None\", or any combination of the keywords:\r\n    #   AllowOverride FileInfo AuthConfig Limit\r\n    #\r\n    AllowOverride All\r\n<\/code><\/pre>\n<h3>\u6a21\u5757\u91cd\u5199<\/h3>\n<p>\u5220\u9664\uff03\u7b26\u53f7\u5e76\u53d6\u6d88\u6ce8\u91ca\u3002<\/p>\n<pre class=\"post-pre\"><code>LoadModule rewrite_module lib\/httpd\/modules\/mod_rewrite.so\r\n<\/code><\/pre>\n<h3>\u7528\u6237\u53ca\u7fa4\u7ec4<\/h3>\n<p>\u66f4\u6539\u7528\u6237\u548c\u7ec4\u540d\u3002<br \/>\n\u8fd9\u6837\uff0c\u7528\u6237\u6743\u9650\u53ef\u4ee5\u7f16\u8f91web\u516c\u5f00\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>User &lt;user&gt;\r\nGroup staff\r\n<\/code><\/pre>\n<h3>\u670d\u52a1\u5668\u540d\u79f0<\/h3>\n<p>\u5c06\u670d\u52a1\u5668\u540d\u79f0\u66f4\u6539\u4e3a\u672c\u5730\u4e3b\u673a\u3002<\/p>\n<pre class=\"post-pre\"><code>ServerName localhost\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0a\u662f\u8bbe\u7f6e\u5b8c\u6210\u3002<\/p>\n<h3>\u786e\u8ba4<\/h3>\n<p>\u8ba9\u6211\u4eec\u91cd\u65b0\u542f\u52a8 Apache\uff0c\u7136\u540e\u5728 http:\/\/localhost\/ \u4e0a\u8fdb\u884c\u786e\u8ba4\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo apachectl -k restart\r\n<\/code><\/pre>\n<p>\u6253\u5f00\u4ee5\u4e0b\u7684\u7f51\u9875\u65f6\uff0c\u4f1a\u51fa\u73b0\uff1a1<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2b1d37434c4406c4971d\/26-0.png\" alt=\"image.png\" \/><\/div>\n<h2>\u76f8\u5173<\/h2>\n<ul class=\"post-ul\">macOS Mojave\u3067Liip PHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/ul>\n<div>\u987a\u4fbf\u63d0\u4e00\u4e0b\uff0ciWeb\u57282011\u5e74\u5df2\u7ecf\u505c\u6b62\u5f00\u53d1\u4e86&#8230;<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u603b\u7ed3\u4e00\u4e0b \u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u4f7f\u7528\uff0c\u6211\u4eec\u5c06\u914d\u7f6e\u5728macOS\u4f7f\u7528brew\u5b89\u88c5\u7684apache httpd\u3002 \u901a\u8fc7\u8bbf\u95ee ht [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-36812","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e\" \/>\n<meta property=\"og:description\" content=\"\u603b\u7ed3\u4e00\u4e0b \u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u4f7f\u7528\uff0c\u6211\u4eec\u5c06\u914d\u7f6e\u5728macOS\u4f7f\u7528brew\u5b89\u88c5\u7684apache httpd\u3002 \u901a\u8fc7\u8bbf\u95ee ht [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-17T14:30:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T06:47:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2b1d37434c4406c4971d\/26-0.png\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/\",\"name\":\"\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-02-17T14:30:26+00:00\",\"dateModified\":\"2024-04-29T06:47:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e","og_description":"\u603b\u7ed3\u4e00\u4e0b \u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u4f7f\u7528\uff0c\u6211\u4eec\u5c06\u914d\u7f6e\u5728macOS\u4f7f\u7528brew\u5b89\u88c5\u7684apache httpd\u3002 \u901a\u8fc7\u8bbf\u95ee ht [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-02-17T14:30:26+00:00","article_modified_time":"2024-04-29T06:47:39+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2b1d37434c4406c4971d\/26-0.png"}],"author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/","name":"\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-02-17T14:30:26+00:00","dateModified":"2024-04-29T06:47:39+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528brew\u5b89\u88c5\u7684apache\u7684\u914d\u7f6e"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8brew%e5%ae%89%e8%a3%85%e7%9a%84apache%e7%9a%84%e9%85%8d%e7%bd%ae\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/36812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=36812"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/36812\/revisions"}],"predecessor-version":[{"id":85911,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/36812\/revisions\/85911"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=36812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=36812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=36812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}