<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>curl &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/curl/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Mon, 17 Oct 2016 11:45:57 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[Gentoo] 替 Apache 加上 http2 支援</title>
		<link>https://richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/</link>
					<comments>https://richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 17 Oct 2016 11:45:57 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[http/2]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=2026</guid>

					<description><![CDATA[<p>沒有很難, 因為之前弄了 Letsencrypt 就想加一下 HTTP2, 這應該也很成熟了 /etc/por [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/">[Gentoo] 替 Apache 加上 http2 支援</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>沒有很難, 因為之前弄了 Letsencrypt 就想加一下 HTTP2, 這應該也很成熟了<br />
<span id="more-2026"></span></p>
<p>/etc/portage/package.use 加上 alpn</p>
<pre lang="text">
www-servers/apache threads alpn
</pre>
<p>/etc/conf.d/apache 內的 APACHE2_OPTS 加上 -DSSL -DHTTP2, 像是</p>
<pre lang="text">
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP -DHTTP2"
</pre>
<p>然後再執行</p>
<pre lang="text">
$ emerge -av apache
$ etc-update
$ !/etc/init.d/apache restart
</pre>
<p>etc-update 一定要做, 我就忘了做這步卡很久, 花了一點時間才 debug 出來. </p>
<p>這篇 Debug 非常好用, 不過用來用去 curl debug 最好用, 但是其他的 tool 也很有趣, 像 h2c 那個可以看 session 狀態.<br />
<a href="https://blog.cloudflare.com/tools-for-debugging-testing-and-using-http-2/" target="_blank" rel="noopener">Tools for debugging, testing and using HTTP/2</a></p>
<p>我就是用這麼原始的方式才知道錯在什麼環節</p>
<pre lang="text">
$ curl -vso /dev/null --http2 https://www.cloudflare.com/ 2 >> 1.txt
$ curl -vso /dev/null --http2 https://www.yourwebsite.com/ 2 >> 2.txt
$ vimdiff 1.txt 2.txt
</pre>
<p>我是看到這一篇才想到沒有 Load mod_http2 module<br />
<a href="https://icing.github.io/mod_h2/howto.html" target="_blank" rel="noopener">how to h2 in apache </a></p>
<p>最後再到這個網站確認有沒有成功<br />
<a href="https://tools.keycdn.com/http2-test" target="_blank" rel="noopener">HTTP/2 Test Verify HTTP/2.0 Support</a><br />
<a href="https://richliu.com/wp-content/uploads/2016/10/擷取.png"><img decoding="async" src="https://richliu.com/wp-content/uploads/2016/10/擷取-300x114.png" alt="HTT2 測試" width="300" height="114" class="aligncenter size-medium wp-image-2027" srcset="https://richliu.com/wp-content/uploads/2016/10/擷取-300x114.png 300w, https://richliu.com/wp-content/uploads/2016/10/擷取-768x292.png 768w, https://richliu.com/wp-content/uploads/2016/10/擷取-1024x390.png 1024w, https://richliu.com/wp-content/uploads/2016/10/擷取.png 1471w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>雖然沒有加快多少, 至少本小站也是支援 HTTP/2 了. </p>
<p>The post <a rel="nofollow" href="https://richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/">[Gentoo] 替 Apache 加上 http2 支援</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
