{"id":25402,"date":"2022-12-29T05:58:23","date_gmt":"2022-12-20T05:54:53","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/"},"modified":"2025-08-11T13:22:43","modified_gmt":"2025-08-11T05:22:43","slug":"%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/","title":{"rendered":"\u5728Ubuntu\u4e0a\u6784\u5efanghttp2"},"content":{"rendered":"<p>\u4f7f\u7528\u652f\u6301HTTP2.0\u8349\u68484\u7684nghttp\uff0c\u53ef\u4ee5\u5c1d\u8bd5spdylay\u7684http2.0\/draft-4\u7248\u672c\u3002(\u679c\u7136\u662f\u8fb0\u5927\u5148\u751f\uff0c\u5de5\u4f5c\u5feb\u901f\u554a\u3002\u3002)<\/p>\n<p>\u6240\u4ee5\uff0c\u4e0b\u9762\u662f\u5728ubuntu\u4e0a\u6784\u5efa\u5b83\u7684\u5907\u5fd8\u5f55\u3002<\/p>\n<p>\u57fa\u672c\u7684\u4f9d\u5b58\u5173\u7cfb\u5982\u516c\u5f0f\u6240\u8ff0\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">sudo apt-get install -y \\\r\n  autoconf              \\\r\n  automake              \\\r\n  autotools-dev         \\\r\n  libtool               \\\r\n  pkg-config            \\\r\n  zlib1g-dev            \\\r\n  libcunit1-dev         \\\r\n  libssl-dev            \\\r\n  libxml2-dev           \\\r\n  libevent-dev\r\n<\/span><\/code><\/pre>\n<p>\u6240\u4ee5\uff0c\u4f7f\u7528\u6b64\u547d\u4ee4\u8fdb\u884c\u6784\u5efa\u65f6\uff0c\u672a\u751f\u6210 src\/nghttp2.0 \u547d\u4ee4\u3002<br \/>\n\u56f4\u7ed5 -std=c++11 \u5b58\u5728\u9519\u8bef\u3002<\/p>\n<p>\u53ea\u9700\u8981\u7b80\u5355\u5730\u5c06gcc\u4ece4.6\u5347\u7ea7\u52304.7\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u90a3\u4e2a\u65b9\u6cd5\u5c31\u5728\u8fd9\u9644\u8fd1\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">sudo apt-get install -y python-software-properties\r\nsudo apt-get update\r\n\r\nsudo add-apt-repository ppa:ubuntu-toolchain-r\/test\r\nsudo apt-get update\r\nsudo apt-get install -y gcc-4.7 g++-4.7\r\nsudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-4.6 60 --slave \/usr\/bin\/g++ g++ \/usr\/bin\/g++-4.6\r\nsudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-4.7 40 --slave \/usr\/bin\/g++ g++ \/usr\/bin\/g++-4.7\r\nsudo update-alternatives --list gcc\r\nsudo update-alternatives --config gcc\r\n<\/span><\/code><\/pre>\n<p>\u7136\u540e\uff0c\u5728\u4ee5\u4e0b\u4f4d\u7f6e\u6784\u5efa\uff0csrc\u6587\u4ef6\u5939\u4e0b\u5c06\u4f1a\u751f\u6210nghttp\u3001nghttpx\u548cnghttpd\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">autoreconf -i\r\nautomake\r\nautoconf\r\n.\/configure\r\nmake\r\n<\/span><\/code><\/pre>\n<p>\u5982\u679c\u4e0d\u4f7f\u7528gcc-4.6\u4f1a\u5e26\u6765\u4e0d\u4fbf\uff0c\u53ef\u4ee5\u91cd\u65b0\u8fd0\u884cupdate-alternatives &#8211;config\u547d\u4ee4\u6765\u6062\u590d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u652f\u6301HTTP2.0\u8349\u68484\u7684nghttp\uff0c\u53ef\u4ee5\u5c1d\u8bd5spdylay\u7684http2.0\/draft-4\u7248\u672c\u3002(\u679c\u7136 [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-25402","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728Ubuntu\u4e0a\u6784\u5efanghttp2 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u6784\u5efanghttp2\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u6784\u5efanghttp2-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728Ubuntu\u4e0a\u6784\u5efanghttp2\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u6784\u5efanghttp2\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u6784\u5efanghttp2-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-20T05:54:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-11T05:22:43+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/\",\"name\":\"\u5728Ubuntu\u4e0a\u6784\u5efanghttp2 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-12-20T05:54:53+00:00\",\"dateModified\":\"2025-08-11T05:22:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"description\":\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u6784\u5efanghttp2\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728Ubuntu\u4e0a\u6784\u5efanghttp2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728Ubuntu\u4e0a\u6784\u5efanghttp2 - Blog - Silicon Cloud","description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u6784\u5efanghttp2\u7684\u6280\u672f\u6587\u7ae0","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:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u6784\u5efanghttp2-2\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728Ubuntu\u4e0a\u6784\u5efanghttp2","og_description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u6784\u5efanghttp2\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u6784\u5efanghttp2-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-12-20T05:54:53+00:00","article_modified_time":"2025-08-11T05:22:43+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/","name":"\u5728Ubuntu\u4e0a\u6784\u5efanghttp2 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-12-20T05:54:53+00:00","dateModified":"2025-08-11T05:22:43+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u6784\u5efanghttp2\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728Ubuntu\u4e0a\u6784\u5efanghttp2"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e6%9e%84%e5%bb%banghttp2-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/25402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=25402"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/25402\/revisions"}],"predecessor-version":[{"id":55805,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/25402\/revisions\/55805"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=25402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=25402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=25402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}