{"id":11941,"date":"2020-11-12T17:33:52","date_gmt":"2020-11-12T09:33:52","guid":{"rendered":"https:\/\/www.microfusion.cloud\/hk\/?p=11941"},"modified":"2022-12-29T15:22:13","modified_gmt":"2022-12-29T07:22:13","slug":"gcp-gce-apache-server","status":"publish","type":"post","link":"https:\/\/www.microfusion.cloud\/hk\/2020\/11\/12\/gcp-gce-apache-server\/","title":{"rendered":"GCP \u4f7f\u7528Compute Engine\u5efa\u7acbApache Server"},"content":{"rendered":"<p><\/p>\n\n\n<\/p>\r\n<p style=\"margin-bottom: 0.9rem;\">\u6b64\u6559\u5b78\u8b93\u60a8\u4e86\u89e3\u5982\u4f55\u5728Google Compute Engine\u8a2d\u5b9aVM\u57f7\u884c\u500b\u9ad4\u3002\u6211\u5011\u5c07\u6703\u5728Linux server\u4e2d\u5efa\u7f6e\u4e00\u500bApache web server\uff0c\u8b93\u60a8\u7406\u89e3\u5728VM\u4e0a\u904b\u884c\u670d\u52d9\u7684\u57fa\u672c\u77e5\u8b58\u3002<\/p>\r\n<p>\n\n<\/p>\r\n<h3><strong>\u5982\u4f55\u5728<\/strong><strong>GCP<\/strong><strong>\u4e0a\u5efa\u7f6e<\/strong><strong>Apache Server<\/strong><\/h3>\r\n<p style=\"margin-bottom: 0.9rem;\">\u6b64\u6559\u5b78\u8b93\u60a8\u4e86\u89e3\u5982\u4f55\u5728Google Compute Engine\u8a2d\u5b9aVM\u57f7\u884c\u500b\u9ad4\u3002\u6211\u5011\u5c07\u6703\u5728Linux server\u4e2d\u5efa\u7f6e\u4e00\u500bApache web server\uff0c\u8b93\u60a8\u7406\u89e3\u5728VM\u4e0a\u904b\u884c\u670d\u52d9\u7684\u57fa\u672c\u77e5\u8b58\u3002<\/p>\r\n<p>1. \u5728GCP\u7684Console\u9801\u9762\u4e0a\u9078\u64c7\u60a8\u8981\u5efa\u7acbVM\u7684Project\u3002<\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/01.jpg\" sizes=\"auto, (max-width: 389px) 100vw, 389px\" srcset=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/01.jpg 389w, https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/01-300x198.jpg 300w\" alt=\"\" width=\"490\" height=\"324\" \/><\/p>\r\n<p>2. \u9ede\u9078\u5728Console\u9801\u9762\u5de6\u4e0a\u65b9\u7684\u5c0e\u89bd\u9078\u55ae\uff0c\u6e38\u6a19\u79fb\u52d5\u5230\u904b\u7b97\u5206\u985e\u4e2d\u7684<strong>Compute Engine<\/strong>\uff0c\u9ede\u9078<strong>VM <\/strong><strong>\u57f7\u884c\u500b\u9ad4<\/strong> <strong>\u2192<\/strong> <strong>\u5efa\u7acb\u57f7\u884c\u500b\u9ad4<\/strong>\u3002<\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/02.jpg\" sizes=\"auto, (max-width: 258px) 100vw, 258px\" srcset=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/02.jpg 258w, https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/02-196x300.jpg 196w\" alt=\"\" width=\"319\" height=\"489\" \/><\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/03.jpg\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" srcset=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/03.jpg 554w, https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/03-300x152.jpg 300w\" alt=\"\" width=\"611\" height=\"309\" \/><\/p>\r\n<p>3. \u63a5\u4e0b\u4f86\u586b\u5165\u60a8\u8981\u7684<em>VB<\/em><em>\u57f7\u884c\u500b\u9ad4\u540d\u7a31<\/em>\uff0c\u4ee5\u53ca\u60a8\u5e0c\u671bVM\u57f7\u884c\u500b\u9ad4\u6240\u5728\u7684<em>\u5340\u57df<\/em>\uff0c<em>\u6a5f\u5668\u985e\u578b<\/em> <em>\u7b49\u8cc7\u8a0a<\/em>\u3002<\/p>\r\n<p>Note: \u56e0\u50c5\u4f9b\u6559\u5b78\u7528\uff0c\u6240\u4ee5\u672c\u7bc7\u6587\u7ae0\u9078\u64c7e2-micro (2 vCpu, 1GB memory )\uff1b\u958b\u6a5f\u78c1\u789f(Boot disk)\u4ee5Ubuntu 18.04LTS\u70ba\u7bc4\u4f8b\u3002<\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/04.jpg\" sizes=\"auto, (max-width: 304px) 100vw, 304px\" srcset=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/04.jpg 304w, https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/04-182x300.jpg 182w\" alt=\"\" width=\"358\" height=\"590\" \/><\/p>\r\n<p>4. \u5728\u9632\u706b\u7246(Firewall)\u90e8\u5206\u4e2d\uff0c<strong>\u9078\u53d6\u5141\u8a31<\/strong><strong>HTTP\u6d41\u91cf<\/strong>\uff0c\u63a5\u8457\u6700\u5f8c\u9ede\u9078<strong>\u5efa\u7acb<\/strong>\u3002<\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/05.jpg\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" srcset=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/05.jpg 466w, https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/05-300x162.jpg 300w\" alt=\"\" width=\"466\" height=\"251\" \/><\/p>\r\n<p>5. \u5728GCP Console\u9801\u9762\u9ede\u9078\u81f3<strong>VM\u57f7\u884c\u500b\u9ad4<\/strong>\uff0c\u5728\u5217\u8868\u4e2d\u9ede\u9078<strong>SSH<\/strong>\u9023\u7dda\u81f3\u60a8\u7684VM\u57f7\u884c\u500b\u9ad4\u3002<\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/06.jpg\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" srcset=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/06.jpg 553w, https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/06-300x90.jpg 300w\" alt=\"\" width=\"726\" height=\"218\" \/><\/p>\r\n<p>6. \u9032\u5165Linux server\u5f8c\u5148\u8f38\u5165\u4ee5\u4e0b\u6307\u4ee4\u9032\u884c\u5b89\u88dd\u5957\u4ef6\u6e05\u55ae\u66f4\u65b0\uff0c<\/p>\r\n<p><strong><em>sudo apt update<\/em><\/strong><\/p>\r\n<p>\u63a5\u8457\u8f38\u5165\u4ee5\u4e0b\u6307\u4ee4\u9032\u884cApache server\u7684\u5b89\u88dd\uff0c<\/p>\r\n<p><strong><em>sudo apt -y install apache2<\/em><\/strong><\/p>\r\n<p>7. \u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165<em>VM\u57f7\u884c\u500b\u9ad4\u7684\u5916\u90e8IP<\/em>\uff0c\u82e5\u770b\u5230\u4ee5\u4e0bApache\u7684\u9810\u8a2d\u9996\u9801\uff0c\u5373\u4ee3\u8868\u60a8\u7684Apache server\u5b89\u88dd\u5b8c\u6210\u4e26\u5df2\u555f\u52d5\u5c0d\u5916\u670d\u52d9\u3002<\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/07.jpg\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" srcset=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/07.jpg 520w, https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/11\/07-300x241.jpg 300w\" alt=\"\" width=\"562\" height=\"452\" \/><\/p>\r\n<p style=\"text-align: center;\">\u9019\u6a23\u5c31\u5927\u529f\u544a\u6210\u5566! \u662f\u4e0d\u662f\u6e05\u695a\u7c21\u55ae\u53c8\u5feb\u901f\u5462?\u00a0<\/p>\r\n<p style=\"text-align: center;\">\u82e5\u60f3\u4e86\u89e3\u5b8c\u6574\u61c9\u7528\uff0c\u8acb\u6301\u7e8c\u95dc\u6ce8<a href=\"https:\/\/www.microfusion.cloud\/hk\/architect-gcp\/\">\u5b8f\u5ead\u67b6\u69cb\u5e2b\u5c08\u6b04<\/a>\uff0c\u82e5\u6709\u4efb\u4f55 \u96f2\u7aef\u9700\u6c42\uff0c\u4e5f\u6b61\u8fce\u96a8\u6642\u8207\u6211\u5011\u806f\u7e6b\u5594!<\/p>\r\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.microfusion.cloud\/hk\/contact\/\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/mf-web-plugin-hk.storage.googleapis.com\/wp-content\/uploads\/2020\/02\/%E8%81%AF%E7%B5%A1%E6%88%91%E5%80%91.png\" alt=\"\" width=\"185\" height=\"103\" \/><\/a><\/p>\r\n<p>\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":7826,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[173],"tags":[],"class_list":["post-11941","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical_gcp"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/posts\/11941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/comments?post=11941"}],"version-history":[{"count":6,"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/posts\/11941\/revisions"}],"predecessor-version":[{"id":20314,"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/posts\/11941\/revisions\/20314"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/media\/7826"}],"wp:attachment":[{"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/media?parent=11941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/categories?post=11941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.microfusion.cloud\/hk\/wp-json\/wp\/v2\/tags?post=11941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}