{"id":7427,"date":"2021-03-05T08:32:12","date_gmt":"2021-03-05T01:32:12","guid":{"rendered":"https:\/\/tino.vn\/?post_type=ht_kb&#038;p=7427"},"modified":"2021-03-05T08:32:23","modified_gmt":"2021-03-05T01:32:23","slug":"huong-dan-cai-dat-http-2-tren-directadmin","status":"publish","type":"ht_kb","link":"https:\/\/tino.vn\/blog\/docs\/huong-dan-cai-dat-http-2-tren-directadmin\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t HTTP\/2 tr\u00ean DirectAdmin"},"content":{"rendered":"<p>HTTP\/2 l\u00e0 phi\u00ean b\u1ea3n ch\u00ednh th\u1ee9c ti\u1ebfp theo c\u1ee7a giao th\u1ee9c HTTP, nh\u1eb1m c\u1ea3i thi\u1ec7n t\u1ed1c \u0111\u1ed9 t\u1ea3i web. N\u00f3 \u0111\u01b0\u1ee3c b\u1eaft ngu\u1ed3n t\u1eeb giao th\u1ee9c SPDY th\u1eed nghi\u1ec7m tr\u01b0\u1edbc \u0111\u00f3, do Google ph\u00e1t tri\u1ec3n ban \u0111\u1ea7u.<\/p>\n<p>1) C\u00e0i \u0111\u1eb7t OpenSSL, c\u00f9ng ALPN:<\/p>\n<div dir=\"ltr\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wget https:\/\/www.openssl.org\/source\/old\/1.0.2\/openssl-1.0.2u.tar.gz\r\ntar xzf openssl-1.0.2u.tar.gz\r\ncd openssl-1.0.2u\r\n.\/config --prefix=\/usr\/local\/lib_http2 no-ssl2 no-ssl3 zlib-dynamic -fPIC\r\nmake depend\r\nmake install<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<div dir=\"ltr\"><\/div>\n<p>2) C\u00e0i \u0111\u1eb7t nghttp2:<\/p>\n<div>\n<div dir=\"ltr\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd \/usr\/local\/directadmin\/custombuild\r\n.\/build update\r\n.\/build nghttp2<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>3) Enable http2 cho apache Apache:<\/p>\n<div>\n<div dir=\"ltr\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd \/usr\/local\/directadmin\/custombuild\r\nmkdir -p custom\/ap2\r\ncp -p configure\/ap2\/configure.apache custom\/ap2\/configure.apache<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>Ch\u1ec9nh s\u1ee7a file custom\/ap2\/configure.apache, t\u00ecm \u0111\u1ebfn d\u00f2ng:<\/p>\n<div>\n<div dir=\"ltr\">\n<div>\n<p><tt><tt>\u00a0 \u00a0<\/tt><\/tt><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\"--with-ssl=\/usr\" \\<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>Thay v\u00e0o \u0111o\u1ea1n sau:<\/p>\n<div>\n<div dir=\"ltr\">\n<div>\n<p><tt><tt>\u00a0 \u00a0<\/tt><\/tt><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\"--enable-http2\" \\\r\n\"--enable-ssl-staticlib-deps\" \\\r\n\"--with-ssl=\/usr\/local\/lib_http2\" \\<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>V\u00e0 build l\u1ea1i apache:<\/p>\n<div>\n<div dir=\"ltr\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">.\/build apache<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>4) C\u1ea5u h\u00ecnh Apache cho ph\u00e9p ch\u1ea1y http2:<\/p>\n<div>\n<div dir=\"ltr\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo 'ProtocolsHonorOrder On' &gt;&gt; \/etc\/httpd\/conf\/extra\/httpd-includes.conf\r\necho 'Protocols h2 h2c http\/1.1' &gt;&gt; \/etc\/httpd\/conf\/extra\/httpd-includes.conf<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>Update SSL Ciphers \u1edf file \/etc\/httpd\/conf\/extra\/httpd-ssl.conf:<\/p>\n<div>\n<div dir=\"ltr\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cd \/usr\/local\/directadmin\/custombuild\r\n.\/build rewrite_confs<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>Enable HTTP\/2 in cURL, Th\u00eam v\u00e0o \u0111o\u1ea1n code sau v\u00e0o\u00a0<strong>\/usr\/local\/directadmin\/custombuild\/custom\/curl\/configure.curl<\/strong>:<\/p>\n<div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#!\/bin\/sh\r\nperl -pi -e 's|CURL_CHECK_PKGCONFIG\\(zlib\\)|#CURL_CHECK_PKGCONFIG(zlib)|g' configure.ac\r\nLIBS=\"-ldl\" .\/configure --with-nghttp2=\/usr\/local --with-ssl=\/usr\/local\/lib_http2<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<p>V\u00e0 build l\u1ea1i curl<\/p>\n<div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cd \/usr\/local\/directadmin\/custombuild\r\nchmod 700 custom\/curl\/configure.curl\r\n.\/build curl<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTTP\/2 l\u00e0 phi\u00ean b\u1ea3n ch\u00ednh th\u1ee9c ti\u1ebfp theo c\u1ee7a giao th\u1ee9c HTTP, nh\u1eb1m c\u1ea3i thi\u1ec7n t\u1ed1c \u0111\u1ed9 t\u1ea3i web. N\u00f3 \u0111\u01b0\u1ee3c b\u1eaft ngu\u1ed3n t\u1eeb giao th\u1ee9c SPDY th\u1eed nghi\u1ec7m tr\u01b0\u1edbc \u0111\u00f3, do Google ph\u00e1t tri\u1ec3n ban \u0111\u1ea7u. 1) C\u00e0i \u0111\u1eb7t OpenSSL, c\u00f9ng ALPN: wget https:\/\/www.openssl.org\/source\/old\/1.0.2\/openssl-1.0.2u.tar.gz tar xzf openssl-1.0.2u.tar.gz cd openssl-1.0.2u .\/config &#8211;prefix=\/usr\/local\/lib_http2 no-ssl2 no-ssl3 zlib-dynamic [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":16424,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"tags":[],"ht_kb_category":[23],"class_list":["post-7427","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\/7427","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=7427"}],"version-history":[{"count":0,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/7427\/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=7427"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=7427"},{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb_category?post=7427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}