{"id":2300,"date":"2019-09-25T13:32:26","date_gmt":"2019-09-25T06:32:26","guid":{"rendered":"https:\/\/tino.vn\/?post_type=ht_kb&#038;p=2300"},"modified":"2019-09-25T13:32:26","modified_gmt":"2019-09-25T06:32:26","slug":"huong-dan-cai-dat-mo-hinh-apache-nginx-reverse-proxy","status":"publish","type":"ht_kb","link":"https:\/\/tino.vn\/blog\/docs\/huong-dan-cai-dat-mo-hinh-apache-nginx-reverse-proxy\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t m\u00f4 h\u00ecnh apache + nginx (reverse proxy)"},"content":{"rendered":"<h2 id=\"H\u01b0\u1edbng_d\u1eabn_n\u00e2ng_c\u1ea5p_l\u00ean_Custombuild_2.0_trong_Directadmin\">H\u01b0\u1edbng d\u1eabn n\u00e2ng c\u1ea5p l\u00ean Custombuild 2.0 trong Directadmin<\/h2>\n<p>DirectAdmin\u00a0\u0111i k\u00e8m v\u1edbi m\u1ed9t c\u00f4ng c\u1ee5 \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng s\u1eb5n c\u00f3 t\u00ean l\u00e0 CustomBuild, cho ph\u00e9p b\u1ea1n c\u00e0i \u0111\u1eb7t, g\u1ee1 b\u1ecf ho\u1eb7c bi\u00ean d\u1ecbch l\u1ea1i c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh. G\u1ea7n \u0111\u00e2y, \u0111\u00e3 c\u00f3 m\u1ed9t s\u1eeda \u0111\u1ed5i c\u1ee7a CustomBuild (th\u01b0\u1eddng \u0111\u01b0\u1ee3c vi\u1ebft t\u1eaft l\u00e0 CB) \u0111\u1ec3 phi\u00ean b\u1ea3n 2.0. Trong h\u01b0\u1edbng d\u1eabn n\u00e0y, b\u1ea1n s\u1ebd th\u1ea5y c\u00e1ch n\u00e2ng c\u1ea5p c\u00e0i \u0111\u1eb7t CustomBuild 1.1 ho\u1eb7c 1.2 l\u00ean 2.0.<\/p>\n<h3 id=\"B\u01b0\u1edbc_1:_C\u00e0i_\u0111\u1eb7t_l\u1ea1i_c\u00e1c_g\u00f3i_h\u1ed7_tr\u1ee3\">B\u01b0\u1edbc 1: C\u00e0i \u0111\u1eb7t l\u1ea1i c\u00e1c g\u00f3i h\u1ed7 tr\u1ee3<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">yum install wget gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio \\\r\nlibcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 cyrus-sasl-devel perl-ExtUtils-Embed \\\r\nautoconf automake libtool which patch mailx bzip2-devel lsof db4-devel psmisc net-tools systemd-devel libdb-devel perl-DBI xfsprogs rsyslog logrotate crontabs<\/pre>\n<h3 id=\"B\u01b0\u1edbc_2:_C\u1eadp_nh\u1eadt_CustomBuild\">B\u01b0\u1edbc 2: C\u1eadp nh\u1eadt CustomBuild<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">cd \/usr\/local\/directadmin\r\nmv custombuild custombuild_1.x\r\nwget -O custombuild.tar.gz http:\/\/files.directadmin.com\/services\/custombuild\/2.0\/custombuild.tar.gz\r\ntar xvzf custombuild.tar.gz\r\ncd custombuild\r\n.\/build<\/pre>\n<h3 id=\"B\u01b0\u1edbc_3:_Thay_\u0111\u1ed5i_c\u00e1c_t\u00f9y_ch\u1ecdn\">B\u01b0\u1edbc 3: Thay \u0111\u1ed5i c\u00e1c t\u00f9y ch\u1ecdn<\/h3>\n<p>Sau khi th\u1ef1c hi\u1ec7n .\/build, t\u1ec7p c\u1ea5u h\u00ecnh t\u00f9y ch\u1ecdn m\u1edbi \u0111\u00e3 \u0111\u01b0\u1ee3c t\u1ea1o. M\u1edf t\u1eadp tin n\u00e0y v\u00e0 th\u1ef1c hi\u1ec7n c\u00e1c thay \u0111\u1ed5i c\u1ea7n thi\u1ebft.<\/p>\n<p>Sau khi x\u00e1c nh\u1eadn thay \u0111\u1ed5i c\u1ee7a b\u1ea1n l\u00e0 ch\u00ednh x\u00e1c, c\u00e0i \u0111\u1eb7t ph\u1ea7n m\u1ec1m theo c\u1ea5u h\u00ecnh CustomBuild:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">.\/build all d\r\n.\/build rewrite_confs<\/pre>\n<h2 id=\"Build_nginx_(reverse_proxy)_d\u00f9ng_Custombuild:\"><strong>Build nginx (reverse_proxy) d\u00f9ng Custombuild:<\/strong><\/h2>\n<p>D\u00f9ng l\u1ea7n l\u01b0\u1ee3t c\u00e1c l\u1ec7nh sau \u0111\u1ec3 Build Nginx<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">cd \/usr\/local\/directadmin\/custombuild\r\n.\/build update\r\n.\/build update_da\r\n.\/build set webserver nginx_apache\r\n.\/build nginx_apache\r\n.\/build rewrite_confs<\/pre>\n<p>Ti\u1ebfp theo ta ti\u1ebfn h\u00e0nh c\u00e0i \u0111\u1eb7t mod_rpaf cho apache:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">cd \/usr\/local\/src\r\nwget https:\/\/github.com\/y-ken\/mod_rpaf\/archive\/master.zip\r\nunzip master.zip\r\ncd mod_rpaf-master\r\n\/bin\/sed -i \"s\/remote_\/client_\/g\" mod_rpaf-2.0.c\r\nmake &amp;&amp; make install<\/pre>\n<p>&nbsp;<\/p>\n<p>Ti\u1ebfp theo \u0111\u1ec3 ho\u00e0n th\u00e0nh qu\u00e1 tr\u00ecnh c\u00e0i \u0111\u1eb7t ta\u00a0ti\u1ebfn h\u00e0nh th\u00eam \u0111o\u1ea1n code sau v\u00e0o t\u1eadp tin httpd-includes.conf:<\/p>\n<p>\u0110\u1ec3 th\u00eam code v\u00e0o t\u1eadp tin ta d\u00f9ng l\u1ec7nh sau:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Vi \/etc\/httpd\/conf\/extra\/httpd-includes.conf<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">LoadModule rpaf_module      \/usr\/lib\/apache\/mod_rpaf-2.0.so\r\n&lt;IfModule mod_rpaf-2.0.c&gt;\r\n    RPAFenable On\r\n    RPAFproxy_ips 127.0.0.1\r\n    RPAFsethostname On\r\n    RPAFheader X-Client-IP\r\n&lt;\/IfModule&gt;<\/pre>\n<p>L\u01b0u l\u1ea1i v\u00e0 ki\u1ec3m tra l\u1ea1i v\u1edbi cmd : <strong>nginx -v<\/strong><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>H\u01b0\u1edbng d\u1eabn n\u00e2ng c\u1ea5p l\u00ean Custombuild 2.0 trong Directadmin DirectAdmin\u00a0\u0111i k\u00e8m v\u1edbi m\u1ed9t c\u00f4ng c\u1ee5 \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng s\u1eb5n c\u00f3 t\u00ean l\u00e0 CustomBuild, cho ph\u00e9p b\u1ea1n c\u00e0i \u0111\u1eb7t, g\u1ee1 b\u1ecf ho\u1eb7c bi\u00ean d\u1ecbch l\u1ea1i c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh. G\u1ea7n \u0111\u00e2y, \u0111\u00e3 c\u00f3 m\u1ed9t s\u1eeda \u0111\u1ed5i c\u1ee7a CustomBuild (th\u01b0\u1eddng \u0111\u01b0\u1ee3c vi\u1ebft t\u1eaft l\u00e0 CB) \u0111\u1ec3 phi\u00ean b\u1ea3n [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":16424,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"tags":[],"ht_kb_category":[23],"class_list":["post-2300","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-control-panel-direct-admin"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/2300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=2300"}],"version-history":[{"count":0,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/2300\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/16424"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=2300"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=2300"},{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb_category?post=2300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}