<?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>ssl &#8211; 備忘程式碼</title>
	<atom:link href="https://www.weblink.idv.tw/tag/ssl/feed" rel="self" type="application/rss+xml" />
	<link>https://www.weblink.idv.tw</link>
	<description>Javascript, PHP, HTML5 &#38; CSS3 coding memos</description>
	<lastBuildDate>Thu, 14 Dec 2023 07:52:07 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.2</generator>
	<item>
		<title>申請Let&#8217;s Encrypt－以Raspberry Pi為例</title>
		<link>https://www.weblink.idv.tw/2017/74</link>
					<comments>https://www.weblink.idv.tw/2017/74#respond</comments>
		
		<dc:creator><![CDATA[Steven LIU]]></dc:creator>
		<pubDate>Tue, 11 Jul 2017 00:00:53 +0000</pubDate>
				<category><![CDATA[RaspberryPi]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[letsencrypt]]></category>
		<category><![CDATA[raspberrypi]]></category>
		<category><![CDATA[ssl]]></category>
		<guid isPermaLink="false">https://www.weblink.idv.tw/?p=74</guid>

					<description><![CDATA[Google已經宣布以HTTPS作安全加密的網頁將會在搜尋的排名中取得較高的順位，就算網站沒有交易需求，為了S [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Google已經宣布以HTTPS作安全加密的網頁將會在搜尋的排名中取得較高的順位，就算網站沒有交易需求，為了SEO也值得花點時間申請一下SSL。</p>



<span id="more-74"></span>



<p>以往申請SSL憑證都需要費用，不過現在有了<a rel="noreferrer noopener" href="https://letsencrypt.org/" target="_blank">Let&#8217;s Encrypt</a>這個免費的數位憑證認證機構，任何網站都能免費升級為HTTPS啦！由於「備忘程式碼」這個網站是架在Raspberry Pi上，因此這篇我們就來說明一下如何為Raspberry Pi上架的網站申請SSL。 </p>



<p><a href="https://certbot.eff.org/" target="_blank" rel="noopener">Certbot</a>這個網站提供了非常簡單的套件與操作說明，讓我們能很輕鬆的替網站升級為HTTPS，實作步驟如下：<br> <b>1. 先將路由器的對外443 port開放，對內則指向我們的Raspberry Pi</b><br> <b>2. 進入Raspberry Pi的command模式，移動到/usr/local/bin/、輸入指令下載certbot-auto安裝套件：</b></p>



<pre class="wp-block-code"><code>cd /usr/local/bin
wget https://dl.eff.org/certbot-auto</code></pre>



<p><b>3. 下載完成後讓certbot-auto可執行：</b></p>



<pre class="wp-block-code"><code>chmod a+x certbot-auto</code></pre>



<p><b>4. 執行certbot-auto：</b></p>



<pre class="wp-block-code"><code>sudo ./certbot-auto --apache --domain=www.blabla.com, blabla.com certonly</code></pre>



<p>
（domain=後面接網站網址，用逗號分隔不同domain name）</p>



<p>然後……，沒有然後，這樣就完成了！certbot-auto會把所有的設定檔都搞定，現在只要上https://www.blabla.com就會看到網址列前面那個綠色的鎖頭跟安全字樣啦！</p>



<hr class="wp-block-separator has-css-opacity"/>



<p><b>同場加映：定期更新</b><br> 由於Let&#8217;s Encrypt的憑證效期只有90天，因此必須每三個月自己手動更新一次憑證，不過這個動作可以由排程自動執行，只要輸入：</p>



<pre class="wp-block-code"><code>sudo crontab -e</code></pre>



<p>若是首次執行會跳出一個選單，詢問你要用什麼編輯程式，我習慣用nano，所以選<code>"/bin/nano"</code>，接著便會進入crontab這個檔案。將游標移到最下面，輸入：</p>



<pre class="wp-block-code"><code>30 2 1 * * /usr/local/bin/certbot-auto renew --quiet</code></pre>



<p>（前面五組數字分別代表「分」、「時」、「日」、「月」、「星期」，所以這裡的意思是「每個月1號的凌晨2:30分」）<br>
輸入完畢後按<code>ctrl-x</code>再按<code>y</code>存檔，系統便會自動排程檢查是否需要更新，不用我們再花心思留意憑證是否過期了！</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.weblink.idv.tw/2017/74/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
