{"id":6767,"date":"2021-09-16T18:49:42","date_gmt":"2021-09-16T11:49:42","guid":{"rendered":"https:\/\/idconline.vn\/blog\/?p=6767"},"modified":"2021-09-16T18:49:47","modified_gmt":"2021-09-16T11:49:47","slug":"di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps","status":"publish","type":"post","link":"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/","title":{"rendered":"Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS"},"content":{"rendered":"\n<p>WordPress kh\u00f4ng ch\u1ec9 l\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd n\u1ed9i dung. Khi c\u00e1c nh\u00e0 ph\u00e1t tri\u1ec3n th\u00f4ng minh b\u1eaft \u0111\u1ea7u t\u1ea1o c\u00e1c plugin v\u00e0 ch\u1ee7 \u0111\u1ec1 \u0111\u1ec3 x\u00e2y d\u1ef1ng b\u1ea5t k\u1ef3 lo\u1ea1i trang web n\u00e0o b\u1eb1ng WordPress. Ng\u00e0y nay ch\u00fang ta th\u1ea5y s\u1ef1 tr\u1ed7i d\u1eady c\u1ee7a th\u01b0\u01a1ng m\u1ea1i \u0111i\u1ec7n t\u1eed WordPress. Tuy nhi\u00ean, t\u1ea5t c\u1ea3 c\u00e1c nh\u00e0 ph\u00e1t tri\u1ec3n \u0111\u1ec1u x\u00e2y d\u1ef1ng trang web c\u1ee5c b\u1ed9 tr\u00ean m\u00e1y t\u00ednh c\u1ee7a h\u1ecd. Sau \u0111\u00f3, h\u1ecd c\u1ea7n di chuy\u1ec3n trang WordPress t\u1eeb m\u00e1y ch\u1ee7 c\u1ee5c b\u1ed9 sang VPS. N\u1ebfu b\u1ea1n l\u00e0 m\u1ed9t nh\u00e0 ph\u00e1t tri\u1ec3n nh\u01b0 v\u1eady, b\u1ea1n c\u00f3 th\u1ec3 t\u1ef1 h\u1ecfi vi\u1ec7c chuy\u1ec3n m\u1ed9t trang WordPress m\u1edbi ph\u00e1t tri\u1ec3n t\u1eeb localhost sang VPS nh\u01b0 th\u1ebf n\u00e0o? Blog n\u00e0y, s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n &#8220;L\u00e0m c\u00e1ch n\u00e0o \u0111\u1ec3 di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS?&#8221;<\/p>\n\n\n\n<div id=\"toc_container\" class=\"toc_white no_bullets\"><p class=\"toc_title\">M\u1ee5c l\u1ee5c<\/p><ul class=\"toc_list\"><li><a href=\"#Tong_quan_WordPress\">T\u1ed5ng quan WordPress<\/a><\/li><li><a href=\"#Cach_de_di_chuyen_trang_web_WordPress_tu_localhost_sang_Ubuntu_VPS\">C\u00e1ch \u0111\u1ec3 di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS<\/a><ul><li><a href=\"#Buoc_1_Nen_tep_WordPress\">B\u01b0\u1edbc 1: N\u00e9n t\u1ec7p WordPress<\/a><\/li><li><a href=\"#Buoc_2_Xuat_co_so_du_lieu\">B\u01b0\u1edbc 2: Xu\u1ea5t c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/a><\/li><li><a href=\"#Buoc_3_Di_chuyen_sao_chep_tai_tep_va_co_so_du_lieu_len_VPS\">B\u01b0\u1edbc 3: Di chuy\u1ec3n \/ sao ch\u00e9p \/ t\u1ea3i t\u1ec7p v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u l\u00ean VPS<\/a><\/li><li><a href=\"#Buoc_4_Tao_va_nhap_co_so_du_lieu_tren_VPS\">B\u01b0\u1edbc 4: T\u1ea1o v\u00e0 nh\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u tr\u00ean VPS<\/a><\/li><li><a href=\"#Buoc_5_Tao_thu_muc_giai_nen_tep_va_cap_nhat_thong_tin_co_so_du_lieu\">B\u01b0\u1edbc 5: T\u1ea1o th\u01b0 m\u1ee5c, gi\u1ea3i n\u00e9n t\u1ec7p v\u00e0 c\u1eadp nh\u1eadt th\u00f4ng tin c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/a><\/li><li><a href=\"#Buoc_6_Tao_may_chu_ao_va_kich_hoat_no_Apache\">B\u01b0\u1edbc 6: T\u1ea1o m\u00e1y ch\u1ee7 \u1ea3o v\u00e0 k\u00edch ho\u1ea1t n\u00f3 (Apache)<\/a><\/li><li><a href=\"#Buoc_6_Tao_may_chu_ao_va_kich_hoat_nonbspNginx\">B\u01b0\u1edbc 6: T\u1ea1o m\u00e1y ch\u1ee7 \u1ea3o v\u00e0 k\u00edch ho\u1ea1t n\u00f3&nbsp;(Nginx)<\/a><\/li><\/ul><\/li><li><a href=\"#Ket_luan_VPS_tai_IDC_Online\">K\u1ebft lu\u1eadn VPS t\u1ea1i IDC Online<\/a><\/li><\/ul><\/div>\n<h2 class=\"wp-block-heading\"><span id=\"Tong_quan_WordPress\">T\u1ed5ng quan WordPress<\/span><\/h2>\n\n\n\n<p>WordPress \u0111\u01b0\u1ee3c bi\u1ebft \u0111\u1ebfn v\u1edbi vi\u1ec7c t\u1ea1o v\u00e0 qu\u1ea3n l\u00fd blog d\u1ec5 d\u00e0ng. C\u00e1c nh\u00e0 ph\u00e1t tri\u1ec3n th\u00f4ng minh b\u1eaft \u0111\u1ea7u t\u1ea1o c\u00e1c plugin v\u00e0 ch\u1ee7 \u0111\u1ec1 \u0111\u1ec3 x\u00e2y d\u1ef1ng b\u1ea5t k\u1ef3 lo\u1ea1i trang web n\u00e0o b\u1eb1ng WordPress. Ng\u00e0y nay, m\u1ecdi ng\u01b0\u1eddi c\u0169ng \u0111ang s\u1eed d\u1ee5ng WordPress \u0111\u1ec3 x\u00e2y d\u1ef1ng c\u00e1c trang web kinh doanh ho\u1eb7c c\u00f4ng ty.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"Cach_de_di_chuyen_trang_web_WordPress_tu_localhost_sang_Ubuntu_VPS\">C\u00e1ch \u0111\u1ec3 di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu <a href=\"https:\/\/idconline.vn\/vps-server.html\" target=\"_blank\" rel=\"noreferrer noopener\">VPS<\/a><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"Buoc_1_Nen_tep_WordPress\">B\u01b0\u1edbc 1: N\u00e9n t\u1ec7p WordPress<\/span><\/h3>\n\n\n\n<p>WordPress l\u00e0 s\u1ef1 k\u1ebft h\u1ee3p c\u1ee7a c\u00e1c t\u1ec7p v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u. C\u00e1c t\u1ec7p \u0111\u1ea1i di\u1ec7n cho c\u01a1 s\u1edf m\u00e3, plugin, ch\u1ee7 \u0111\u1ec1 v\u00e0 ph\u01b0\u01a1ng ti\u1ec7n WordPress c\u1ee7a b\u1ea1n. C\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 theo d\u00f5i v\u00e0 l\u01b0u tr\u1eef c\u00e1c b\u00e0i \u0111\u0103ng tr\u00ean blog c\u1ee7a b\u1ea1n, c\u00e0i \u0111\u1eb7t ch\u1ee7 \u0111\u1ec1, d\u1eef li\u1ec7u ng\u01b0\u1eddi d\u00f9ng, v.v.&nbsp;<\/p>\n\n\n\n<p>V\u00ec v\u1eady, tr\u01b0\u1edbc ti\u00ean h\u00e3y n\u00e9n c\u00e1c t\u1ec7p WordPress tr\u00ean localhost. B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00e1c c\u00f4ng c\u1ee5 nh\u01b0 7zip, zip v\u00e0 tar. N\u00e9n to\u00e0n b\u1ed9 th\u01b0 m\u1ee5c c\u00e0i \u0111\u1eb7t WordPress.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps.jpg\" alt=\"Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS\" class=\"wp-image-6810\" width=\"768\" srcset=\"https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps.jpg 1200w, https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps-300x169.jpg 300w, https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps-1024x577.jpg 1024w, https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps-768x433.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><figcaption>Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"Buoc_2_Xuat_co_so_du_lieu\">B\u01b0\u1edbc 2: Xu\u1ea5t c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/span><\/h3>\n\n\n\n<p>WordPress ch\u1ee9a c\u00e1c t\u1ec7p v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u. C\u01a1 s\u1edf d\u1eef li\u1ec7u quan tr\u1ecdng v\u00ec t\u1ea5t c\u1ea3 th\u01b0, c\u00e0i \u0111\u1eb7t v\u00e0 d\u1eef li\u1ec7u c\u1ee7a b\u1ea1n \u0111\u1ec1u \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong c\u01a1 s\u1edf d\u1eef li\u1ec7u. T\u00f9y thu\u1ed9c v\u00e0o m\u00f4i tr\u01b0\u1eddng c\u1ee7a b\u1ea1n, vi\u1ec7c xu\u1ea5t c\u01a1 s\u1edf d\u1eef li\u1ec7u t\u1eeb c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u00f3 th\u1ec3 kh\u00f3 kh\u0103n. Tr\u00ean Linux ho\u1eb7c macOS, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh sau trong terminal \u0111\u1ec3 xu\u1ea5t c\u01a1 s\u1edf d\u1eef li\u1ec7u d\u01b0\u1edbi d\u1ea1ng t\u1ec7p .sql.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ mysqldump -uDB_USERNAME -p DB_NAME&gt; export_DB_NAME.sql<\/p><\/blockquote>\n\n\n\n<p>B\u1ea1n c\u00f3 th\u1ec3 l\u1ea5y DB_USERNAME, DB_PASSWORD v\u00e0 DB_NAME t\u1eeb t\u1ec7p wp-config.php. Sau khi xu\u1ea5t, ch\u00fang t\u00f4i c\u00f3 th\u1ec3 di chuy\u1ec3n t\u1ec7p v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111\u1ebfn m\u00e1y ch\u1ee7 t\u1eeb xa c\u1ee7a m\u00ecnh.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"Buoc_3_Di_chuyen_sao_chep_tai_tep_va_co_so_du_lieu_len_VPS\">B\u01b0\u1edbc 3: Di chuy\u1ec3n \/ sao ch\u00e9p \/ t\u1ea3i t\u1ec7p v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u l\u00ean VPS<\/span><\/h3>\n\n\n\n<p>T\u1ea1i th\u1eddi \u0111i\u1ec3m n\u00e0y, c\u00e1c t\u1ec7p v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u s\u1ebd \u0111\u01b0\u1ee3c t\u1ea3i l\u00ean VPS. B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng SFTP, SCP ho\u1eb7c b\u1ea5t k\u1ef3 ph\u01b0\u01a1ng ph\u00e1p n\u00e0o kh\u00e1c. M\u1ee5c ti\u00eau c\u1ee7a ch\u00fang t\u00f4i l\u00e0 t\u1ea3i t\u1ea5t c\u1ea3 ch\u00fang l\u00ean VPS. N\u1ebfu b\u1ea1n \u0111ang s\u1eed d\u1ee5ng Linux ho\u1eb7c MacOS, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng SCP, r\u1ea5t d\u1ec5 s\u1eed d\u1ee5ng. T\u1ea5t c\u1ea3 nh\u1eefng g\u00ec b\u1ea1n c\u1ea7n l\u00e0m l\u00e0 ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 chuy\u1ec3n t\u1ec7p t\u1eeb m\u00e1y ch\u1ee7 c\u1ee5c b\u1ed9 sang m\u00e1y t\u00ednh kh\u00e1c.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ scp \/ path \/ to \/ file user @ server_ip : ~<\/p><\/blockquote>\n\n\n\n<p>V\u1edbi l\u1ec7nh n\u00e0y, \u0111\u1eebng qu\u00ean thay th\u1ebf \u0111\u01b0\u1eddng d\u1eabn t\u1ec7p v\u00e0 th\u00f4ng tin Ubuntu VPS c\u1ee7a b\u1ea1n. B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh t\u01b0\u01a1ng t\u1ef1 \u0111\u1ec3 chuy\u1ec3n c\u00e1c kho l\u01b0u tr\u1eef v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"Buoc_4_Tao_va_nhap_co_so_du_lieu_tren_VPS\">B\u01b0\u1edbc 4: T\u1ea1o v\u00e0 nh\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u tr\u00ean VPS<\/span><\/h3>\n\n\n\n<p>B\u00e2y gi\u1edd c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 t\u1ec7p c\u1ee7a b\u1ea1n \u0111\u00e3 \u1edf tr\u00ean VPS, tr\u01b0\u1edbc ti\u00ean ch\u00fang ta h\u00e3y t\u1ea1o c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 nh\u1eadp t\u1ec7p .sql \u0111\u00e3 xu\u1ea5t v\u00e0o c\u01a1 s\u1edf d\u1eef li\u1ec7u. \u0110\u1ea7u ti\u00ean ch\u00fang ta t\u1ea1o m\u1ed9t c\u01a1 s\u1edf d\u1eef li\u1ec7u trong MySQL. Ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 \u0111\u0103ng nh\u1eadp v\u00e0o MySQL d\u01b0\u1edbi d\u1ea1ng root.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ mysql -u root -p;<\/p><\/blockquote>\n\n\n\n<p>N\u00f3 s\u1ebd y\u00eau c\u1ea7u m\u1eadt kh\u1ea9u, nh\u1eadp m\u1eadt kh\u1ea9u g\u1ed1c MySQL ch\u00ednh x\u00e1c, sau \u0111\u00f3 th\u1ef1c hi\u1ec7n c\u00e1c truy v\u1ea5n sau \u0111\u1ec3 t\u1ea1o c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u00f9ng v\u1edbi ng\u01b0\u1eddi d\u00f9ng trong MySQL.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>mysql&gt; CREATE DATABASE wordpress ;&nbsp;<\/p><p>mysql&gt; CREATE USER &#8216; wordpressUser &#8216; @ &#8216;localhost&#8217; IDENTIFIED BY &#8216; strong_password &#8216;;&nbsp;<\/p><p>mysql&gt; GRANT ALL PRIVILEGES ON wordpress . * to &#8216; wordpressUser &#8216; @ &#8216;localhost&#8217;;<\/p><\/blockquote>\n\n\n\n<p>H\u00e3y nh\u1edb thay th\u1ebf t\u00ean c\u01a1 s\u1edf d\u1eef li\u1ec7u, t\u00ean ng\u01b0\u1eddi d\u00f9ng v\u00e0 m\u1eadt kh\u1ea9u trong c\u00e1c truy v\u1ea5n n\u00e0y. Sau khi c\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111\u00e3 s\u1eb5n s\u00e0ng, h\u00e3y th\u1ef1c hi\u1ec7n exit l\u1ec7nh \u0111\u1ec3 tho\u00e1t kh\u1ecfi MySQL CLI. B\u00e2y gi\u1edd h\u00e3y ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 nh\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ mysql -u wordpressUser -p wordpress &lt; \/path\/to\/exported_DB_NAME.sql<\/p><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"Buoc_5_Tao_thu_muc_giai_nen_tep_va_cap_nhat_thong_tin_co_so_du_lieu\">B\u01b0\u1edbc 5: T\u1ea1o th\u01b0 m\u1ee5c, gi\u1ea3i n\u00e9n t\u1ec7p v\u00e0 c\u1eadp nh\u1eadt th\u00f4ng tin c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/span><\/h3>\n\n\n\n<p>Trong b\u01b0\u1edbc n\u00e0y, ch\u00fang t\u00f4i s\u1ebd t\u1ea1o m\u1ed9t th\u01b0 m\u1ee5c cho trang web c\u1ee7a m\u00ecnh, v\u00e0 sau \u0111\u00f3 gi\u1ea3i n\u00e9n t\u1ea5t c\u1ea3 c\u00e1c t\u1ec7p v\u00e0o th\u01b0 m\u1ee5c \u0111\u00f3. Ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 t\u1ea1o m\u1ed9t th\u01b0 m\u1ee5c trong th\u01b0 m\u1ee5c c\u1ee7a trang web c\u1ee7a b\u1ea1n. \/ Reactive \/ World Wide Web.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ sudo mkdir \/ var \/ www \/ example.com<\/p><\/blockquote>\n\n\n\n<p>Sau \u0111\u00f3, di chuy\u1ec3n t\u1ec7p n\u00e9n v\u00e0o th\u01b0 m\u1ee5c \u0111\u00f3 v\u00e0 gi\u1ea3i n\u00e9n t\u1ea5t c\u1ea3 c\u00e1c t\u1ec7p trong th\u01b0 m\u1ee5c \u0111\u00f3. Ch\u00fang t\u00f4i c\u0169ng c\u1ea7n c\u1eadp nh\u1eadt th\u00f4ng tin c\u01a1 s\u1edf d\u1eef li\u1ec7u trong t\u1ec7p wp-config.php. Ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 ch\u1ec9nh s\u1eeda t\u1ec7p wp-config.php.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ sudo nano \/ var \/ www \/ example.com \/wp-config.php<\/p><\/blockquote>\n\n\n\n<p>Nh\u1eadp c\u00e1c gi\u00e1 tr\u1ecb m\u1edbi v\u00e0o DB_NAME, DB_USERNAME v\u00e0 DB_PASSWORD m\u00e0 ch\u00fang t\u00f4i \u0111\u00e3 \u0111\u1ecbnh c\u1ea5u h\u00ecnh khi t\u1ea1o c\u01a1 s\u1edf d\u1eef li\u1ec7u tr\u00ean VPS. \u0110i\u1ec1u cu\u1ed1i c\u00f9ng ch\u00fang ta c\u1ea7n l\u00e0m b\u00e2y gi\u1edd l\u00e0 c\u1eadp nh\u1eadt c\u00e1c quy\u1ec1n c\u1ee7a t\u1ec7p. Ch\u00fang t\u00f4i cung c\u1ea5p cho b\u1ea1n s\u1ef1 \u1ee7y quy\u1ec1n www-data. C\u1eadp nh\u1eadt ch\u1ee7 \u0111\u1ec1 c\u1ee7a b\u1ea1n tr\u1ef1c ti\u1ebfp trong WordPress. Ch\u1ea1y c\u00e1c l\u1ec7nh sau \u0111\u1ec3 ho\u00e0n th\u00e0nh t\u00e1c v\u1ee5 n\u00e0y.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ sudo chown -R www-data: www-data \/ var \/ www \/ example.com<\/p><\/blockquote>\n\n\n\n<p>B\u00e2y gi\u1edd ch\u1ec9 c\u00f2n m\u1ed9t b\u01b0\u1edbc: t\u1ea1o v\u00e0 k\u00edch ho\u1ea1t m\u1ed9t m\u00e1y ch\u1ee7 \u1ea3o theo nh\u00e0 cung c\u1ea5p d\u1ecbch v\u1ee5 l\u01b0u tr\u1eef web c\u1ee7a b\u1ea1n.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"Buoc_6_Tao_may_chu_ao_va_kich_hoat_no_Apache\">B\u01b0\u1edbc 6: T\u1ea1o m\u00e1y ch\u1ee7 \u1ea3o v\u00e0 k\u00edch ho\u1ea1t n\u00f3 (Apache)<\/span><\/h3>\n\n\n\n<p>N\u1ebfu b\u1ea1n \u0111ang s\u1eed d\u1ee5ng m\u00e1y ch\u1ee7 web Apache, \u0111i\u1ec1u n\u00e0y r\u1ea5t d\u1ec5 d\u00e0ng cho b\u1ea1n v\u00ec Apache cung c\u1ea5p l\u1ec7nh t\u00edch h\u1ee3p \u0111\u1ec3 k\u00edch ho\u1ea1t ho\u1eb7c h\u1ee7y k\u00edch ho\u1ea1t c\u00e1c m\u00e1y ch\u1ee7 \u1ea3o. Ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 t\u1ea1o m\u1ed9t m\u00e1y ch\u1ee7 \u1ea3o m\u1edbi tr\u00ean m\u00e1y ch\u1ee7 Apache c\u1ee7a b\u1ea1n.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ sudo nano \/etc\/apache2\/sites-available\/example.conf<\/p><\/blockquote>\n\n\n\n<p>V\u00e0 d\u00e1n n\u1ed9i dung sau v\u00e0o t\u1ec7p. H\u00e3y nh\u1edb thay th\u1ebf d\u1eef li\u1ec7u m\u1eabu b\u1eb1ng d\u1eef li\u1ec7u th\u1ef1c t\u1ebf t\u1eeb trang web c\u1ee7a b\u1ea1n.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>&lt;VirtualHost *: 80&gt;&nbsp;<\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;ServerAdmin support@example.com&nbsp;<\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;ServerName example.com&nbsp;<\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;ServerAlias www.example.com<\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;DocumentRoot \/ var \/ www \/ example.com<\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;ErrorLog \/ var \/ log \/ apache2 \/ example -error.log&nbsp;<\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;CustomLog \/ var \/ log \/ apache2 \/ example -access.log k\u1ebft h\u1ee3p&nbsp;<\/p><p>&lt;\/VirtualHost&gt;<\/p><\/blockquote>\n\n\n\n<p>Sau khi ho\u00e0n t\u1ea5t, nh\u1ea5n&nbsp; CTRL + X, ti\u1ebfp theo l\u00e0&nbsp; Y, sau \u0111\u00f3 nh\u1ea5n&nbsp; Enter \u0111\u1ec3 l\u01b0u t\u1ec7p m\u00e1y ch\u1ee7 \u1ea3o. Sau \u0111\u00f3, ch\u1ea1y th\u1ef1c hi\u1ec7n l\u1ec7nh sau \u0111\u1ec3 k\u00edch ho\u1ea1t c\u00e1c m\u00e1y ch\u1ee7 \u1ea3o.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ sudo a2ensite example<br>$ sudo service apache2 restart<\/p><\/blockquote>\n\n\n\n<p>B\u00e2y gi\u1edd, trang web c\u1ee7a b\u1ea1n \u0111\u00e3 xu\u1ea5t hi\u1ec7n tr\u00ean Internet!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"Buoc_6_Tao_may_chu_ao_va_kich_hoat_nonbspNginx\">B\u01b0\u1edbc 6: T\u1ea1o m\u00e1y ch\u1ee7 \u1ea3o v\u00e0 k\u00edch ho\u1ea1t n\u00f3&nbsp;(Nginx)<\/span><\/h3>\n\n\n\n<p>N\u1ebfu b\u1ea1n \u0111ang s\u1eed d\u1ee5ng m\u00e1y ch\u1ee7 Nginx, b\u1ea1n ph\u1ea3i t\u1ea1o th\u1ee7 c\u00f4ng li\u00ean k\u1ebft t\u01b0\u1ee3ng tr\u01b0ng c\u1ee7a m\u00e1y ch\u1ee7 \u1ea3o \u0111\u1ec3 k\u00edch ho\u1ea1t n\u00f3. B\u01b0\u1edbc \u0111\u1ea7u ti\u00ean l\u00e0 t\u1ea1o m\u1ed9t m\u00e1y ch\u1ee7 \u1ea3o. Th\u1ef1c thi l\u1ec7nh sau \u0111\u1ec3 t\u1ea1o m\u1ed9t m\u00e1y ch\u1ee7 \u1ea3o m\u1edbi trong Nginx.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ sudo nano \/etc\/nginx\/sites-available\/example.conf<\/p><\/blockquote>\n\n\n\n<p>B\u00e2y gi\u1edd, D\u00e1n n\u1ed9i dung sau v\u00e0o t\u1ec7p m\u00e1y ch\u1ee7 \u1ea3o. \u0110\u1eebng qu\u00ean thay th\u1ebf d\u1eef li\u1ec7u m\u1eabu b\u1eb1ng d\u1eef li\u1ec7u th\u1ef1c t\u1ebf trong t\u1ec7p, n\u1ebfu kh\u00f4ng trang web c\u1ee7a b\u1ea1n c\u00f3 th\u1ec3 kh\u00f4ng ho\u1ea1t \u0111\u1ed9ng.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>server {<br>listen 80;<br>server_name example.com www.example.com;<br>root \/var\/www\/example.com;<br><code>access_log \/var\/log\/nginx\/example-access.log; error_log \/var\/log\/nginx\/example-error.log;<\/code><br>}<\/p><\/blockquote>\n\n\n\n<p>B\u00e2y gi\u1edd ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 t\u1ea1o m\u1ed9t li\u00ean k\u1ebft t\u01b0\u1ee3ng tr\u01b0ng \u0111\u1ec3 k\u00edch ho\u1ea1t m\u00e1y ch\u1ee7 \u1ea3o, ch\u00fang ta c\u0169ng c\u1ea7n kh\u1edfi \u0111\u1ed9ng l\u1ea1i m\u00e1y ch\u1ee7 Nginx \u0111\u1ec3 t\u1ea3i c\u1ea5u h\u00ecnh m\u1edbi.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>$ sudo ln -s \/etc\/nginx\/sites-available\/example.conf \/etc\/nginx\/sites-enabled\/example.conf <\/p><p>$ sudo service nginx restart<\/p><\/blockquote>\n\n\n\n<p>Sau khi m\u00e1y ch\u1ee7 Nginx \u0111\u01b0\u1ee3c kh\u1edfi \u0111\u1ed9ng l\u1ea1i, trang web c\u1ee7a b\u1ea1n s\u1ebd xu\u1ea5t hi\u1ec7n tr\u00ean Internet.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/idc_vps02-1-1024x614-1.jpg\" alt=\"Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS\" class=\"wp-image-6695\" width=\"768\" srcset=\"https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/idc_vps02-1-1024x614-1.jpg 1024w, https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/idc_vps02-1-1024x614-1-300x180.jpg 300w, https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/idc_vps02-1-1024x614-1-768x461.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"Ket_luan_VPS_tai_IDC_Online\">K\u1ebft lu\u1eadn VPS t\u1ea1i<a href=\"http:\/\/idconline.vn\"> IDC Online<\/a><\/span><\/h2>\n\n\n\n<p>N\u1ebfu b\u1ea1n ch\u1ec9 hi\u1ec3u c\u00e1ch ho\u1ea1t \u0111\u1ed9ng c\u1ee7a WordPress, b\u1ea1n c\u00f3 th\u1ec3 di chuy\u1ec3n trang web WordPress c\u1ee7a m\u00ecnh sang Ubuntu VPS hay b\u1ea5t k\u1ef3 h\u1ec7 \u0111i\u1ec1u h\u00e0nh n\u00e0o kh\u00e1c. \u0110i\u1ec1u ch\u00ednh \u1edf \u0111\u00e2y l\u00e0 di chuy\u1ec3n c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 t\u1ec7p sang m\u00e1y ch\u1ee7 m\u1edbi v\u00e0 sau \u0111\u00f3 k\u1ebft n\u1ed1i l\u1ea1i c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 t\u1ec7p \u0111\u00f3 tr\u00ean m\u00e1y ch\u1ee7 m\u1edbi. B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00e1c plugin WordPress \u0111\u1ec3 di chuy\u1ec3n trang web WordPress c\u1ee7a m\u00ecnh t\u1eeb m\u00e1y ch\u1ee7 n\u00e0y sang m\u00e1y ch\u1ee7 kh\u00e1c.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/ubuntu-vps-1.jpg\" alt=\"Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS\" class=\"wp-image-6630\" width=\"768\" srcset=\"https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/ubuntu-vps-1.jpg 1000w, https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/ubuntu-vps-1-300x225.jpg 300w, https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2021\/07\/ubuntu-vps-1-768x576.jpg 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption>Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS<\/figcaption><\/figure><\/div>\n\n\n\n<p>N\u1ebfu b\u1ea1n c\u00f3 b\u1ea5t k\u1ef3 c\u00e2u h\u1ecfi n\u00e0o trong ph\u1ea7n b\u00ecnh lu\u1eadn b\u00ean d\u01b0\u1edbi, vui l\u00f2ng cho ch\u00fang t\u00f4i bi\u1ebft. N\u1ebfu b\u1ea1n \u0111\u00e3 l\u00e0 kh\u00e1ch h\u00e0ng c\u1ee7a IDC Online, n\u1ebfu b\u1ea1n mu\u1ed1n ch\u00fang t\u00f4i di chuy\u1ec3n trang web WordPress c\u1ee7a b\u1ea1n cho b\u1ea1n, vui l\u00f2ng li\u00ean h\u1ec7 v\u1edbi nh\u00f3m h\u1ed7 tr\u1ee3 c\u1ee7a ch\u00fang t\u00f4i.<\/p>\n\n\n\n<p>Xem th\u00eam c\u00e1c b\u00e0i vi\u1ebft v\u1ec1 VPS Server\u00a0t\u1ea1i <a href=\"https:\/\/idconline.shop\/category\/vps-server\/\">Blog chuy\u00ean trang chia s\u1ebb ki\u1ebfn th\u1ee9c m\u00e1y ch\u1ee7.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress kh\u00f4ng ch\u1ec9 l\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd n\u1ed9i dung. Khi c\u00e1c nh\u00e0 ph\u00e1t tri\u1ec3n th\u00f4ng minh b\u1eaft \u0111\u1ea7u t\u1ea1o c\u00e1c plugin v\u00e0 ch\u1ee7 \u0111\u1ec1 \u0111\u1ec3 x\u00e2y d\u1ef1ng b\u1ea5t k\u1ef3 lo\u1ea1i trang web n\u00e0o b\u1eb1ng WordPress. Ng\u00e0y nay ch\u00fang ta th\u1ea5y s\u1ef1 tr\u1ed7i d\u1eady c\u1ee7a th\u01b0\u01a1ng m\u1ea1i \u0111i\u1ec7n t\u1eed WordPress. Tuy nhi\u00ean, t\u1ea5t c\u1ea3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6810,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,27],"tags":[357,356,355,90,28,124,274,117,83,91,70,67],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.10 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS<\/title>\n<meta name=\"description\" content=\"C\u00f3 th\u1ec3 di chuy\u1ec3n trang web WordPress c\u1ee7a m\u00ecnh sang Ubuntu VPS hay b\u1ea5t k\u1ef3 h\u1ec7 \u0111i\u1ec1u h\u00e0nh n\u00e0o kh\u00e1c. \u0110i\u1ec1u ch\u00ednh l\u00e0 di chuy\u1ec3n c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 t\u1ec7p\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"IDC\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 ph\u00fat\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS","description":"C\u00f3 th\u1ec3 di chuy\u1ec3n trang web WordPress c\u1ee7a m\u00ecnh sang Ubuntu VPS hay b\u1ea5t k\u1ef3 h\u1ec7 \u0111i\u1ec1u h\u00e0nh n\u00e0o kh\u00e1c. \u0110i\u1ec1u ch\u00ednh l\u00e0 di chuy\u1ec3n c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 t\u1ec7p","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:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"IDC","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"8 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/#article","isPartOf":{"@id":"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/"},"author":{"name":"IDC","@id":"https:\/\/idconline.vn\/blog\/#\/schema\/person\/c047396a55240e79250db1df5f239d39"},"headline":"Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS","datePublished":"2021-09-16T11:49:42+00:00","dateModified":"2021-09-16T11:49:47+00:00","mainEntityOfPage":{"@id":"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/"},"wordCount":2453,"commentCount":0,"publisher":{"@id":"https:\/\/idconline.vn\/blog\/#organization"},"keywords":["H\u00ea\u0323 \u0111i\u00ea\u0300u ha\u0300nh Ubuntu","Ubuntu","Ubuntu VPS","vps r\u1ebb nh\u1ea5t vi\u1ec7t nam","vps server","vps server gi\u00e1 r\u1ebb","vps server gi\u00e1 t\u1ed1t","vps server uy t\u00edn","vps ssd","vps ssd gi\u00e1 r\u1ebb","vps t\u1ed1t nh\u1ea5t","vps vietnam free"],"articleSection":["H\u01b0\u1edbng d\u1eabn","VPS Server"],"inLanguage":"vi","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/","url":"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/","name":"Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS","isPartOf":{"@id":"https:\/\/idconline.vn\/blog\/#website"},"datePublished":"2021-09-16T11:49:42+00:00","dateModified":"2021-09-16T11:49:47+00:00","description":"C\u00f3 th\u1ec3 di chuy\u1ec3n trang web WordPress c\u1ee7a m\u00ecnh sang Ubuntu VPS hay b\u1ea5t k\u1ef3 h\u1ec7 \u0111i\u1ec1u h\u00e0nh n\u00e0o kh\u00e1c. \u0110i\u1ec1u ch\u00ednh l\u00e0 di chuy\u1ec3n c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 t\u1ec7p","breadcrumb":{"@id":"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/idconline.vn\/blog\/di-chuyen-trang-web-wordpress-tu-localhost-sang-ubuntu-vps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/idconline.vn\/blog\/"},{"@type":"ListItem","position":2,"name":"Di chuy\u1ec3n trang web WordPress t\u1eeb localhost sang Ubuntu VPS"}]},{"@type":"WebSite","@id":"https:\/\/idconline.vn\/blog\/#website","url":"https:\/\/idconline.vn\/blog\/","name":"IDC Online","description":"D\u1ecbch v\u1ee5 M\u00e1y ch\u1ee7, Cloud, VPS, Web Hosting chuy\u00ean nghi\u1ec7p","publisher":{"@id":"https:\/\/idconline.vn\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/idconline.vn\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/idconline.vn\/blog\/#organization","name":"IDC ONLINE","url":"https:\/\/idconline.vn\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/idconline.vn\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2020\/10\/idc_cloud24-1.jpg","contentUrl":"https:\/\/idconline.vn\/blog\/wp-content\/uploads\/2020\/10\/idc_cloud24-1.jpg","width":1200,"height":899,"caption":"IDC ONLINE"},"image":{"@id":"https:\/\/idconline.vn\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/idconlinevn"]},{"@type":"Person","@id":"https:\/\/idconline.vn\/blog\/#\/schema\/person\/c047396a55240e79250db1df5f239d39","name":"IDC","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/idconline.vn\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8c298639f6b84fadcb073b5b92f9187f?s=96&r=r","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8c298639f6b84fadcb073b5b92f9187f?s=96&r=r","caption":"IDC"}}]}},"_links":{"self":[{"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/posts\/6767"}],"collection":[{"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/comments?post=6767"}],"version-history":[{"count":4,"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/posts\/6767\/revisions"}],"predecessor-version":[{"id":7664,"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/posts\/6767\/revisions\/7664"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/media\/6810"}],"wp:attachment":[{"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/media?parent=6767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/categories?post=6767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idconline.vn\/blog\/wp-json\/wp\/v2\/tags?post=6767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}