{"id":1999,"date":"2020-01-05T22:45:03","date_gmt":"2020-01-05T22:45:03","guid":{"rendered":"http:\/\/www.itersdesktop.com\/?p=1999"},"modified":"2020-01-05T22:45:05","modified_gmt":"2020-01-05T22:45:05","slug":"building-a-web-server-in-virtualbox","status":"publish","type":"post","link":"https:\/\/www.itersdesktop.com\/vi\/2020\/01\/05\/building-a-web-server-in-virtualbox\/","title":{"rendered":"M\u1ed9t gi\u1ea3i ph\u00e1p \u0111\u1ed3ng b\u1ed9 c\u01a1 s\u1edf d\u1eef li\u00eau cho m\u00e1y t\u00ednh ch\u1ea1y song song nhi\u1ec1u h\u1ec7 \u0111i\u1ec1u h\u00e0nh"},"content":{"rendered":"<p>[dropcap]N[\/dropcap]g\u00e0y nay, v\u1edbi s\u1ef1 ph\u00e1t tri\u1ec3n m\u1ea1nh m\u1ebd ph\u1ea7n c\u1ee9ng m\u00e1y t\u00ednh k\u00e9o theo nhi\u1ec1u ng\u01b0\u1eddi mong mu\u1ed1n tr\u1ea3i nghi\u1ec7m v\u00e0i h\u1ec7 \u0111i\u1ec1u h\u00e0nh tr\u00ean c\u00f9ng m\u1ed9t chi\u1ebfc m\u00e1y t\u00ednh. M\u00e1y t\u00ednh c\u00f3 th\u1ec3 n\u00e2ng c\u1ea5p th\u00eam b\u1ed9 m\u1edb RAM c\u0169ng nh\u01b0 t\u1ed1c \u0111\u1ed9 CPU v\u00e0 dung l\u01b0\u1ee3ng \u1ed5 c\u1ee9ng, cho ph\u00e9p b\u1ea1n tha h\u1ed3 ph\u00e2n chia (partition) \u1ed5 c\u1ee9ng th\u00e0nh nhi\u1ec1u ph\u00e2n v\u00f9ng. M\u1ed7i ph\u00e2n v\u00f9ng c\u00e0i \u0111\u1eb7t m\u1ed9t h\u1ec7 \u0111i\u1ec1u h\u00e0nh y\u00eau th\u00edch. V\u00e0 l\u1ebd d\u0129 nhi\u00ean, ch\u00fang ta mu\u1ed1n c\u00f3 m\u1ed9t m\u00e1y ch\u1ee7 d\u1eef li\u1ec7u \u0111\u1ec3 c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng \u0111\u01b0\u1ee3c m\u1ed7i khi b\u1ea1n \u0111\u0103ng nh\u1eadp v\u00e0o t\u1eebng h\u1ec7 \u0111i\u1ec1u h\u00e0nh n\u00f3i tr\u00ean.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a1550c5b450f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a1550c5b450f\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.itersdesktop.com\/vi\/2020\/01\/05\/building-a-web-server-in-virtualbox\/#muc-tieu\" >M\u1ee5c ti\u00eau<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.itersdesktop.com\/vi\/2020\/01\/05\/building-a-web-server-in-virtualbox\/#y-tuong\" >\u00dd t\u01b0\u1edfng<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.itersdesktop.com\/vi\/2020\/01\/05\/building-a-web-server-in-virtualbox\/#cac-buoc-thuc-hien\" >C\u00e1c b\u01b0\u1edbc th\u1ef1c hi\u1ec7n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.itersdesktop.com\/vi\/2020\/01\/05\/building-a-web-server-in-virtualbox\/#kiem-thu\" >Ki\u1ec3m th\u1eed<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"muc-tieu\"><\/span><strong><span style=\"color: #003366;\">M\u1ee5c ti\u00eau<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>B\u00e0i vi\u1ebft n\u00e0y tr\u00ecnh b\u00e0y c\u00e1ch th\u1ee9c d\u1ef1ng m\u1ed9t m\u00e1y ch\u1ee7, g\u1ecdi l\u00e0 m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u, nh\u1eb1m \u0111\u1ed3ng b\u1ed9 h\u00f3a c\u01a1 s\u1ee1 d\u1eef li\u1ec7u cho c\u00e1c m\u00e1y t\u00ednh ch\u1ea1y song song nhi\u1ec1u h\u1ec7 \u0111i\u1ec1u h\u00e0nh. B\u00e0i vi\u1ebft l\u00e0 m\u1ed9t gi\u1ea3i ph\u00e1p gi\u00fap cho nh\u1eefng ai c\u00f3 nhu c\u1ea7u s\u1eed d\u1ee5ng \u0111\u1ec3 qu\u1ea3n l\u00ed th\u1ed1ng nh\u1ea5t c\u01a1 s\u1edf d\u1eef li\u1ec7u tr\u00ean nhi\u1ec1u h\u1ec7 \u0111i\u1ec1u h\u00e0nh.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"y-tuong\"><\/span><span style=\"color: #003366;\"><strong>\u00dd t\u01b0\u1edfng<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>D\u00f9ng m\u1ed9t m\u00e1y \u1ea3o Linux l\u00e0m m\u00e1y ch\u1ee7. Tr\u00ean \u0111\u00f3, ch\u00fang ta c\u00e0i \u0111\u1eb7t m\u1ed9t h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u n\u00e0o \u0111\u00f3 v\u00e0 bi\u1ebfn n\u00f3 tr\u1edf th\u00e0nh m\u1ed9t m\u00e1y t\u00ednh c\u00f3 th\u1ec3 truy c\u1eadp t\u1eeb xa \u0111\u1ec3 k\u1ebft n\u1ed1i v\u00e0o c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u1ea7n l\u00e0m vi\u1ec7c.<\/p>\n<p>\u0110\u1ec3 d\u1ec5 theo d\u00f5i, trong b\u00e0i n\u00e0y t\u00f4i ch\u1ecdn m\u00e1y \u1ea3o Ubuntu l\u00e0m minh h\u1ecda cho b\u00e0i vi\u1ebft t\u1eeb ph\u1ea7n n\u00e0y tr\u1edf \u0111i.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"cac-buoc-thuc-hien\"><\/span><span style=\"color: #003366;\"><strong>C\u00e1c b\u01b0\u1edbc th\u1ef1c hi\u1ec7n<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>[box type=&#8221;note&#8221; align=&#8221;aligncenter&#8221; ]M\u1ed9t v\u00e0i th\u00f4ng tin \u0111\u01b0\u1ee3c gi\u1ea3 \u0111\u1ecbnh \u0111\u1ec3 ti\u1ec7n theo d\u00f5i c\u00e1c b\u01b0\u1edbc th\u1ef1c hi\u1ec7n<\/p>\n<ul>\n<li>H\u1ec7 \u0111i\u1ec1u h\u00e0nh tr\u00ean m\u00e1y th\u1eadt: Windows 10, tr\u00ean m\u00e1y \u1ea3o: Ubuntu 14.04<\/li>\n<li>IP address c\u1ea5p cho m\u00e1y th\u1eadt v\u00e0 \u1ea3o: 192.168.1.2 v\u00e0 192.168.1.10<\/li>\n<li>C\u00e0i \u0111\u1eb7t MySQL Server 5.6<\/li>\n<\/ul>\n<p>[\/box]<\/p>\n<p>B\u01b0\u1edbc 1: X\u00e2y d\u1ef1ng m\u1ed9t m\u00e1y \u1ea3o v\u1edbi\/ch\u1ea1y tr\u00ean n\u1ec1n VirtualBox.<br \/>\nXem b\u00e0i&nbsp; <a href=\"#\">T\u1ea1o m\u1ed9t m\u00e1y \u1ea3o v\u1edbi ph\u1ea7n m\u1ec1m VirtualBox<\/a> d\u00e0nh cho nh\u1eefng ai kh\u00f4ng qu\u00e1 quen v\u1edbi g\u00f5 l\u1ec7nh t\u1eeb terminal. Ri\u00eang t\u00f4i, khuy\u1ebfn kh\u00edch c\u00e1c b\u1ea1n <a href=\"#\">d\u00f9ng vagrant \u0111\u1ec3 t\u1ea1o v\u00e0 qu\u1ea3n l\u00ed m\u1ed9t m\u00e1y \u1ea3o ch\u1ea1y tr\u00ean n\u1ec1n VirtualBox<\/a>.<\/p>\n<p>V\u00ed d\u1ee5, sau khi d\u00f9ng <span class=\"lang:default decode:true crayon-inline \">vagrant init ubuntu\/trusty64<\/span>&nbsp; \u0111\u1ec3 kh\u1edfi t\u1ea1o m\u1ed9t m\u00e1y \u1ea3o nh\u00e2n Linux\/Ubuntu x86_64, k\u1ebf \u0111\u1ebfn b\u1ea1n kh\u1edfi \u0111\u1ed9ng m\u00e1y \u1ea3o b\u1eb1ng l\u1ec7nh <span class=\"lang:default decode:true crayon-inline \">vagrant up<\/span>&nbsp;.<\/p>\n<p>B\u01b0\u1edbc 2: C\u1ea5u h\u00ecnh \u0111\u1ec3 m\u00e1y \u1ea3o (guest) v\u00e0 m\u00e1y th\u1eadt (host) c\u00f3 th\u1ec3 giao ti\u1ebfp (trao \u0111\u1ed5i) v\u1edbi nhau, t\u1ee9c l\u00e0 khi ping c\u00f3 th\u1ec3 th\u1ea5y nhau.<\/p>\n<p>Ng\u1ea7m \u0111\u1ecbnh, khi t\u1ea1o m\u1ed9t m\u00e1y \u1ea3o v\u1edbi vagrant th\u00ec<\/p>\n<p>B\u01b0\u1edbc 3: C\u00e0i \u0111\u1eb7t MySQL Server 5.6&nbsp; tr\u00ean m\u00e1y \u1ea3o<\/p>\n<p>L\u1ec7nh \u0111\u1ec3 c\u00e0i \u0111\u1eb7t: sudo apt-get install mysql-server-5.6<\/p>\n<p>N\u1ebfu kh\u00f4ng c\u00f3 tr\u1ee5c tr\u1eb7c x\u1ea3y ra trong su\u1ed1t qu\u00e1 tr\u00ecnh c\u00e0i \u0111\u1eb7t, b\u1ea1n c\u00f3 th\u1ec3 th\u1eed xem vi\u1ec7c c\u00e0i \u0111\u1eb7t c\u00f3 th\u00e0nh c\u00f4ng hay kh\u00f4ng b\u1eb1ng m\u1ed9t trong c\u00e1c c\u00e1ch sau.<\/p>\n<p>B\u01b0\u1edbc 4: Ki\u1ec3m tra<\/p>\n<p>M\u1edf tr\u00ecnh duy\u1ec7t<\/p>\n<h3><span class=\"ez-toc-section\" id=\"kiem-thu\"><\/span><strong><span style=\"color: #003366;\">Ki\u1ec3m th\u1eed<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u0110\u1ec3 c\u00f3 th\u1ec3 ki\u1ec3m tra m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u l\u00e0m vi\u1ec7c t\u1ed1t, tr\u00ean m\u00e1y host, b\u1ea1n t\u1ea1o m\u1ed9t \u1ee9ng d\u1ee5ng web nh\u1ecf nh\u1eb9 truy c\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u t\u1ea1o tr\u00ean m\u00e1y \u1ea3o. Trong t\u00ecnh hu\u1ed1ng n\u00e0y, \u1ee9ng d\u1ee5ng tr\u00ean m\u00e1y th\u1eadt s\u1ebd k\u1ebft n\u1ed1i \u0111\u1ebfn c\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c t\u1ea1o v\u00e0 l\u01b0u tr\u1eef tr\u00ean m\u1ed9t m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u t\u1eeb xa.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>[dropcap]N[\/dropcap]g\u00e0y nay, v\u1edbi s\u1ef1 ph\u00e1t tri\u1ec3n m\u1ea1nh m\u1ebd ph\u1ea7n c\u1ee9ng m\u00e1y t\u00ednh k\u00e9o theo nhi\u1ec1u ng\u01b0\u1eddi mong mu\u1ed1n tr\u1ea3i nghi\u1ec7m v\u00e0i h\u1ec7 \u0111i\u1ec1u h\u00e0nh tr\u00ean c\u00f9ng m\u1ed9t chi\u1ebfc m\u00e1y t\u00ednh.&hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[174,210,4,222,637],"tags":[527,293,528,393,294,573],"class_list":["post-1999","post","type-post","status-publish","format-standard","hentry","category-linux","category-networking","category-web-engineering","category-web-programming","category-web-server","tag-apache2","tag-lampp","tag-serveur-web","tag-virtualbox","tag-web-server","tag-xampp"],"_links":{"self":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/1999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/comments?post=1999"}],"version-history":[{"count":14,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/1999\/revisions"}],"predecessor-version":[{"id":3112,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/1999\/revisions\/3112"}],"wp:attachment":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/media?parent=1999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/categories?post=1999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/tags?post=1999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}