{"id":1104,"date":"2012-06-16T22:58:00","date_gmt":"2012-06-16T14:58:00","guid":{"rendered":"https:\/\/blog.rexdf.org\/?p=1072"},"modified":"2012-06-16T22:58:00","modified_gmt":"2012-06-16T14:58:00","slug":"%e5%a4%9aip%e5%a4%9a%e7%ab%af%e5%8f%a3apache%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e7%9a%84%e9%85%8d%e7%bd%ae%e7%9a%84%e8%ae%be%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/blog.rexdf.org\/ja\/2012\/06\/%e5%a4%9aip%e5%a4%9a%e7%ab%af%e5%8f%a3apache%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e7%9a%84%e9%85%8d%e7%bd%ae%e7%9a%84%e8%ae%be%e7%bd%ae\/","title":{"rendered":"\u591aIP\u591a\u7aef\u53e3apache\u865a\u62df\u4e3b\u673a\u7684\u914d\u7f6e\u7684\u8bbe\u7f6e"},"content":{"rendered":"<p>\u5728\u5f88\u591a\u7684\u865a\u62df\u4e3b\u673a\u5e94\u7528\u4e2d\u7531\u4e8e\u67d0\u4e9b\u539f\u56e0\u6211\u4eec\u5e38\u5e38\u4e3a\u4e3b\u673a\u5206\u914d\u591a\u4e2aIP[TMD\u73b0\u5728IDC\u7684IP\u597d\u8d35],\u4ee5\u4e0b\u662f\u51e0\u79cd\u591a\u4e2aIP\u6216\u591a\u4e2a\u7aef\u54c1\u7684apache\u865a\u62df\u4e3b\u673a\u7684\u914d\u7f6e\u4f8b\u5b50<\/p>\n<p align=\"left\">\u57fa\u4e8eIP\u5730\u5740\u7684\u865a\u62df\u4e3b\u673a\u914d\u7f6e<\/p>\n<p align=\"left\">\n<pre class=\"brush: bash; gutter: true\">Listen 80\n\nDocumentRoot \/www\/example1\n\nServerName www.example1.com\n\nDocumentRoot \/www\/example2\n\nServerName www.example2.org<\/pre>\n<p align=\"left\">\u57fa\u4e8eIP\u548c\u591a\u7aef\u53e3\u7684\u865a\u62df\u4e3b\u673a\u914d\u7f6e<\/p>\n<pre class=\"brush: bash; gutter: true\">Listen 172.20.30.40:80\n\nListen 172.20.30.40:8080\n\nListen 172.20.30.50:80\n\nListen 172.20.30.50:8080\n\nDocumentRoot \/www\/example1-80\n\nServerName www.example1.com\n\nDocumentRoot \/www\/example1-8080\n\nServerName www.example1.com\n\nDocumentRoot \/www\/example2-80\n\nServerName www.example1.org\n\nDocumentRoot \/www\/example2-8080\n\nServerName www.example2.org<\/pre>\n<p align=\"left\">\u5355\u4e2aIP\u5730\u5740\u7684\u670d\u52a1\u5668\u4e0a\u57fa\u4e8e\u57df\u540d\u7684\u865a\u62df\u4e3b\u673a\u914d\u7f6e\uff1a<\/p>\n<pre class=\"brush: bash; gutter: true\"># Ensure that Apache listens on port 80\n\nListen 80\n\n# Listen for virtual host requests on all IP addresses\n\nNameVirtualHost *:80\n\nDocumentRoot \/www\/example1\n\nServerName www.example1.com\n\nServerAlias example1.com. *.example1.com\n\n# Other directives here\n\nDocumentRoot \/www\/example2\n\nServerName www.example2.org\n\n# Other directives here<\/pre>\n<p align=\"left\">\u5728\u591a\u4e2aIP\u5730\u5740\u7684\u670d\u52a1\u5668\u4e0a\u914d\u7f6e\u57fa\u4e8e\u57df\u540d\u7684\u865a\u62df\u4e3b\u673a\uff1a<\/p>\n<pre class=\"brush: bash; gutter: true\">Listen 80\n\n# This is the \u201cmain\u201d server running on 172.20.30.40\n\nServerName server.domain.com\n\nDocumentRoot \/www\/mainserver\n\n# This is the other address\n\nNameVirtualHost 172.20.30.50\n\nDocumentRoot \/www\/example1\n\nServerName www.example1.com\n\n# Other directives here \u2026\n\nDocumentRoot \/www\/example2\n\nServerName www.example2.org\n\n# Other directives here \u2026<\/pre>\n<p align=\"left\">\u5728\u4e0d\u540c\u7684\u7aef\u53e3\u4e0a\u8fd0\u884c\u4e0d\u540c\u7684\u7ad9\u70b9\uff1a<\/p>\n<p align=\"left\">\u57fa\u4e8e\u591a\u7aef\u53e3\u7684\u670d\u52a1\u5668\u4e0a\u914d\u7f6e\u57fa\u4e8e\u57df\u540d\u7684\u865a\u62df\u4e3b\u673a\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">Listen 80\n\nListen 8080\n\nNameVirtualHost 172.20.30.40:80\n\nNameVirtualHost 172.20.30.40:8080\n\nServerName www.example1.com\n\nDocumentRoot \/www\/domain-80\n\nServerName www.example1.com\n\nDocumentRoot \/www\/domain-8080\n\nServerName www.example2.org\n\nDocumentRoot \/www\/otherdomain-80\n\nServerName www.example2.org\n\nDocumentRoot \/www\/otherdomain-8080<\/pre>\n<p align=\"left\">\u57fa\u4e8e\u57df\u540d\u548c\u57fa\u4e8eIP\u7684\u6df7\u5408\u865a\u62df\u4e3b\u673a\u7684\u914d\u7f6e:<\/p>\n<pre class=\"brush: bash; gutter: true\">Listen 80\n\nNameVirtualHost 172.20.30.40\n\nDocumentRoot \/www\/example1\n\nServerName www.example1.com\n\nDocumentRoot \/www\/example2\n\nServerName www.example2.org\n\nDocumentRoot \/www\/example3\n\nServerName www.example3.net<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f88\u591a\u7684\u865a\u62df\u4e3b\u673a\u5e94\u7528\u4e2d\u7531\u4e8e\u67d0\u4e9b\u539f\u56e0\u6211\u4eec\u5e38\u5e38\u4e3a\u4e3b\u673a\u5206\u914d\u591a\u4e2aIP[TMD\u73b0\u5728IDC\u7684 &hellip; <a href=\"https:\/\/blog.rexdf.org\/ja\/2012\/06\/%e5%a4%9aip%e5%a4%9a%e7%ab%af%e5%8f%a3apache%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e7%9a%84%e9%85%8d%e7%bd%ae%e7%9a%84%e8%ae%be%e7%bd%ae\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[19],"tags":[29],"class_list":["post-1104","post","type-post","status-publish","format-standard","hentry","category-site-build","tag-apache"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/posts\/1104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/comments?post=1104"}],"version-history":[{"count":0,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/posts\/1104\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/media?parent=1104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/categories?post=1104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/tags?post=1104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}