{"id":35032,"date":"2024-10-08T14:07:13","date_gmt":"2024-10-08T07:07:13","guid":{"rendered":"http:\/\/jupitek.maudemo.vip\/index.php\/2024\/10\/08\/a-beginners-guide-to-lxd-setting-up-an-apache-web-server\/"},"modified":"2024-10-08T14:07:13","modified_gmt":"2024-10-08T07:07:13","slug":"a-beginners-guide-to-lxd-setting-up-an-apache-web-server","status":"publish","type":"post","link":"https:\/\/jupitek.maudemo.vip\/index.php\/2024\/10\/08\/a-beginners-guide-to-lxd-setting-up-an-apache-web-server\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn LXD cho ng\u01b0\u1eddi m\u1edbi: C\u00e0i \u0111\u1eb7t Apache Web Server"},"content":{"rendered":"<h2 id=\"what-is-lxd\">LXD l\u00e0 g\u00ec?<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#what-is-lxd\"><\/a><\/h2>\n<p><a href=\"https:\/\/linuxcontainers.org\/lxd\/\" target=\"_blank\" rel=\"noreferrer noopener\">LXD<\/a>&nbsp;(ph\u00e1t \u00e2m l\u00e0 \u201cLex-Dee\u201d) l\u00e0 tr\u00ecnh qu\u1ea3n l\u00fd v\u00f9ng ch\u1ee9a h\u1ec7 th\u1ed1ng \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng tr\u00ean LXC (Linux Containers) hi\u1ec7n \u0111ang \u0111\u01b0\u1ee3c Canonical h\u1ed7 tr\u1ee3. M\u1ee5c ti\u00eau c\u1ee7a LXD l\u00e0 cung c\u1ea5p tr\u1ea3i nghi\u1ec7m t\u01b0\u01a1ng t\u1ef1 nh\u01b0 m\u00e1y \u1ea3o nh\u01b0ng th\u00f4ng qua container h\u00f3a thay v\u00ec \u1ea3o h\u00f3a ph\u1ea7n c\u1ee9ng. So v\u1edbi Docker \u0111\u1ec3 ph\u00e2n ph\u1ed1i \u1ee9ng d\u1ee5ng, LXD cung c\u1ea5p ch\u1ee9c n\u0103ng h\u1ec7 \u0111i\u1ec1u h\u00e0nh g\u1ea7n nh\u01b0 \u0111\u1ea7y \u0111\u1ee7 v\u1edbi c\u00e1c t\u00ednh n\u0103ng b\u1ed5 sung nh\u01b0 \u1ea3nh ch\u1ee5p nhanh, di chuy\u1ec3n tr\u1ef1c ti\u1ebfp v\u00e0 qu\u1ea3n l\u00fd l\u01b0u tr\u1eef.<\/p>\n<p>L\u1ee3i \u00edch ch\u00ednh c\u1ee7a LXD l\u00e0 h\u1ed7 tr\u1ee3 c\u00e1c container m\u1eadt \u0111\u1ed9 cao v\u00e0 hi\u1ec7u su\u1ea5t m\u00e0 n\u00f3 mang l\u1ea1i so v\u1edbi m\u00e1y \u1ea3o. M\u1ed9t m\u00e1y t\u00ednh c\u00f3 RAM 2GB c\u00f3 th\u1ec3 h\u1ed7 tr\u1ee3 \u0111\u1ea7y \u0111\u1ee7 n\u1eeda t\u00e1 container. Ngo\u00e0i ra, LXD ch\u00ednh th\u1ee9c h\u1ed7 tr\u1ee3 c\u00e1c&nbsp;<a href=\"https:\/\/us.images.linuxcontainers.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">h\u00ecnh \u1ea3nh container c\u1ee7a c\u00e1c b\u1ea3n ph\u00e2n ph\u1ed1i Linux ch\u00ednh<\/a>&nbsp;. Ch\u00fang ta c\u00f3 th\u1ec3 ch\u1ecdn b\u1ea3n ph\u00e2n ph\u1ed1i Linux v\u00e0 phi\u00ean b\u1ea3n \u0111\u1ec3 ch\u1ea1y trong container.<\/p>\n<p>H\u01b0\u1edbng d\u1eabn n\u00e0y tr\u00ecnh b\u00e0y c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 thi\u1ebft l\u1eadp LXD 3 tr\u00ean Linode v\u00e0 c\u00e1ch thi\u1ebft l\u1eadp m\u00e1y ch\u1ee7 web Apache trong v\u00f9ng ch\u1ee9a.<\/p>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: \u0110\u1ec3 \u0111\u01a1n gi\u1ea3n, thu\u1eadt ng\u1eef&nbsp;<em>container<\/em>&nbsp;\u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong to\u00e0n b\u1ed9 h\u01b0\u1edbng d\u1eabn n\u00e0y \u0111\u1ec3 m\u00f4 t\u1ea3 c\u00e1c container c\u1ee7a h\u1ec7 th\u1ed1ng LXD.<\/p>\n<h2 id=\"before-you-begin\">Tr\u01b0\u1edbc khi b\u1ea1n b\u1eaft \u0111\u1ea7u<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#before-you-begin\"><\/a><\/h2>\n<ol>\n<li>Ho\u00e0n t\u1ea5t h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/compute\/compute-instances\/guides\/create\/\">T\u1ea1o phi\u00ean b\u1ea3n t\u00ednh to\u00e1n<\/a>&nbsp;. Ch\u1ecdn Linode c\u00f3 \u00edt nh\u1ea5t 2GB b\u1ed9 nh\u1edb RAM, ch\u1eb3ng h\u1ea1n nh\u01b0 Linode 2GB. Ch\u1ec9 \u0111\u1ecbnh b\u1ea3n ph\u00e2n ph\u1ed1i Ubuntu 19.04. B\u1ea1n c\u00f3 th\u1ec3 ch\u1ec9 \u0111\u1ecbnh m\u1ed9t b\u1ea3n ph\u00e2n ph\u1ed1i Linux kh\u00e1c, mi\u1ec5n l\u00e0 c\u00f3 h\u1ed7 tr\u1ee3 cho&nbsp;<strong>c\u00e1c g\u00f3i snap (snapd)<\/strong>&nbsp;; xem&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#more-information\">Th\u00f4ng tin th\u00eam<\/a>&nbsp;\u0111\u1ec3 bi\u1ebft th\u00eam chi ti\u1ebft.<\/li>\n<li>L\u00e0m theo h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/compute\/compute-instances\/guides\/set-up-and-secure\/\">Thi\u1ebft l\u1eadp v\u00e0 B\u1ea3o m\u1eadt Phi\u00ean b\u1ea3n Compute<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i \u0111\u1ec3 c\u1eadp nh\u1eadt h\u1ec7 th\u1ed1ng c\u1ee7a b\u1ea1n. B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 mu\u1ed1n \u0111\u1eb7t m\u00fai gi\u1edd, c\u1ea5u h\u00ecnh t\u00ean m\u00e1y ch\u1ee7, t\u1ea1o t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng gi\u1edbi h\u1ea1n v\u00e0 t\u0103ng c\u01b0\u1eddng quy\u1ec1n truy c\u1eadp SSH.<\/li>\n<\/ol>\n<h2 id=\"configure-the-snap-package-support\">C\u1ea5u h\u00ecnh H\u1ed7 tr\u1ee3 G\u00f3i Snap<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#configure-the-snap-package-support\"><\/a><\/h2>\n<p>LXD c\u00f3 s\u1eb5n d\u01b0\u1edbi d\u1ea1ng g\u00f3i Debian trong c\u00e1c phi\u00ean b\u1ea3n h\u1ed7 tr\u1ee3 d\u00e0i h\u1ea1n (LTS) c\u1ee7a Ubuntu, ch\u1eb3ng h\u1ea1n nh\u01b0 Ubuntu 18.04 LTS. \u0110\u1ed1i v\u1edbi c\u00e1c phi\u00ean b\u1ea3n Ubuntu v\u00e0 c\u00e1c b\u1ea3n ph\u00e2n ph\u1ed1i kh\u00e1c, LXD c\u00f3 s\u1eb5n d\u01b0\u1edbi d\u1ea1ng g\u00f3i snap. C\u00e1c g\u00f3i snap l\u00e0 c\u00e1c g\u00f3i chung v\u00ec c\u00f3 m\u1ed9t t\u1ec7p g\u00f3i duy nh\u1ea5t ho\u1ea1t \u0111\u1ed9ng tr\u00ean b\u1ea5t k\u1ef3 b\u1ea3n ph\u00e2n ph\u1ed1i Linux n\u00e0o \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3. Xem ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#more-information\">Th\u00f4ng tin th\u00eam<\/a>&nbsp;\u0111\u1ec3 bi\u1ebft th\u00eam chi ti\u1ebft v\u1ec1 g\u00f3i snap l\u00e0 g\u00ec, c\u00e1c b\u1ea3n ph\u00e2n ph\u1ed1i Linux n\u00e0o \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 v\u00e0 c\u00e1ch thi\u1ebft l\u1eadp g\u00f3i n\u00e0y.<\/p>\n<p>1.X\u00e1c minh r\u1eb1ng snap support \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t \u0111\u00fang. L\u1ec7nh sau \u0111\u00e2y cho th\u1ea5y kh\u00f4ng c\u00f3 g\u00f3i snap n\u00e0o \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t ho\u1eb7c m\u1ed9t s\u1ed1 \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t.<\/p>\n<pre class=\"wp-block-code\"><code>snap list\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>No snaps are installed yet. Try 'snap install hello-world'.\n<\/code><\/pre>\n<p>2.Xem chi ti\u1ebft v\u1ec1 g\u00f3i snap LXD&nbsp;<code>lxd<\/code>. \u0110\u1ea7u ra b\u00ean d\u01b0\u1edbi cho th\u1ea5y r\u1eb1ng, hi\u1ec7n t\u1ea1i, phi\u00ean b\u1ea3n LXD m\u1edbi nh\u1ea5t n\u1eb1m&nbsp;<code>3.12<\/code>trong k\u00eanh m\u1eb7c \u0111\u1ecbnh&nbsp;<code>stable<\/code>. K\u00eanh n\u00e0y th\u01b0\u1eddng xuy\u00ean \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt v\u1edbi c\u00e1c t\u00ednh n\u0103ng m\u1edbi. Ngo\u00e0i ra c\u00f2n c\u00f3 c\u00e1c k\u00eanh kh\u00e1c nh\u01b0 k\u00eanh&nbsp;<code>3.0\/stable<\/code>c\u00f3 phi\u00ean b\u1ea3n LXD LTS (\u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 c\u00f9ng v\u1edbi Ubuntu 18.04, cho \u0111\u1ebfn n\u0103m 2023) v\u00e0&nbsp;<code>2.0\/stable<\/code>k\u00eanh (\u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 c\u00f9ng v\u1edbi Ubuntu 16.04, cho \u0111\u1ebfn n\u0103m 2021). Ch\u00fang t\u00f4i s\u1ebd s\u1eed d\u1ee5ng phi\u00ean b\u1ea3n LXD m\u1edbi nh\u1ea5t t\u1eeb \u200b\u200bk\u00eanh m\u1eb7c \u0111\u1ecbnh&nbsp;<code>stable<\/code>.<\/p>\n<pre class=\"wp-block-code\"><code>snap info lxd\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>name:      lxd\nsummary:   System container manager and API\npublisher: Canonical\u2713\ncontact:   https:\/\/github.com\/lxc\/lxd\/issues\nlicense:   Apache-2.0\ndescription: |\n  **LXD is a system container manager**\n\n  With LXD you can run hundreds of containers of a variety of Linux\n  distributions, apply resource limits, pass in directories, USB devices\n  or GPUs and setup any network and storage you want.\n\n  LXD containers are lightweight, secure by default and a great\n  alternative to running Linux virtual machines.\n\n\n  **Run any Linux distribution you want**\n\n  Pre-made images are available for Ubuntu, Alpine Linux, ArchLinux,\n  CentOS, Debian, Fedora, Gentoo, openSUSE and more.\n\n  A full list of available images can be &#91;found\n  here](https:\/\/images.linuxcontainers.org)\n\n  Can't find the distribution you want? It's easy to make your own images\n  too, either using our `distrobuilder` tool or by assembling your own image\n  tarball by hand.\n\n\n  **Containers at scale**\n\n  LXD is network aware and all interactions go through a simple REST API,\n  making it possible to remotely interact with containers on remote\n  systems, copying and moving them as you wish.\n\n  Want to go big? LXD also has built-in clustering support,\n  letting you turn dozens of servers into one big LXD server.\n\n\n  **Configuration options**\n\n  Supported options for the LXD snap (`snap set lxd KEY=VALUE`):\n   - criu.enable: Enable experimental live-migration support &#91;default=false]\n   - daemon.debug: Increases logging to debug level &#91;default=false]\n   - daemon.group: Group of users that can interact with LXD &#91;default=lxd]\n   - ceph.builtin: Use snap-specific ceph configuration &#91;default=false]\n   - openvswitch.builtin: Run a snap-specific OVS daemon &#91;default=false]\n\n  &#91;Documentation](https:\/\/lxd.readthedocs.io)\nsnap-id: J60k4JY0HppjwOjW8dZdYc8obXKxujRu\nchannels:\n  stable:        3.12        2019-04-16 (10601) 56MB -\n  candidate:     3.12        2019-04-26 (10655) 56MB -\n  beta:          \u2191\n  edge:          git-570aaa1 2019-04-27 (10674) 56MB -\n  3.0\/stable:    3.0.3       2018-11-26  (9663) 53MB -\n  3.0\/candidate: 3.0.3       2019-01-19  (9942) 53MB -\n  3.0\/beta:      \u2191\n  3.0\/edge:      git-eaa62ce 2019-02-19 (10212) 53MB -\n  2.0\/stable:    2.0.11      2018-07-30  (8023) 28MB -\n  2.0\/candidate: 2.0.11      2018-07-27  (8023) 28MB -\n  2.0\/beta:      \u2191\n  2.0\/edge:      git-c7c4cc8 2018-10-19  (9257) 26MB -\n<\/code><\/pre>\n<p>3.C\u00e0i \u0111\u1eb7t&nbsp;<code>lxd<\/code>g\u00f3i snap. Ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 c\u00e0i \u0111\u1eb7t g\u00f3i snap cho LXD.<\/p>\n<pre class=\"wp-block-code\"><code>sudo snap install lxd\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>lxd 3.12 from Canonical\u2713 installed\n<\/code><\/pre>\n<p>B\u1ea1n c\u00f3 th\u1ec3 x\u00e1c minh r\u1eb1ng g\u00f3i snap \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t b\u1eb1ng c\u00e1ch ch\u1ea1y&nbsp;<code>snap list<\/code>l\u1ea1i.&nbsp;<code>core<\/code>G\u00f3i snap l\u00e0 \u0111i\u1ec1u ki\u1ec7n ti\u00ean quy\u1ebft cho b\u1ea5t k\u1ef3 h\u1ec7 th\u1ed1ng n\u00e0o c\u00f3 h\u1ed7 tr\u1ee3 g\u00f3i snap. Khi b\u1ea1n c\u00e0i \u0111\u1eb7t g\u00f3i snap \u0111\u1ea7u ti\u00ean,&nbsp;<code>core<\/code>n\u00f3 s\u1ebd \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t v\u00e0 chia s\u1ebb gi\u1eefa t\u1ea5t c\u1ea3 c\u00e1c g\u00f3i snap kh\u00e1c s\u1ebd \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t trong t\u01b0\u01a1ng lai.<\/p>\n<pre class=\"wp-block-code\"><code>snap list\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Name  Version  Rev    Tracking  Publisher   Notes\ncore  16-2.38  6673   stable    canonical\u2713  core\nlxd   3.12     10601  stable    canonical\u2713  -<\/code><\/pre>\n<h2 id=\"initialize-lxd\">Kh\u1edfi t\u1ea1o LXD<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#initialize-lxd\"><\/a><\/h2>\n<p>1.Th\u00eam ng\u01b0\u1eddi d\u00f9ng Unix kh\u00f4ng ph\u1ea3i root v\u00e0o&nbsp;<code>lxd<\/code>nh\u00f3m:<\/p>\n<pre class=\"wp-block-code\"><code>sudo usermod -a -G lxd username\n<\/code><\/pre>\n<p>1.Ghi ch\u00faB\u1eb1ng c\u00e1ch th\u00eam t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng Unix kh\u00f4ng ph\u1ea3i root v\u00e0o&nbsp;<code>lxd<\/code>nh\u00f3m, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y b\u1ea5t k\u1ef3&nbsp;<code>lxc<\/code>l\u1ec7nh n\u00e0o m\u00e0 kh\u00f4ng c\u1ea7n th\u00eam&nbsp;<code>sudo<\/code>. N\u1ebfu kh\u00f4ng c\u00f3 ph\u1ea7n b\u1ed5 sung n\u00e0y, b\u1ea1n s\u1ebd c\u1ea7n ph\u1ea3i th\u00eam&nbsp;<code>sudo<\/code>v\u00e0o m\u1ed7i&nbsp;<code>lxc<\/code>l\u1ec7nh.<\/p>\n<p>2.B\u1eaft \u0111\u1ea7u phi\u00ean SSH m\u1edbi \u0111\u1ec3 thay \u0111\u1ed5i tr\u01b0\u1edbc \u0111\u00f3 c\u00f3 hi\u1ec7u l\u1ef1c. V\u00ed d\u1ee5: \u0111\u0103ng xu\u1ea5t v\u00e0 \u0111\u0103ng nh\u1eadp l\u1ea1i.<\/p>\n<p>3.Ki\u1ec3m tra dung l\u01b0\u1ee3ng \u0111\u0129a tr\u1ed1ng kh\u1ea3 d\u1ee5ng:<\/p>\n<pre class=\"wp-block-code\"><code>df -h \/<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Filesystem      Size  Used Avail Use% Mounted on\n\/dev\/sda         49G  2.0G   45G   5% \/<\/code><\/pre>\n<p>Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y c\u00f3 45GB dung l\u01b0\u1ee3ng \u0111\u0129a tr\u1ed1ng. LXD y\u00eau c\u1ea7u \u00edt nh\u1ea5t 15GB dung l\u01b0\u1ee3ng cho nhu c\u1ea7u l\u01b0u tr\u1eef c\u1ee7a container. Ch\u00fang t\u00f4i s\u1ebd ph\u00e2n b\u1ed5 15GB dung l\u01b0\u1ee3ng cho LXD, \u0111\u1ec3 l\u1ea1i 30GB dung l\u01b0\u1ee3ng tr\u1ed1ng cho nhu c\u1ea7u c\u1ee7a m\u00e1y ch\u1ee7.<\/p>\n<p>4.Ch\u1ea1y&nbsp;<code>lxd init<\/code>\u0111\u1ec3 kh\u1edfi t\u1ea1o LXD:<\/p>\n<pre class=\"wp-block-code\"><code>sudo lxd init<\/code><\/pre>\n<p>B\u1ea1n s\u1ebd \u0111\u01b0\u1ee3c nh\u1eafc nhi\u1ec1u l\u1ea7n trong qu\u00e1 tr\u00ecnh kh\u1edfi t\u1ea1o. Ch\u1ecdn m\u1eb7c \u0111\u1ecbnh cho t\u1ea5t c\u1ea3 c\u00e1c t\u00f9y ch\u1ecdn.<\/p>\n<pre class=\"wp-block-code\"><code>Would you like to use LXD clustering? (yes\/no) &#91;default=no]:\nDo you want to configure a new storage pool? (yes\/no) &#91;default=yes]:\nName of the new storage pool &#91;default=default]:\nName of the storage backend to use (btrfs, ceph, dir, lvm, zfs) &#91;default=zfs]:\nCreate a new ZFS pool? (yes\/no) &#91;default=yes]:\nWould you like to use an existing block device? (yes\/no) &#91;default=no]:\nSize in GB of the new loop device (1GB minimum) &#91;default=15GB]:\nWould you like to connect to a MAAS server? (yes\/no) &#91;default=no]:\nWould you like to create a new local network bridge? (yes\/no) &#91;default=yes]:\nWhat should the new bridge be called? &#91;default=lxdbr0]:\nWhat IPv4 address should be used? (CIDR subnet notation, \u201cauto\u201d or \u201cnone\u201d) &#91;default=auto]:\nWhat IPv6 address should be used? (CIDR subnet notation, \u201cauto\u201d or \u201cnone\u201d) &#91;default=auto]:\nWould you like LXD to be available over the network? (yes\/no) &#91;default=no]:\nWould you like stale cached images to be updated automatically? (yes\/no) &#91;default=yes]\nWould you like a YAML \"lxd init\" preseed to be printed? (yes\/no) &#91;default=no]:<\/code><\/pre>\n<h2 id=\"apache-web-server-with-lxd\">M\u00e1y ch\u1ee7 web Apache v\u1edbi LXD<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#apache-web-server-with-lxd\"><\/a><\/h2>\n<p>Ph\u1ea7n n\u00e0y s\u1ebd t\u1ea1o m\u1ed9t container, c\u00e0i \u0111\u1eb7t m\u00e1y ch\u1ee7 web Apache v\u00e0 th\u00eam&nbsp;<code>iptables<\/code>c\u00e1c quy t\u1eafc ph\u00f9 h\u1ee3p \u0111\u1ec3 \u0111\u01b0a ra phi\u00ean b\u1ea3n sau 80.<\/p>\n<p>1.Kh\u1edfi ch\u1ea1y m\u1ed9t container m\u1edbi:<\/p>\n<pre class=\"wp-block-code\"><code>lxc launch ubuntu:18.04 web\n<\/code><\/pre>\n<p>2.C\u1eadp nh\u1eadt danh s\u00e1ch g\u00f3i trong container.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec web -- apt update\n<\/code><\/pre>\n<p>3.C\u00e0i \u0111\u1eb7t Apache trong v\u00f9ng ch\u1ee9a LXD.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec web -- apt install apache2<\/code><\/pre>\n<p>4.L\u1ea5y m\u1ed9t v\u1ecf trong th\u00f9ng ch\u1ee9a LXD.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec web -- sudo --user ubuntu --login<\/code><\/pre>\n<p>5.Ch\u1ec9nh s\u1eeda trang web m\u1eb7c \u0111\u1ecbnh cho Apache \u0111\u1ec3 tham chi\u1ebfu \u0111\u1ebfn vi\u1ec7c n\u00f3 ch\u1ea1y b\u00ean trong v\u00f9ng ch\u1ee9a LXD.<\/p>\n<pre class=\"wp-block-code\"><code>sudo nano \/var\/www\/html\/index.html<\/code><\/pre>\n<p>\u0110\u1ed5i d\u00f2ng&nbsp;<code>It works!<\/code>(d\u00f2ng s\u1ed1 224) th\u00e0nh&nbsp;<code>It works inside a LXD container!<\/code>. Sau \u0111\u00f3, l\u01b0u v\u00e0 tho\u00e1t.<\/p>\n<p>6.Tho\u00e1t tr\u1edf l\u1ea1i m\u00e1y ch\u1ee7. Ch\u00fang t\u00f4i \u0111\u00e3 th\u1ef1c hi\u1ec7n t\u1ea5t c\u1ea3 c\u00e1c thay \u0111\u1ed5i c\u1ea7n thi\u1ebft cho v\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>exit<\/code><\/pre>\n<p>7.Th\u00eam&nbsp;<strong>thi\u1ebft b\u1ecb proxy<\/strong>&nbsp;LXD \u0111\u1ec3 chuy\u1ec3n h\u01b0\u1edbng k\u1ebft n\u1ed1i t\u1eeb internet \u0111\u1ebfn c\u1ed5ng 80 (HTTP) tr\u00ean m\u00e1y ch\u1ee7 \u0111\u1ebfn c\u1ed5ng 80 t\u1ea1i v\u00f9ng ch\u1ee9a n\u00e0y.<\/p>\n<pre class=\"wp-block-code\"><code>sudo lxc config device add web myport80 proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:80<\/code><\/pre>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: Trong c\u00e1c phi\u00ean b\u1ea3n LXD g\u1ea7n \u0111\u00e2y, b\u1ea1n c\u1ea7n ch\u1ec9 \u0111\u1ecbnh \u0111\u1ecba ch\u1ec9 IP (ch\u1eb3ng h\u1ea1n nh\u01b0&nbsp;<em>127.0.0.1<\/em>&nbsp;) thay v\u00ec t\u00ean m\u00e1y ch\u1ee7 (ch\u1eb3ng h\u1ea1n nh\u01b0&nbsp;<em>localhost<\/em>&nbsp;). N\u1ebfu v\u00f9ng ch\u1ee9a c\u1ee7a b\u1ea1n \u0111\u00e3 c\u00f3 thi\u1ebft b\u1ecb proxy s\u1eed d\u1ee5ng t\u00ean m\u00e1y ch\u1ee7, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ec9nh s\u1eeda c\u1ea5u h\u00ecnh v\u00f9ng ch\u1ee9a \u0111\u1ec3 thay th\u1ebf b\u1eb1ng \u0111\u1ecba ch\u1ec9 IP b\u1eb1ng c\u00e1ch ch\u1ea1y&nbsp;<code>lxc config edit web<\/code>.<\/p>\n<p>8.T\u1eeb m\u00e1y t\u00ednh c\u1ee5c b\u1ed9 c\u1ee7a b\u1ea1n, h\u00e3y \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn \u0111\u1ecba ch\u1ec9 IP c\u00f4ng khai c\u1ee7a Linode trong tr\u00ecnh duy\u1ec7t web. B\u1ea1n s\u1ebd th\u1ea5y trang Apache m\u1eb7c \u0111\u1ecbnh:<img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/apache-server-running-in-lxd-container_hu6e74c8f6c091fbbef4455ca483af132c_59955_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"Web page of Apache server running in a container\"><\/p>\n<h2 id=\"common-lxd-commands\">C\u00e1c l\u1ec7nh LXD ph\u1ed5 bi\u1ebfn<\/h2>\n<p>Li\u1ec7t k\u00ea t\u1ea5t c\u1ea3 c\u00e1c container:<\/p>\n<pre class=\"wp-block-code\"><code>lxc list\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>To start your first container, try: lxc launch ubuntu:18.04\n\n+------+-------+------+------+------+-----------+\n| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |\n+------+-------+------+------+------+-----------+<\/code><\/pre>\n<p>Li\u1ec7t k\u00ea t\u1ea5t c\u1ea3 c\u00e1c kho l\u01b0u tr\u1eef h\u00ecnh \u1ea3nh container c\u00f3 s\u1eb5n:<\/p>\n<pre class=\"wp-block-code\"><code>lxc remote list\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>+-----------------+------------------------------------------+---------------+-------------+--------+--------+\n|      NAME       |                   URL                    |   PROTOCOL    |  AUTH TYPE  | PUBLIC | STATIC |\n+-----------------+------------------------------------------+---------------+-------------+--------+--------+\n| images          | https:\/\/images.linuxcontainers.org       | simplestreams | none        | YES    | NO     |\n+-----------------+------------------------------------------+---------------+-------------+--------+--------+\n| local (default) | unix:\/\/                                  | lxd           | file access | NO     | YES    |\n+-----------------+------------------------------------------+---------------+-------------+--------+--------+\n| ubuntu          | https:\/\/cloud-images.ubuntu.com\/releases | simplestreams | none        | YES    | YES    |\n+-----------------+------------------------------------------+---------------+-------------+--------+--------+\n| ubuntu-daily    | https:\/\/cloud-images.ubuntu.com\/daily    | simplestreams | none        | YES    | YES    |\n+-----------------+------------------------------------------+---------------+-------------+--------+--------+<\/code><\/pre>\n<p>Kho l\u01b0u tr\u1eef&nbsp;<code>ubuntu<\/code>c\u00f3 c\u00e1c h\u00ecnh \u1ea3nh ch\u1ee9a c\u1ee7a c\u00e1c phi\u00ean b\u1ea3n Ubuntu. Kho&nbsp;<code>images<\/code>l\u01b0u tr\u1eef c\u00f3 c\u00e1c h\u00ecnh \u1ea3nh ch\u1ee9a c\u1ee7a nhi\u1ec1u b\u1ea3n ph\u00e2n ph\u1ed1i Linux kh\u00e1c nhau. C\u00f3&nbsp;<code>ubuntu-daily<\/code>c\u00e1c h\u00ecnh \u1ea3nh ch\u1ee9a h\u00e0ng ng\u00e0y \u0111\u1ec3 s\u1eed d\u1ee5ng cho m\u1ee5c \u0111\u00edch th\u1eed nghi\u1ec7m.&nbsp;<code>local<\/code>Kho l\u01b0u tr\u1eef l\u00e0 m\u00e1y ch\u1ee7 LXD m\u00e0 ch\u00fang t\u00f4i v\u1eeba c\u00e0i \u0111\u1eb7t. N\u00f3 kh\u00f4ng c\u00f4ng khai v\u00e0 c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 l\u01b0u tr\u1eef c\u00e1c h\u00ecnh \u1ea3nh ch\u1ee9a c\u1ee7a ri\u00eang b\u1ea1n.<\/p>\n<p>Li\u1ec7t k\u00ea t\u1ea5t c\u1ea3 c\u00e1c h\u00ecnh \u1ea3nh container c\u00f3 s\u1eb5n t\u1eeb kho l\u01b0u tr\u1eef:<\/p>\n<pre class=\"wp-block-code\"><code>lxc image list ubuntu:<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>+------------------+--------------+--------+-----------------------------------------------+---------+----------+-------------------------------+\n|      ALIAS       | FINGERPRINT  | PUBLIC |                  DESCRIPTION                  |  ARCH   |   SIZE   |          UPLOAD DATE          |\n+------------------+--------------+--------+-----------------------------------------------+---------+----------+-------------------------------+\n| b (11 more)      | 5b72cf46f628 | yes    | ubuntu 18.04 LTS amd64 (release) (20190424)   | x86_64  | 180.37MB | Apr 24, 2019 at 12:00am (UTC) |\n+------------------+--------------+--------+-----------------------------------------------+---------+----------+-------------------------------+\n| c (5 more)       | 4716703f04fc | yes    | ubuntu 18.10 amd64 (release) (20190402)       | x86_64  | 313.29MB | Apr 2, 2019 at 12:00am (UTC)  |\n+------------------+--------------+--------+-----------------------------------------------+---------+----------+-------------------------------+\n| d (5 more)       | faef94acf5f9 | yes    | ubuntu 19.04 amd64 (release) (20190417)       | x86_64  | 322.56MB | Apr 17, 2019 at 12:00am (UTC) |\n+------------------+--------------+--------+-----------------------------------------------+---------+----------+-------------------------------+\n.....................................................................<\/code><\/pre>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: Hai c\u1ed9t \u0111\u1ea7u ti\u00ean cho b\u00ed danh v\u00e0 d\u1ea5u v\u00e2n tay cung c\u1ea5p m\u1ed9t m\u00e3 \u0111\u1ecbnh danh c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 ch\u1ec9 \u0111\u1ecbnh h\u00ecnh \u1ea3nh ch\u1ee9a khi kh\u1edfi ch\u1ea1y n\u00f3.<\/p>\n<p>\u0110o\u1ea1n m\u00e3 \u0111\u1ea7u ra hi\u1ec3n th\u1ecb c\u00e1c h\u00ecnh \u1ea3nh container Ubuntu phi\u00ean b\u1ea3n 18.04 LTS, 18.10 v\u00e0 19.04. Khi t\u1ea1o m\u1ed9t container, ch\u00fang ta ch\u1ec9 c\u00f3 th\u1ec3 ch\u1ec9 \u0111\u1ecbnh b\u00ed danh ng\u1eafn. V\u00ed d\u1ee5,&nbsp;<code>ubuntu:b<\/code>c\u00f3 ngh\u0129a l\u00e0 kho l\u01b0u tr\u1eef l\u00e0&nbsp;<code>ubuntu<\/code>v\u00e0 h\u00ecnh \u1ea3nh container c\u00f3 b\u00ed danh ng\u1eafn&nbsp;<code>b<\/code>(\u0111\u1ed1i v\u1edbi&nbsp;<em>bionic<\/em>&nbsp;, t\u00ean m\u00e3 c\u1ee7a Ubuntu 18.04 LTS).<\/p>\n<p>T\u00ecm hi\u1ec3u th\u00eam th\u00f4ng tin v\u1ec1 h\u00ecnh \u1ea3nh container:<\/p>\n<pre class=\"wp-block-code\"><code>lxc image info ubuntu:b\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Fingerprint: 5b72cf46f628b3d60f5d99af48633539b2916993c80fc5a2323d7d841f66afbe\nSize: 180.37MB\nArchitecture: x86_64\nPublic: yes\nTimestamps:\n    Created: 2019\/04\/24 00:00 UTC\n    Uploaded: 2019\/04\/24 00:00 UTC\n    Expires: 2023\/04\/26 00:00 UTC\n    Last used: never\nProperties:\n    release: bionic\n    version: 18.04\n    architecture: amd64\n    label: release\n    serial: 20190424\n    description: ubuntu 18.04 LTS amd64 (release) (20190424)\n    os: ubuntu\nAliases:\n    - 18.04\n    - 18.04\/amd64\n    - b\n    - b\/amd64\n    - bionic\n    - bionic\/amd64\n    - default\n    - default\/amd64\n    - lts\n    - lts\/amd64\n    - ubuntu\n    - amd64\nCached: no\nAuto update: disabled<\/code><\/pre>\n<p>\u0110\u1ea7u ra hi\u1ec3n th\u1ecb chi ti\u1ebft c\u1ee7a h\u00ecnh \u1ea3nh container bao g\u1ed3m t\u1ea5t c\u1ea3 c\u00e1c b\u00ed danh c\u00f3 s\u1eb5n. \u0110\u1ed1i v\u1edbi Ubuntu 18.04 LTS, ch\u00fang ta c\u00f3 th\u1ec3 ch\u1ec9 \u0111\u1ecbnh&nbsp;<code>b<\/code>(\u0111\u1ed1i v\u1edbi&nbsp;<code>bionic<\/code>, t\u00ean m\u00e3 c\u1ee7a Ubuntu 18.04 LTS) ho\u1eb7c b\u1ea5t k\u1ef3 b\u00ed danh n\u00e0o kh\u00e1c.<\/p>\n<p>Kh\u1edfi ch\u1ea1y m\u1ed9t container m\u1edbi c\u00f3 t\u00ean&nbsp;<code>mycontainer<\/code>:<\/p>\n<pre class=\"wp-block-code\"><code>lxc launch ubuntu:18.04 mycontainer\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Creating mycontainer\nStarting mycontainer<\/code><\/pre>\n<p>Ki\u1ec3m tra danh s\u00e1ch container \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o container m\u1edbi \u0111ang ch\u1ea1y:<\/p>\n<pre class=\"wp-block-code\"><code>lxc list\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>+-------------+---------+-----------------------+---------------------------+------------+-----------+\n|    NAME     |  STATE  |         IPV4          |          IPV6             |    TYPE    | SNAPSHOTS |\n+-------------+---------+-----------------------+---------------------------+------------+-----------+\n| mycontainer | RUNNING | 10.142.148.244 (eth0) | fde5:5d27:...:1371 (eth0) | PERSISTENT | 0         |\n+-------------+---------+-----------------------+---------------------------+------------+-----------<\/code><\/pre>\n<p>Th\u1ef1c hi\u1ec7n c\u00e1c l\u1ec7nh c\u01a1 b\u1ea3n trong&nbsp;<code>mycontainer<\/code>:<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec mycontainer -- apt update\nlxc exec mycontainer -- apt upgrade<\/code><\/pre>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: C\u00e1c k\u00fd t\u1ef1 n\u00e0y&nbsp;<code>--<\/code>h\u01b0\u1edbng d\u1eabn&nbsp;<code>lxc<\/code>l\u1ec7nh kh\u00f4ng ph\u00e2n t\u00edch b\u1ea5t k\u1ef3 tham s\u1ed1 d\u00f2ng l\u1ec7nh n\u00e0o n\u1eefa.<\/p>\n<p>M\u1edf phi\u00ean shell trong&nbsp;<code>mycontainer<\/code>:<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec mycontainer -- sudo --login --user ubuntu\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>To run a command as administrator (user \"root\"), use \"sudo &lt;command&gt;\".\nSee \"man sudo_root\" for details.\n\nubuntu@mycontainer:~$<\/code><\/pre>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: Theo m\u1eb7c \u0111\u1ecbnh, \u1ea3nh container Ubuntu c\u00f3 t\u00e0i kho\u1ea3n kh\u00f4ng ph\u1ea3i root v\u1edbi t\u00ean ng\u01b0\u1eddi d\u00f9ng&nbsp;<code>ubuntu<\/code>. T\u00e0i kho\u1ea3n n\u00e0y c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng&nbsp;<code>sudo<\/code>v\u00e0 kh\u00f4ng y\u00eau c\u1ea7u m\u1eadt kh\u1ea9u \u0111\u1ec3 th\u1ef1c hi\u1ec7n c\u00e1c t\u00e1c v\u1ee5 qu\u1ea3n tr\u1ecb.L\u1ec7nh n\u00e0y&nbsp;<code>sudo<\/code>cung c\u1ea5p th\u00f4ng tin \u0111\u0103ng nh\u1eadp v\u00e0o t\u00e0i kho\u1ea3n hi\u1ec7n c\u00f3&nbsp;<code>ubuntu<\/code>.<\/p>\n<p>Xem nh\u1eadt k\u00fd container:<\/p>\n<pre class=\"wp-block-code\"><code>lxc info mycontainer --show-log\n<\/code><\/pre>\n<p>D\u1eebng container:<\/p>\n<pre class=\"wp-block-code\"><code>lxc stop mycontainer\n<\/code><\/pre>\n<p>Th\u00e1o h\u1ed9p \u0111\u1ef1ng:<\/p>\n<pre class=\"wp-block-code\"><code>lxc delete mycontainer\n<\/code><\/pre>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: C\u1ea7n ph\u1ea3i d\u1eebng m\u1ed9t container tr\u01b0\u1edbc khi c\u00f3 th\u1ec3 x\u00f3a n\u00f3.<\/p>\n<h2 id=\"troubleshooting\">X\u1eed l\u00fd s\u1ef1 c\u1ed1<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#troubleshooting\"><\/a><\/h2>\n<h3 id=\"error-unixsocket-connect-connection-refused\">L\u1ed7i \u201cunix.socket: connect: k\u1ebft n\u1ed1i b\u1ecb t\u1eeb ch\u1ed1i\u201d<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#error-unixsocket-connect-connection-refused\"><\/a><\/h3>\n<p>Khi b\u1ea1n ch\u1ea1y b\u1ea5t k\u1ef3&nbsp;<code>lxc<\/code>l\u1ec7nh n\u00e0o, b\u1ea1n s\u1ebd nh\u1eadn \u0111\u01b0\u1ee3c l\u1ed7i sau:<\/p>\n<pre class=\"wp-block-code\"><code>    lxc list\nError: Get http:\/\/unix.socket\/1.0: dial unix \/var\/snap\/lxd\/common\/lxd\/unix.socket: connect: connection refused<\/code><\/pre>\n<p>\u0110i\u1ec1u n\u00e0y x\u1ea3y ra khi d\u1ecbch v\u1ee5 LXD hi\u1ec7n kh\u00f4ng ch\u1ea1y. Theo m\u1eb7c \u0111\u1ecbnh, d\u1ecbch v\u1ee5 LXD s\u1ebd ch\u1ea1y ngay khi \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh th\u00e0nh c\u00f4ng. Xem&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#initialize-lxd\">Kh\u1edfi t\u1ea1o LXD<\/a>&nbsp;\u0111\u1ec3 c\u1ea5u h\u00ecnh LXD.<\/p>\n<h3 id=\"error-unixsocket-connect-permission-denied\">L\u1ed7i \u201cunix.socket: connect: permission denied\u201d<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#error-unixsocket-connect-permission-denied\"><\/a><\/h3>\n<p>Khi b\u1ea1n ch\u1ea1y b\u1ea5t k\u1ef3&nbsp;<code>lxc<\/code>l\u1ec7nh n\u00e0o, b\u1ea1n s\u1ebd nh\u1eadn \u0111\u01b0\u1ee3c l\u1ed7i sau:<\/p>\n<pre class=\"wp-block-code\"><code> lxc lis\nError: Get http:\/\/unix.socket\/1.0: dial unix \/var\/snap\/lxd\/common\/lxd\/unix.socket: connect: permission denied<\/code><\/pre>\n<p>\u0110i\u1ec1u n\u00e0y x\u1ea3y ra khi t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng b\u1ecb gi\u1edbi h\u1ea1n c\u1ee7a b\u1ea1n kh\u00f4ng ph\u1ea3i l\u00e0 th\u00e0nh vi\u00ean c\u1ee7a&nbsp;<code>lxd<\/code>nh\u00f3m ho\u1eb7c b\u1ea1n kh\u00f4ng \u0111\u0103ng xu\u1ea5t v\u00e0 \u0111\u0103ng nh\u1eadp l\u1ea1i \u0111\u1ec3 t\u01b0 c\u00e1ch th\u00e0nh vi\u00ean nh\u00f3m m\u1edbi&nbsp;<code>lxd<\/code>\u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt.<\/p>\n<p>N\u1ebfu t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng c\u1ee7a b\u1ea1n l\u00e0&nbsp;<code>ubuntu<\/code>, l\u1ec7nh sau s\u1ebd hi\u1ec3n th\u1ecb li\u1ec7u b\u1ea1n c\u00f3 ph\u1ea3i l\u00e0 th\u00e0nh vi\u00ean c\u1ee7a&nbsp;<code>lxd<\/code>nh\u00f3m hay kh\u00f4ng:<\/p>\n<pre class=\"wp-block-code\"><code> groups ubuntu\nubuntu : ubuntu sudo lxd<\/code><\/pre>\n<p>Trong v\u00ed d\u1ee5 n\u00e0y, ch\u00fang ta l\u00e0 th\u00e0nh vi\u00ean c\u1ee7a&nbsp;<code>lxd<\/code>nh\u00f3m v\u00e0 ch\u00fang ta ch\u1ec9 c\u1ea7n \u0111\u0103ng xu\u1ea5t v\u00e0 \u0111\u0103ng nh\u1eadp l\u1ea1i. N\u1ebfu b\u1ea1n kh\u00f4ng ph\u1ea3i l\u00e0 th\u00e0nh vi\u00ean c\u1ee7a nh\u00f3m&nbsp;<code>lxd<\/code>, h\u00e3y xem&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#initialize-lxd\">Kh\u1edfi t\u1ea1o LXD<\/a>&nbsp;\u0111\u1ec3 bi\u1ebft c\u00e1ch bi\u1ebfn t\u00e0i kho\u1ea3n gi\u1edbi h\u1ea1n c\u1ee7a b\u1ea1n th\u00e0nh th\u00e0nh vi\u00ean c\u1ee7a&nbsp;<code>lxd<\/code>nh\u00f3m.<\/p>\n<h2 id=\"next-steps\">C\u00e1c b\u01b0\u1edbc ti\u1ebfp theo<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/#next-steps\"><\/a><\/h2>\n<p>N\u1ebfu b\u1ea1n \u0111\u1ecbnh s\u1eed d\u1ee5ng m\u1ed9t trang web duy nh\u1ea5t, th\u00ec m\u1ed9t thi\u1ebft b\u1ecb proxy duy nh\u1ea5t \u0111\u1ebfn v\u00f9ng ch\u1ee9a trang web s\u1ebd \u0111\u1ee7. N\u1ebfu b\u1ea1n \u0111\u1ecbnh s\u1eed d\u1ee5ng nhi\u1ec1u trang web, b\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t m\u00e1y ch\u1ee7 \u1ea3o b\u00ean trong v\u00f9ng ch\u1ee9a trang web. N\u1ebfu thay v\u00e0o \u0111\u00f3, b\u1ea1n mu\u1ed1n thi\u1ebft l\u1eadp nhi\u1ec1u trang web tr\u00ean v\u00f9ng ch\u1ee9a ri\u00eang c\u1ee7a ch\u00fang, th\u00ec b\u1ea1n s\u1ebd c\u1ea7n thi\u1ebft l\u1eadp&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-nginx-reverse-proxy\/\">proxy ng\u01b0\u1ee3c<\/a>&nbsp;trong m\u1ed9t v\u00f9ng ch\u1ee9a. Trong tr\u01b0\u1eddng h\u1ee3p \u0111\u00f3, thi\u1ebft b\u1ecb proxy s\u1ebd chuy\u1ec3n h\u01b0\u1edbng \u0111\u1ebfn v\u00f9ng ch\u1ee9a proxy ng\u01b0\u1ee3c \u0111\u1ec3 chuy\u1ec3n h\u01b0\u1edbng k\u1ebft n\u1ed1i \u0111\u1ebfn c\u00e1c v\u00f9ng ch\u1ee9a trang web ri\u00eang l\u1ebb.<\/p>\n<h2 id=\"more-information\">Th\u00f4ng tin th\u00eam<\/h2>\n<p>B\u1ea1n c\u00f3 th\u1ec3 mu\u1ed1n tham kh\u1ea3o c\u00e1c ngu\u1ed3n sau \u0111\u1ec3 bi\u1ebft th\u00eam th\u00f4ng tin v\u1ec1 ch\u1ee7 \u0111\u1ec1 n\u00e0y. M\u1eb7c d\u00f9 ch\u00fang t\u00f4i cung c\u1ea5p v\u1edbi hy v\u1ecdng r\u1eb1ng ch\u00fang s\u1ebd h\u1eefu \u00edch, nh\u01b0ng xin l\u01b0u \u00fd r\u1eb1ng ch\u00fang t\u00f4i kh\u00f4ng th\u1ec3 \u0111\u1ea3m b\u1ea3o t\u00ednh ch\u00ednh x\u00e1c ho\u1eb7c t\u00ednh k\u1ecbp th\u1eddi c\u1ee7a c\u00e1c t\u00e0i li\u1ec7u \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef b\u00ean ngo\u00e0i.<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.snapcraft.io\/getting-started\/3876\" target=\"_blank\" rel=\"noreferrer noopener\">G\u00f3i snap l\u00e0 g\u00ec<\/a><\/li>\n<li><a href=\"https:\/\/docs.snapcraft.io\/installing-snapd\/6735\" target=\"_blank\" rel=\"noreferrer noopener\">C\u00e0i \u0111\u1eb7t snapd<\/a><\/li>\n<li><a href=\"https:\/\/linuxcontainers.org\/lxd\/\" target=\"_blank\" rel=\"noreferrer noopener\">Gi\u1edbi thi\u1ec7u LXD<\/a><\/li>\n<li><a href=\"https:\/\/stgraber.org\/2016\/03\/11\/lxd-2-0-blog-post-series-012\/\" target=\"_blank\" rel=\"noreferrer noopener\">Chu\u1ed7i b\u00e0i \u0111\u0103ng tr\u00ean blog v\u1ec1 LXD 2.0<\/a><\/li>\n<li><a href=\"https:\/\/discuss.linuxcontainers.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">C\u1ed9ng \u0111\u1ed3ng h\u1ed7 tr\u1ee3 LXD<\/a><\/li>\n<li><a href=\"https:\/\/linuxcontainers.org\/lxd\/try-it\/\" target=\"_blank\" rel=\"noreferrer noopener\">H\u00e3y th\u1eed LXD tr\u1ef1c tuy\u1ebfn<\/a><\/li>\n<li><a href=\"https:\/\/docs.nginx.com\/nginx\/admin-guide\/web-server\/reverse-proxy\/\" target=\"_blank\" rel=\"noreferrer noopener\">C\u00e0i \u0111\u1eb7t Proxy ng\u01b0\u1ee3c NGINX<\/a><\/li>\n<\/ul>\n<p>Ngu\u1ed3n: https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LXD l\u00e0 g\u00ec? LXD&nbsp;(ph\u00e1t \u00e2m l\u00e0 \u201cLex-Dee\u201d) l\u00e0 tr\u00ecnh qu\u1ea3n l\u00fd v\u00f9ng ch\u1ee9a h\u1ec7 th\u1ed1ng \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng tr\u00ean LXC (Linux Containers) hi\u1ec7n \u0111ang \u0111\u01b0\u1ee3c Canonical h\u1ed7 tr\u1ee3. M\u1ee5c ti\u00eau c\u1ee7a LXD l\u00e0 cung c\u1ea5p tr\u1ea3i nghi\u1ec7m t\u01b0\u01a1ng t\u1ef1 nh\u01b0 m\u00e1y \u1ea3o nh\u01b0ng th\u00f4ng qua container h\u00f3a thay v\u00ec \u1ea3o h\u00f3a ph\u1ea7n c\u1ee9ng. So v\u1edbi<\/p>\n","protected":false},"author":1,"featured_media":36261,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[108],"tags":[],"class_list":["post-35032","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers"],"_links":{"self":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/35032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/comments?post=35032"}],"version-history":[{"count":0,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/35032\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media\/36261"}],"wp:attachment":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media?parent=35032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/categories?post=35032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/tags?post=35032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}