<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>小惡魔 - 電腦技術 - 工作筆記 - AppleBOY</title>
	
	<link>http://blog.wu-boy.com</link>
	<description>介紹一堆美食日記，生活日記，電腦筆記</description>
	<lastBuildDate>Thu, 13 Jun 2013 09:33:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/appleboy" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="appleboy" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>介紹一堆美食日記，生活日記，電腦筆記</itunes:subtitle><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">appleboy</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>How to install Gearman on Ubuntu or Debian with MySQL 安裝測試篇</title>
		<link>http://blog.wu-boy.com/2013/06/how-to-install-gearman-on-ubuntu-or-debian-with-mysql/</link>
		<comments>http://blog.wu-boy.com/2013/06/how-to-install-gearman-on-ubuntu-or-debian-with-mysql/#comments</comments>
		<pubDate>Thu, 13 Jun 2013 09:31:40 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Gearman]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4249</guid>
		<description><![CDATA[Gearman 可以在背景幫忙處理繁瑣的工作，例如壓縮影片、處理縮圖、發送認證信…等，這次不會提到太多 Gearman 介紹，如果想瞭解 Gearman 可以參考小鐵兄寫的 Gearman 心得，此篇會筆記如何在 Ubuntu or Debian 安裝 Gearman 搭配 MySQL 服務，當然如果你不是使用 MySQL，也可以另外搭配 Memcached 或 SQLite 都可以 Ubuntu or Debian 安裝 其實安裝方式很簡單，只需要透過 apt-get 指令就可以安裝完成 $ aptitude -y install gearman gearman-job-server libgearman-dev libdrizzle0 安裝完成後，在命令列打入 gearmand -V 檢查版本，會發現預設的版本非常的舊，但是沒關係，Ubuntu 可以透過 Package Repository 來安裝到最新版 $ add-apt-repository ppa:gearman-developers/ppa $ aptitude -y update 但是在 Debian 7.0 版似乎起不了任何作用，裝起來版本真的很低，爽度不夠，所以最終解法還是要透過 [...]]]></description>
				<content:encoded><![CDATA[<div style="margin:0 auto; text-align:center"><img class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://gearman.org/_media/:wiki:logo.png" alt="" /><noscript><img src="http://gearman.org/_media/:wiki:logo.png" alt="" /></noscript></div>
<p><a href="http://gearman.org/" target="_blank">Gearman</a> 可以在背景幫忙處理繁瑣的工作，例如壓縮影片、處理縮圖、發送認證信…等，這次不會提到太多 Gearman 介紹，如果想瞭解 Gearman 可以參考<a href="http://www.jaceju.net/" target="_blank">小鐵兄</a>寫的 <a href="http://www.jaceju.net/blog/archives/1211/" target="_blank">Gearman 心得</a>，此篇會筆記如何在 Ubuntu or Debian 安裝 Gearman 搭配 MySQL 服務，當然如果你不是使用 MySQL，也可以另外搭配 <a href="http://memcached.org/" target="_blank">Memcached</a> 或 <a href="http://www.sqlite.org/" target="_blank">SQLite</a> 都可以<br />
<span id="more-4249"></span></p>
<h3>Ubuntu or Debian 安裝</h3>
<p>其實安裝方式很簡單，只需要透過 apt-get 指令就可以安裝完成</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> gearman gearman-job-server libgearman-dev libdrizzle0</div></div>
<p>安裝完成後，在命令列打入 <strong><span style="color:green">gearmand -V</span></strong> 檢查版本，會發現預設的版本非常的舊，但是沒關係，Ubuntu 可以透過 Package Repository 來安裝到最新版</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ add-apt-repository ppa:gearman-developers<span style="color: #000000; font-weight: bold;">/</span>ppa<br />
$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-y</span> update</div></div>
<p>但是在 Debian 7.0 版似乎起不了任何作用，裝起來版本真的很低，爽度不夠，所以最終解法還是要透過 tar 方式安裝，安裝過程一定會遇到一些沒安裝的 develop library，只要把相對應的套件安裝即可</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libboost-program-options-dev gperf libcloog-ppl0 libpq-dev libmemcached-dev libevent-dev<br />
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> https:<span style="color: #000000; font-weight: bold;">//</span>launchpad.net<span style="color: #000000; font-weight: bold;">/</span>libdrizzle<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.1</span><span style="color: #000000; font-weight: bold;">/</span>5.1.4<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>libdrizzle-5.1.4.tar.gz <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>libdrizzle-5.1.4.tar.gz<br />
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> https:<span style="color: #000000; font-weight: bold;">//</span>launchpad.net<span style="color: #000000; font-weight: bold;">/</span>gearmand<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.2</span><span style="color: #000000; font-weight: bold;">/</span>1.1.8<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>gearmand-1.1.8.tar.gz <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>gearmand-1.1.8.tar.gz<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz libdrizzle-5.1.4.tar.gz <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> libdrizzle-5.1.4 <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span><br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz gearmand-1.1.8.tar.gz <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> gearmand-1.1.8 <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>安裝完成後，直接打 <strong><span style="color:green">gearmand -h</span></strong></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">builtin:<br />
<br />
libmemcached:<br />
&nbsp; <span style="color: #660033;">--libmemcached-servers</span> arg List of Memcached servers to use.<br />
<br />
Postgres:<br />
&nbsp; <span style="color: #660033;">--libpq-conninfo</span> arg &nbsp; &nbsp; &nbsp; PostgreSQL connection information string.<br />
&nbsp; <span style="color: #660033;">--libpq-table</span> arg <span style="color: #7a0874; font-weight: bold;">&#40;</span>=queue<span style="color: #7a0874; font-weight: bold;">&#41;</span> Table to use.<br />
<br />
MySQL:<br />
&nbsp; <span style="color: #660033;">--mysql-host</span> arg <span style="color: #7a0874; font-weight: bold;">&#40;</span>=localhost<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp;MySQL host.<br />
&nbsp; <span style="color: #660033;">--mysql-port</span> arg <span style="color: #7a0874; font-weight: bold;">&#40;</span>=<span style="color: #000000;">3306</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Port of server. <span style="color: #7a0874; font-weight: bold;">&#40;</span>by default <span style="color: #000000;">3306</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; <span style="color: #660033;">--mysql-user</span> arg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySQL user.<br />
&nbsp; <span style="color: #660033;">--mysql-password</span> arg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySQL user password.<br />
&nbsp; <span style="color: #660033;">--mysql-db</span> arg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MySQL database.<br />
&nbsp; <span style="color: #660033;">--mysql-table</span> arg <span style="color: #7a0874; font-weight: bold;">&#40;</span>=gearman_queue<span style="color: #7a0874; font-weight: bold;">&#41;</span> MySQL table name.</div></div>
<p>如果搭配 Mariadb 的話，請安裝 <strong><span style="color:red">libmariadbclient-dev</span></strong> 才可以將 MySQL 功能編譯進去。從上面結果發現 Gearman 目前支援 <a href="http://libmemcached.org/libMemcached.html" target="_blank">libmemcached</a>, <a href="http://www.postgresql.org/" target="_blank">Postgres</a>, MySQL 串接方式，底下來一一介紹</p>
<h3>搭配 memcached</h3>
<p>Gearman 0.7 版本以上才支援，設定方式很簡單，開啟 /etc/default/gearman-job-server 找到底下字串</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">PARAMS</span>=<span style="color: #ff0000;">&quot;--listen=127.0.0.1&quot;</span></div></div>
<p>改成</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">PARAMS</span>=<span style="color: #ff0000;">&quot;-q libmemcached --libmemcached-servers=localhost&quot;</span></div></div>
<p>當然要先檢查系統有無啟動 memcached port 11211。重新啟動 gearmand</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gearman-job-server restart</div></div>
<h3>搭配 MySQL</h3>
<p>設定前，請先將 Database 建立完成</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'CREATE DATABASE gearman;'</span></div></div>
<p>最後設定 /etc/default/gearman-job-server</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">PARAMS</span>=<span style="color: #ff0000;">&quot;-q mysql --mysql-host=localhost --mysql-user=xxxx --mysql-password=xxxxx--mysql-db=gearman --mysql-table=gearman_queue&quot;</span></div></div>
<p>重新啟動後，Gearman 會在資料庫建立 gearman_queue 資料表</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #ff0000;">`gearman_queue`</span> <span style="color: #66cc66;">&#40;</span><br />
&nbsp; <span style="color: #ff0000;">`unique_key`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">64</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
&nbsp; <span style="color: #ff0000;">`function_name`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
&nbsp; <span style="color: #ff0000;">`priority`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
&nbsp; <span style="color: #ff0000;">`data`</span> longblob<span style="color: #66cc66;">,</span><br />
&nbsp; <span style="color: #ff0000;">`when_to_run`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
&nbsp; <span style="color: #993333; font-weight: bold;">UNIQUE</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #ff0000;">`unique_key`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`unique_key`</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">`function_name`</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>InnoDB <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>utf8;</div></div>
<p>嗯嗯，非常好，但是你會發現一個問題，都已經在搞 InnoDB 竟然沒有 primary key，所以這就請系統管理者幫忙建立上去。</p>
<h3>測試資料</h3>
<p>首先 Gearman 支援任何程式語言 (Shell, Perl, Node.js, PHP, Python, Java ..等)，先來介紹使用 PHP command line，請安裝 PHP Gearman API Extension</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>pecl <span style="color: #c20cb9; font-weight: bold;">install</span> channel:<span style="color: #000000; font-weight: bold;">//</span>pecl.php.net<span style="color: #000000; font-weight: bold;">/</span>gearman-1.1.0</div></div>
<p>建立 <strong><span style="color:green">/etc/php5/cli/conf.d/gearman.ini</span></strong>，內容為</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>gearman<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #007800;">extension</span>=gearman.so</div></div>
<p>重新啟動 php5 fpm</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>php5-fpm restart</div></div>
<p>用指令檢查</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ php <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> gearman<br />
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>cli<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>gearman.ini,<br />
gearman<br />
gearman support =<span style="color: #000000; font-weight: bold;">&gt;</span> enabled<br />
libgearman version =<span style="color: #000000; font-weight: bold;">&gt;</span> 1.1.8</div></div>
<p>撰寫 worker.php (copy from <a href="http://www.jaceju.net/blog/archives/1211/" target="_blank">小鐵部落格</a>)</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #000088;">$worker</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GearmanWorker<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$worker</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addServer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 預設為 localhost</span><br />
<span style="color: #000088;">$worker</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addFunction</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sendEmail'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'doSendEmail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$worker</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addFunction</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'resizeImage'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'doResizeImage'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$worker</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">work</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/sleep"><span style="color: #990000;">sleep</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 無限迴圈，並讓 CPU 休息一下</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> doSendEmail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$job</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$job</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">workload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/print_r"><span style="color: #990000;">print_r</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/sleep"><span style="color: #990000;">sleep</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 模擬處理時間</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Email sending is done really.<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> doResizeImage<span style="color: #009900;">&#40;</span><span style="color: #000088;">$job</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$job</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">workload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/print_r"><span style="color: #990000;">print_r</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/sleep"><span style="color: #990000;">sleep</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 模擬處理時間</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Image resizing is really done.<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Client.php</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #000088;">$client</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GearmanClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addServer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 預設為 localhost</span><br />
<span style="color: #000088;">$emailData</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'name'</span> &nbsp;<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'web'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'email'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'member@example.com'</span><span style="color: #339933;">,</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$imageData</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'image'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/var/www/pub/image/test.png'</span><span style="color: #339933;">,</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doBackground</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sendEmail'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailData</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Email sending is done.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doBackground</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'resizeImage'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$imageData</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Image resizing is done.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></div></div>
<p>到這裡直接先執行 Client 程式，如果安裝的 Gearman 吐出底下訊息:</p>
<blockquote><p>PHP Warning:  GearmanClient::doBackground(): _client_run_tasks(GEARMAN_SERVER_ERROR) QUEUE_ERROR:QUEUE_ERROR -> libgearman/client.cc:1581 in /root/client.php on line 11</p></blockquote>
<p>表示 Server 沒有產生 unique key，所以造成第二次新增 job 的時候產生衝突，解決方式很解單，在 <a href="http://php.net/manual/en/gearmanclient.dobackground.php" target="_blank">doBackground</a>，第三個參數加上 unique key</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$</span>client-<span style="color: #000000; font-weight: bold;">&gt;</span>doBackground<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'sendEmail'</span>, serialize<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$emailData</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, md5<span style="color: #7a0874; font-weight: bold;">&#40;</span>uniqid<span style="color: #7a0874; font-weight: bold;">&#40;</span>rand<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #c20cb9; font-weight: bold;">true</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;</div></div>
<p>這樣就可以完整測試了。</p>

<div class="wp_rp_wrap  wp_rp_plain" id="wp_rp_first"><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2012/01/how-to-install-grub2-from-live-cd/" class="wp_rp_title">用 Ubuntu 10.10 Live CD 重新安裝 GRUB 2 到 Bootloader</a> (0)</li><li ><a href="http://blog.wu-boy.com/2009/02/debian-gnulinux-50-%e7%99%bc%e5%b8%83-zhcon-%e8%a7%a3%e6%b1%ba%e7%b5%82%e7%ab%af%e6%a9%9f%e4%ba%82%e7%a2%bc/" class="wp_rp_title">[Debian] GNU/Linux 5.0 發布 zhcon 解決終端機亂碼 </a> (3)</li><li ><a href="http://blog.wu-boy.com/2010/01/how-to-change-run-levels-and-init-d-scripts-in-ubuntu-debian/" class="wp_rp_title">How to change run levels and init.d scripts in Ubuntu &#038; Debian</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/03/ubuntu-debian-%e6%9e%b6%e8%a8%ad-apache-mpm-worker-mod_fcgid-%e7%ad%86%e8%a8%98/" class="wp_rp_title">Ubuntu (Debian) 架設 apache mpm worker mod_fcgid 筆記 </a> (0)</li><li ><a href="http://blog.wu-boy.com/2012/05/how-to-resolve-apt-get-no_pubkey-gpg-error/" class="wp_rp_title">[筆記] Ubuntu apt-get update 出現 NO_PUBKEY / GPG error</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/02/%e5%88%87%e6%8f%9b-ubuntu-apt-%e7%9a%84-mirror-site/" class="wp_rp_title">切換 Ubuntu apt 的 mirror site</a> (1)</li><li ><a href="http://blog.wu-boy.com/2006/10/linux-ubuntu-606-proftpd-mysql-%e5%ae%89%e8%a3%9d%e6%96%b9%e5%bc%8f/" class="wp_rp_title">[Linux] Ubuntu 6.06 Proftpd + Mysql 安裝方式</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/03/galera-cluster-for-mysql-multi-master-replication/" class="wp_rp_title">Galera Cluster for MySQL Multi-master Replication</a> (1)</li><li ><a href="http://blog.wu-boy.com/2012/01/ubuntu-mount-dvd-iso-on-ubuntu/" class="wp_rp_title">[筆記] 在 Ubuntu mount DVD ISO  檔案</a> (1)</li><li ><a href="http://blog.wu-boy.com/2007/09/freebsd-%e5%ae%89%e8%a3%9d-memcache-for-php/" class="wp_rp_title">[FreeBSD] 安裝 memcache for php 多重伺服器共享 Session</a> (8)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/06/how-to-install-gearman-on-ubuntu-or-debian-with-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSDC 和 KSDG 影音紀錄 (淺談 GruntJS 整合開發工具)</title>
		<link>http://blog.wu-boy.com/2013/06/jsdc-ksdg-gruntjs-tool/</link>
		<comments>http://blog.wu-boy.com/2013/06/jsdc-ksdg-gruntjs-tool/#comments</comments>
		<pubDate>Tue, 11 Jun 2013 02:38:38 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[Grunt]]></category>
		<category><![CDATA[GruntJS]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4242</guid>
		<description><![CDATA[很高興今年在 JSDC 擔任講師，演講主題為『你不可不知的前端開發工具』，這場議程只有30分鐘可以講，時間實在是不太夠，要消化這麼多工具其實對於聽眾有點困難，真是對不起聽眾了，不過沒關係，高雄 KSDG 五月份邀請我講『打造團隊共同開發環境』，其實就是將 GruntJS 精華整個講一遍，大概有一個多小時，底下是官方影音，如果朋友們沒北上參加，也可以透過 JSDC Youtube 來欣賞。 JSDC 35分鐘議程 KSDG Web Course#3 如何打造前端開發環境 + workshop(1/3) KSDG Web Course#3 如何打造前端開發環境 + workshop(2/3) KSDG Web Course#3 如何打造前端開發環境 + workshop(3/3) Related View高雄 KSDG 分享: 打造團隊共同開發環境 (0)2013 Javascript Conference: 你不可不知的前端開發工具 (3)Javascript command line tool GruntJS 介紹 (0)無痛安裝 NodeJS 和 Node Framework Express (0)Bower 管理網站套件的好工具 (1)壓縮 Javascript [...]]]></description>
				<content:encoded><![CDATA[<div style="margin: 0 auto; text-align: center;"><a title="gruntlogo by appleboy46, on Flickr" href="http://www.flickr.com/photos/appleboy/8591850168/"><img alt="gruntlogo" class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm9.staticflickr.com/8244/8591850168_ca0e125ffa_n.jpg" width="200" height="200" /><noscript><img alt="gruntlogo" src="http://farm9.staticflickr.com/8244/8591850168_ca0e125ffa_n.jpg" width="200" height="200" /></noscript></a></div>
<p>很高興今年在 <a href="http://jsdc.tw/2013/" target="_blank">JSDC</a> 擔任講師，演講主題為『<a href="http://blog.wu-boy.com/2013/05/2013-javascript-conference-front-tool-grunt-js/" target="_blank">你不可不知的前端開發工具</a>』，這場議程只有30分鐘可以講，時間實在是不太夠，要消化這麼多工具其實對於聽眾有點困難，真是對不起聽眾了，不過沒關係，高雄 <a href="https://www.facebook.com/groups/KSDGroup" target="_blank">KSDG</a> 五月份邀請我講『<a href="http://blog.wu-boy.com/2013/05/how-to-integrate-front-end-tools-via-gruntjs/" target="_blank">打造團隊共同開發環境</a>』，其實就是將 <a href="http://gruntjs.com/" target="_blank">GruntJS</a> 精華整個講一遍，大概有一個多小時，底下是官方影音，如果朋友們沒北上參加，也可以透過 <a href="http://www.youtube.com/user/JSDCTW/videos" target="_blank">JSDC Youtube</a> 來欣賞。</p>
<p>JSDC 35分鐘議程<br />
<iframe width="640" height="360" src="http://www.youtube.com/embed/dCSZ0l1hT0E" frameborder="0" allowfullscreen></iframe><br />
<span id="more-4242"></span><br />
KSDG Web Course#3 如何打造前端開發環境 + workshop(1/3)<br />
<iframe width="640" height="360" src="http://www.youtube.com/embed/gRgTWNyh6uM" frameborder="0" allowfullscreen></iframe></p>
<p>KSDG Web Course#3 如何打造前端開發環境 + workshop(2/3)<br />
<iframe width="640" height="360" src="http://www.youtube.com/embed/k6NP02KF8ig" frameborder="0" allowfullscreen></iframe></p>
<p>KSDG Web Course#3 如何打造前端開發環境 + workshop(3/3)<br />
<iframe width="640" height="360" src="http://www.youtube.com/embed/RdWa9szIpKw" frameborder="0" allowfullscreen></iframe></p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2013/05/how-to-integrate-front-end-tools-via-gruntjs/" class="wp_rp_title">高雄 KSDG 分享: 打造團隊共同開發環境</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/05/2013-javascript-conference-front-tool-grunt-js/" class="wp_rp_title">2013 Javascript Conference: 你不可不知的前端開發工具</a> (3)</li><li ><a href="http://blog.wu-boy.com/2013/03/javascript-command-line-tool-gruntjs/" class="wp_rp_title">Javascript command line tool GruntJS 介紹</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/08/%e7%84%a1%e7%97%9b%e5%ae%89%e8%a3%9d-nodejs-%e5%92%8c-node-framework-express/" class="wp_rp_title">無痛安裝 NodeJS 和 Node Framework Express</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/01/bower-is-a-package-manager-for-the-web/" class="wp_rp_title">Bower 管理網站套件的好工具</a> (1)</li><li ><a href="http://blog.wu-boy.com/2013/02/compress-css-javascript-script-command/" class="wp_rp_title">壓縮 Javascript 和 CSS 檔案 script command</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/11/node-version-management/" class="wp_rp_title">Node.js Version Management 多版本管理</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/04/javascript-cross-browser-best-practices/" class="wp_rp_title">[小技巧] JavaScript Cross Browser Best Practices </a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/05/backbone-routing-pushstate-in-ie/" class="wp_rp_title">Backbone Routing pushState in IE</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/05/flickr-pro-limits-and-free-accounts/" class="wp_rp_title">Flickr 改版及收費方式改變</a> (2)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/06/jsdc-ksdg-gruntjs-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx + phpMyAdmin 搭配 SSL 設定</title>
		<link>http://blog.wu-boy.com/2013/06/force-phpmyadmin-ssl-with-nginx/</link>
		<comments>http://blog.wu-boy.com/2013/06/force-phpmyadmin-ssl-with-nginx/#comments</comments>
		<pubDate>Sat, 08 Jun 2013 07:51:08 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[phpMyAdmin]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4234</guid>
		<description><![CDATA[phpMyAdmin 是一套用來管理 MySQL 的 Web 介面，如果要讓 phpMyAdmin 強制走 https 的話，可以透過兩種方式，一種是直接設定 phpMyAdmin，另外一種方式是透過 Apache rewrite 或 Nginx 設定，底下來分別說明。 1. phpMyAdmin 設定 直接設定 config.inc.php，加入底下設定 $cfg&#91;'ForceSSL'&#93; = true; 2. Nginx 或 Apache 設定 打開 Apache mod_rewrite 功能，將設定寫入 .htaccess RewriteEngine On RewriteCond %&#123;SERVER_PORT&#125; !^443$ RewriteRule ^/directory&#40;.*&#41;$ https://%&#123;HTTP_HOST&#125;/directory$1 &#91;L,R&#93; 或是使用 Nginx 設定，將 80 port 轉到 https，設定 443 port 的 SSL 憑證。 [...]]]></description>
				<content:encoded><![CDATA[<div style="margin:0 auto; text-align:center"><a href="http://www.flickr.com/photos/appleboy/8171305355/" title="mysql_logo by appleboy46, on Flickr"><img class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm9.staticflickr.com/8488/8171305355_7fb578fdc9.jpg" width="300" alt="mysql_logo"><noscript><img src="http://farm9.staticflickr.com/8488/8171305355_7fb578fdc9.jpg" width="300" alt="mysql_logo"></noscript></a></div>
<p><a href="http://www.phpmyadmin.net/home_page/index.php" target="_blank">phpMyAdmin</a> 是一套用來管理 <a href="http://www.mysql.com/" target="_blank">MySQL</a> 的 Web 介面，如果要讓 phpMyAdmin 強制走 https 的話，可以透過兩種方式，一種是直接設定 phpMyAdmin，另外一種方式是透過 <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html" target="_blank">Apache rewrite</a> 或 <a href="http://nginx.org/" target="_blank">Nginx</a> 設定，底下來分別說明。<br />
<span id="more-4234"></span></p>
<h3>1. phpMyAdmin 設定</h3>
<p>直接設定 <strong><span style="color:green">config.inc.php</span></strong>，加入底下設定</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$cfg</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ForceSSL'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span></div></div>
<h3>2. Nginx 或 Apache 設定</h3>
<p>打開 Apache mod_rewrite 功能，將設定寫入 .htaccess</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">RewriteEngine On<br />
RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SERVER_PORT<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>^<span style="color: #000000;">443</span>$<br />
RewriteRule ^<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$ https:<span style="color: #000000; font-weight: bold;">//%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #007800;">$1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>L,R<span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>或是使用 Nginx 設定，將 80 port 轉到 https，設定 443 port 的 SSL 憑證。</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; listen <span style="color: #000000;">80</span>;<br />
&nbsp; server_name xxx.xxx.xxx.xxx;<br />
&nbsp; rewrite ^ https:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$server_name</span><span style="color: #007800;">$request_uri</span>? permanent;<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
server <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; <span style="color: #666666; font-style: italic;"># listen 80 default_server deferred; # for Linux</span><br />
&nbsp; <span style="color: #666666; font-style: italic;"># listen 80 default_server accept_filter=httpready; # for FreeBSD</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">#listen 80;</span><br />
<br />
&nbsp; listen <span style="color: #000000;">443</span> ssl spdy;<br />
&nbsp; ssl on;<br />
&nbsp; ssl_certificate <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>api.ovoq.tv<span style="color: #000000; font-weight: bold;">/</span>server.crt;<br />
&nbsp; ssl_certificate_key <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>api.ovoq.tv<span style="color: #000000; font-weight: bold;">/</span>ssl.key;<br />
&nbsp; ssl_protocols &nbsp; &nbsp; &nbsp; SSLv3 TLSv1 TLSv1.1 TLSv1.2;<br />
&nbsp; ssl_ciphers &nbsp; &nbsp; &nbsp; &nbsp; HIGH:<span style="color: #000000; font-weight: bold;">!</span>aNULL:<span style="color: #000000; font-weight: bold;">!</span>MD5;<br />
&nbsp; ssl_session_cache shared:SSL:10m;<br />
&nbsp; ssl_session_timeout 5m;<br />
<br />
&nbsp; <span style="color: #666666; font-style: italic;"># The host name to respond to</span><br />
&nbsp; server_name xxx.xxx.xxx.xxx;<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>上面 Nginx 設定完成後，會發現登入 phpMyAdmin 後，網址被轉成</p>
<blockquote><p>http://xxx.xxx.xxx.xx:443</p></blockquote>
<p>馬上看到網頁噴 </p>
<blockquote><p>the plain http request was sent to https port</p></blockquote>
<p>看到這訊息，是 Nginx 產生的，error code 是 497，其實將此 error 導向正確的地方就可以了，在 Nginx 設定檔加入</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">error_page <span style="color: #000000;">497</span> https:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$host</span><span style="color: #007800;">$request_uri</span>;</div></div>
<p>就可以解決此問題了。</p>
<p>Ref:<br />
<a href="http://forum.nginx.org/read.php?2,5065,5065" target="_blank">The plain HTTP request was sent to HTTPS port</a><br />
<a href="http://www.michaelbarton.name/2009/12/13/forcing-ssl-with-phpmyadmin/" target="_blank">Forcing SSL with phpMyAdmin</a></p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2008/07/%e8%bd%89%e8%b2%bc-ror%ef%bc%9aruby-on-rails%e7%9a%84%e9%83%a8%e7%bd%b2%e6%96%b9%e6%a1%88%e9%81%b8%e6%93%87/" class="wp_rp_title">[轉貼] RoR：Ruby on Rails的部署方案選擇</a> (0)</li><li ><a href="http://blog.wu-boy.com/2012/10/php-mvc-framework-nginx-php-fpm/" class="wp_rp_title">PHP MVC Framework 搭配 Nginx + PHP-FPM 設定檔</a> (0)</li><li ><a href="http://blog.wu-boy.com/2008/06/%e5%9f%ba%e6%9c%ac%e5%84%aa%e5%8c%96-tuning-apache-%e8%b7%9f-tuning-mysql-%e6%95%88%e8%83%bd/" class="wp_rp_title">基本優化 tuning apache 跟 tuning mysql 跟 php 效能 </a> (5)</li><li ><a href="http://blog.wu-boy.com/2013/04/nginx-1-4-0-support-spdy-module/" class="wp_rp_title">nginx 1.4.0 釋出並支援 SPDY</a> (3)</li><li ><a href="http://blog.wu-boy.com/2012/05/php-fastcgi-with-nginx-on-ubuntu-10-10-maverick/" class="wp_rp_title">在 Ubuntu 10.10 (Maverick) 架設 Nginx + PHP FastCGI</a> (3)</li><li ><a href="http://blog.wu-boy.com/2013/04/install-nginx-spdy-module-on-ubuntu-or-debian/" class="wp_rp_title">Install Nginx + spdy module on Ubuntu or Debian</a> (0)</li><li ><a href="http://blog.wu-boy.com/2012/05/install-nginx-php-fastcgi-on-amazon-linux/" class="wp_rp_title">在 Fedora 或 Amazon Linux AMI 架設 Nginx + PHP FastCGI </a> (1)</li><li ><a href="http://blog.wu-boy.com/2012/06/fix-apache-mod_fcgid-http-request-length-136000-so-far-exceeds-maxrequestlen/" class="wp_rp_title">[筆記] 解決 apache mod_fcgid: HTTP request length 136000 (so far) exceeds MaxRequestLen (131072)</a> (2)</li><li ><a href="http://blog.wu-boy.com/2012/11/nginx-check-if-file-exists/" class="wp_rp_title">Nginx 判斷檔案是否存在</a> (0)</li><li ><a href="http://blog.wu-boy.com/2010/06/freebsd-update-apache-2-2-15-php-5-3-2-and-mysql-downgrade-to-5-1-9/" class="wp_rp_title">[FreeBSD] update apache -> 2.2.15, PHP -> 5.3.2, and MySQL downgrade to 5.1.9</a> (1)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/06/force-phpmyadmin-ssl-with-nginx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>高雄 KSDG 分享: 打造團隊共同開發環境</title>
		<link>http://blog.wu-boy.com/2013/05/how-to-integrate-front-end-tools-via-gruntjs/</link>
		<comments>http://blog.wu-boy.com/2013/05/how-to-integrate-front-end-tools-via-gruntjs/#comments</comments>
		<pubDate>Sat, 25 May 2013 13:28:21 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[Compass]]></category>
		<category><![CDATA[Grunt]]></category>
		<category><![CDATA[GruntJS]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4220</guid>
		<description><![CDATA[很高興受到高雄 KSDG 邀請，分享上禮拜在 JSDC 所介紹主題: 你不可不知的前端開發工具，在 JSDC 現場只有半小時可以講，這次在高雄有一個半小時可以講，如果想詳細了解前端工具，可以參考上禮拜的投影片，底下是在高雄軟體科技園區所分享。謝謝 Eric Bi 及工作人員可以讓我分享這次議題。 最後附上 Github 專案，歡迎大家 fork。 Related View2013 Javascript Conference: 你不可不知的前端開發工具 (3)Javascript command line tool GruntJS 介紹 (0)JSDC 和 KSDG 影音紀錄 (淺談 GruntJS 整合開發工具) (0)Node.js Version Management 多版本管理 (0)無痛安裝 NodeJS 和 Node Framework Express (0)壓縮 Javascript 和 CSS 檔案 script command (0)Backbone.js rewrite into CoffeeScript? (0)Node [...]]]></description>
				<content:encoded><![CDATA[<div style="margin: 0 auto; text-align: center;"><a title="gruntlogo by appleboy46, on Flickr" href="http://www.flickr.com/photos/appleboy/8591850168/"><img alt="gruntlogo" class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm9.staticflickr.com/8244/8591850168_ca0e125ffa_n.jpg" width="200" height="200" /><noscript><img alt="gruntlogo" src="http://farm9.staticflickr.com/8244/8591850168_ca0e125ffa_n.jpg" width="200" height="200" /></noscript></a></div>
<p>很高興受到高雄 <a href="https://www.facebook.com/groups/KSDGroup/" target="_blank">KSDG</a> 邀請，分享上禮拜在 <a href="http://jsdc.tw/2013/" target="_blank">JSDC</a> 所介紹主題: <a href="http://blog.wu-boy.com/2013/05/2013-javascript-conference-front-tool-grunt-js/" target="_blank">你不可不知的前端開發工具</a>，在 JSDC 現場只有半小時可以講，這次在高雄有一個半小時可以講，如果想詳細了解前端工具，可以參考上禮拜的投影片，底下是在高雄軟體科技園區所分享。謝謝 <a href="https://www.facebook.com/hsuani.bi" target="_blank">Eric Bi</a> 及工作人員可以讓我分享這次議題。<br />
<span id="more-4220"></span><br />
<iframe src="http://www.slideshare.net/slideshow/embed_code/21893851" width="597" height="486" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe></p>
<p>最後附上 <a href="https://github.com/appleboy/html5-template-engine" target="_blank">Github 專案</a>，歡迎大家 fork。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2013/05/2013-javascript-conference-front-tool-grunt-js/" class="wp_rp_title">2013 Javascript Conference: 你不可不知的前端開發工具</a> (3)</li><li ><a href="http://blog.wu-boy.com/2013/03/javascript-command-line-tool-gruntjs/" class="wp_rp_title">Javascript command line tool GruntJS 介紹</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/06/jsdc-ksdg-gruntjs-tool/" class="wp_rp_title">JSDC 和 KSDG 影音紀錄 (淺談 GruntJS 整合開發工具)</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/11/node-version-management/" class="wp_rp_title">Node.js Version Management 多版本管理</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/08/%e7%84%a1%e7%97%9b%e5%ae%89%e8%a3%9d-nodejs-%e5%92%8c-node-framework-express/" class="wp_rp_title">無痛安裝 NodeJS 和 Node Framework Express</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/02/compress-css-javascript-script-command/" class="wp_rp_title">壓縮 Javascript 和 CSS 檔案 script command</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/03/backbone-js-rewrite-into-coffeescript/" class="wp_rp_title">Backbone.js rewrite into CoffeeScript?</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/01/node-version-manager/" class="wp_rp_title">Node Version Manager 版本管理 NVM</a> (3)</li><li ><a href="http://blog.wu-boy.com/2013/02/git-hooks-parse-php-error-before-commit/" class="wp_rp_title">在 git Commit 之前檢查 PHP 是否有錯誤</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/10/install-compass-css-authoring-framework-on-windows/" class="wp_rp_title">在 Windows 底下安裝 Compass CSS Authoring Framework</a> (1)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/05/how-to-integrate-front-end-tools-via-gruntjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flickr 改版及收費方式改變</title>
		<link>http://blog.wu-boy.com/2013/05/flickr-pro-limits-and-free-accounts/</link>
		<comments>http://blog.wu-boy.com/2013/05/flickr-pro-limits-and-free-accounts/#comments</comments>
		<pubDate>Tue, 21 May 2013 03:29:55 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[www]]></category>
		<category><![CDATA[Flickr]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4211</guid>
		<description><![CDATA[在癮科技看到 Flickr大改版，收費方式也有異動，Flickr 整個介面大改版，這個就算了，連收費方式也大改，本來 Pro 的用戶，以後不再有 Unlimited storage 的優惠了，等到 pro 帳戶到期，系統會將帳戶轉為 Free 機制，雖然容量有到 1TB 的空間，其實也用不太完，但是整個感覺非常不好。 Flickr 目前只有三種帳戶機制，Free, Ad Free, Doublr，三個差異沒有很多，Free 的帳戶幾乎同等於之前的 pro 帳戶，只是有容量限制上限 1TB，再來就是有廣告，接著 Ad Free 一年49美金，差別就是沒有廣告，最後 Doublr 只是容量變成 2TB，也沒有廣告，但是價錢 &#8230;.. 每年 499.9 美金 .. 這價位，真的還蠻高的，我想之後也不打算續約了。更多 FQA 可以參考 Free Accounts, Upgrading and Gifts Related View[Ubuntu] 安裝 java-tool for Flickr upload tool (0)How to install Gearman on [...]]]></description>
				<content:encoded><![CDATA[<div style="margin:0 auto; text-align:center"><img class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm9.staticflickr.com/8267/8760804361_8fb7888250.jpg" alt="" /><noscript><img src="http://farm9.staticflickr.com/8267/8760804361_8fb7888250.jpg" alt="" /></noscript></div>
<p>在<a href="http://www.cool3c.com/" target="_blank">癮科技</a>看到 <a href="http://www.cool3c.com/article/67746" target="_blank">Flickr大改版，收費方式也有異動</a>，<a href="http://www.flickr.com" target="_blank">Flickr</a> 整個介面大改版，這個就算了，連收費方式也大改，本來 Pro 的用戶，以後不再有 <strong><span style="color:red">Unlimited storage</span></strong> 的優惠了，等到 pro 帳戶到期，系統會將帳戶轉為 Free 機制，雖然容量有到 1TB 的空間，其實也用不太完，但是整個感覺非常不好。</p>
<p>Flickr 目前只有三種帳戶機制，Free, Ad Free, Doublr，三個差異沒有很多，Free 的帳戶幾乎同等於之前的 pro 帳戶，只是有容量限制上限 1TB，再來就是有廣告，接著 Ad Free 一年49美金，差別就是沒有廣告，最後 Doublr 只是容量變成 2TB，也沒有廣告，但是價錢 &#8230;.. 每年 499.9 美金 .. 這價位，真的還蠻高的，我想之後也不打算續約了。更多 FQA 可以參考 <a href="http://www.flickr.com/help/limits/" target="_blank">Free Accounts, Upgrading and Gifts</a></p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2006/11/ubuntu-%e5%ae%89%e8%a3%9d-java-tool-for-flickr-upload-tool/" class="wp_rp_title">[Ubuntu] 安裝 java-tool for Flickr upload tool</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/06/how-to-install-gearman-on-ubuntu-or-debian-with-mysql/" class="wp_rp_title">How to install Gearman on Ubuntu or Debian with MySQL 安裝測試篇</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/09/linode-vps-inbound-%e6%b5%81%e9%87%8f%e5%b0%87%e4%b8%8d%e5%86%8d%e6%94%b6%e8%b2%bb/" class="wp_rp_title">Linode VPS Inbound 流量將不再收費</a> (1)</li><li ><a href="http://blog.wu-boy.com/2013/03/linode-nextgen-the-network-and-hardware/" class="wp_rp_title">Linode VPS 升級網路及硬體設備</a> (5)</li><li ><a href="http://blog.wu-boy.com/2013/04/linode-nextgen-ram-upgrade/" class="wp_rp_title">Linode 最後優惠 升級記憶體</a> (5)</li><li ><a href="http://blog.wu-boy.com/2012/12/code-refactoring-programer/" class="wp_rp_title">網頁重構工程師</a> (0)</li><li ><a href="http://blog.wu-boy.com/2012/12/linode-storage-increased-by-20/" class="wp_rp_title">虛擬主機商 Linode 增加 20% 儲存空間</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/06/jsdc-ksdg-gruntjs-tool/" class="wp_rp_title">JSDC 和 KSDG 影音紀錄 (淺談 GruntJS 整合開發工具)</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/05/how-to-integrate-front-end-tools-via-gruntjs/" class="wp_rp_title">高雄 KSDG 分享: 打造團隊共同開發環境</a> (0)</li><li ><a href="http://blog.wu-boy.com/2008/08/%e6%95%99%e5%ad%b8%e7%b6%b2%e9%a0%81%e7%b0%a1%e9%ab%94%e7%b9%81%e9%ab%94%e8%bd%89%e6%8f%9b%e7%a8%8b%e5%bc%8fgoogle-ajax-language-api/" class="wp_rp_title">[教學]網頁簡體繁體轉換程式(Google AJAX Language API)</a> (0)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/05/flickr-pro-limits-and-free-accounts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2013 Javascript Conference: 你不可不知的前端開發工具</title>
		<link>http://blog.wu-boy.com/2013/05/2013-javascript-conference-front-tool-grunt-js/</link>
		<comments>http://blog.wu-boy.com/2013/05/2013-javascript-conference-front-tool-grunt-js/#comments</comments>
		<pubDate>Sun, 19 May 2013 05:56:03 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[Bower]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[Compass]]></category>
		<category><![CDATA[Grunt]]></category>
		<category><![CDATA[GruntJS]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4205</guid>
		<description><![CDATA[台灣第 2 屆 JavaScript 研討會在 5/18, 5/19 登場，今年報到率到 95% 了，我也給了一場 Talk，關於前端工具介紹，包含 CoffeeScript, Compass, Livereload, Bower Package Manager .. 等，最後介紹主軸 Grunt.js 來整合這些工具。 最後附上 Github 專案，歡迎大家 fork。 Related View高雄 KSDG 分享: 打造團隊共同開發環境 (0)Javascript command line tool GruntJS 介紹 (0)JSDC 和 KSDG 影音紀錄 (淺談 GruntJS 整合開發工具) (0)Node.js Version Management 多版本管理 (0)Bower 管理網站套件的好工具 (1)Backbone.js rewrite into CoffeeScript? (0)Remove Google [...]]]></description>
				<content:encoded><![CDATA[<div style="margin:0 auto; text-align:center"><img class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm6.staticflickr.com/5454/7238452668_82262e37dc_o.png" alt="JSDC 2013" /><noscript><img src="http://farm6.staticflickr.com/5454/7238452668_82262e37dc_o.png" alt="JSDC 2013" /></noscript></div>
<p>台灣第 2 屆 JavaScript 研討會在 5/18, 5/19 登場，今年報到率到 95% 了，我也給了一場 Talk，關於前端工具介紹，包含 <a href="http://coffeescript.org/" target="_blank">CoffeeScript</a>, <a href="http://compass-style.org/" target="_blank">Compass</a>, <a href="http://livereload.com/" target="_blank">Livereload</a>, <a href="http://bower.io/" target="_blank">Bower</a> Package Manager .. 等，最後介紹主軸 <a href="http://gruntjs.com/" target="_blank">Grunt.js</a> 來整合這些工具。<br />
<span id="more-4205"></span><!--more--><br />
<iframe src="http://www.slideshare.net/slideshow/embed_code/21427762" width="597" height="486" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe></p>
<p>最後附上 <a href="https://github.com/appleboy/html5-template-engine" target="_blank">Github 專案</a>，歡迎大家 fork。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2013/05/how-to-integrate-front-end-tools-via-gruntjs/" class="wp_rp_title">高雄 KSDG 分享: 打造團隊共同開發環境</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/03/javascript-command-line-tool-gruntjs/" class="wp_rp_title">Javascript command line tool GruntJS 介紹</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/06/jsdc-ksdg-gruntjs-tool/" class="wp_rp_title">JSDC 和 KSDG 影音紀錄 (淺談 GruntJS 整合開發工具)</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/11/node-version-management/" class="wp_rp_title">Node.js Version Management 多版本管理</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/01/bower-is-a-package-manager-for-the-web/" class="wp_rp_title">Bower 管理網站套件的好工具</a> (1)</li><li ><a href="http://blog.wu-boy.com/2013/03/backbone-js-rewrite-into-coffeescript/" class="wp_rp_title">Backbone.js rewrite into CoffeeScript?</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/03/remove-google-cdn-reference-for-jquery/" class="wp_rp_title">Remove Google CDN reference for jQuery?</a> (5)</li><li ><a href="http://blog.wu-boy.com/2013/02/git-hooks-parse-php-error-before-commit/" class="wp_rp_title">在 git Commit 之前檢查 PHP 是否有錯誤</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/10/install-compass-css-authoring-framework-on-windows/" class="wp_rp_title">在 Windows 底下安裝 Compass CSS Authoring Framework</a> (1)</li><li ><a href="http://blog.wu-boy.com/2011/11/the-future-of-stylesheets-sass-compass/" class="wp_rp_title">Sass language 和 Compass 教學投影片</a> (0)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/05/2013-javascript-conference-front-tool-grunt-js/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>IE 6 瀏覽器用戶全球分佈</title>
		<link>http://blog.wu-boy.com/2013/05/internet-explorer-6-countdown/</link>
		<comments>http://blog.wu-boy.com/2013/05/internet-explorer-6-countdown/#comments</comments>
		<pubDate>Wed, 15 May 2013 06:21:51 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4199</guid>
		<description><![CDATA[此資料來自 The Internet Explorer 6 Countdown，大家注意上面圖示，沒想到台灣高居第二名，佔了 3.5% 僅次於大陸的 24%，大陸不感到意外，但是台灣的比例還真是高，難怪一堆程式開發者，抱怨連連 XD，這是統計到 2013 年 04 月，在這邊紀錄一下，等到明年這個時候再來看看此統計圖。 Related View[小技巧] JavaScript Cross Browser Best Practices (0)使用不同 IE 版本測試網站 (1)Backbone Routing pushState in IE (0)[jQuery] 解決 IE6 PNG 透明背景 (Supersleight jQuery Plugin for Transparent PNGs in IE6) (2)測試 Web Responsive Design Tool (0)CodeIgniter 2.0 發展狀況(現在更棒了) 不再支援 PHP4 (0)2013 Javascript Conference: [...]]]></description>
				<content:encoded><![CDATA[<div style="margin:0 auto; text-align:center"><a href="http://www.flickr.com/photos/appleboy/8739672579/" title="IE_world by appleboy46, on Flickr"><img class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm8.staticflickr.com/7291/8739672579_3eff76916f_z.jpg" width="640" height="357" alt="IE_world"><noscript><img src="http://farm8.staticflickr.com/7291/8739672579_3eff76916f_z.jpg" width="640" height="357" alt="IE_world"></noscript></a></div>
<p>此資料來自 <a href="http://www.ie6countdown.com/" target="_blank">The Internet Explorer 6 Countdown</a>，大家注意上面圖示，沒想到台灣高居第二名，佔了 3.5% 僅次於大陸的 24%，大陸不感到意外，但是台灣的比例還真是高，難怪一堆程式開發者，抱怨連連 XD，這是統計到 2013 年 04 月，在這邊紀錄一下，等到明年這個時候再來看看此統計圖。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2013/04/javascript-cross-browser-best-practices/" class="wp_rp_title">[小技巧] JavaScript Cross Browser Best Practices </a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/02/testing-for-internet-explorer-with-web-page/" class="wp_rp_title">使用不同 IE 版本測試網站</a> (1)</li><li ><a href="http://blog.wu-boy.com/2013/05/backbone-routing-pushstate-in-ie/" class="wp_rp_title">Backbone Routing pushState in IE</a> (0)</li><li ><a href="http://blog.wu-boy.com/2010/05/jquery-%e8%a7%a3%e6%b1%ba-ie6-png-%e9%80%8f%e6%98%8e%e8%83%8c%e6%99%af-supersleight-jquery-plugin-for-transparent-pngs-in-ie6/" class="wp_rp_title">[jQuery] 解決 IE6 PNG 透明背景 (Supersleight jQuery Plugin for Transparent PNGs in IE6)</a> (2)</li><li ><a href="http://blog.wu-boy.com/2013/05/web-responsive-design-test-tool/" class="wp_rp_title">測試 Web Responsive Design Tool</a> (0)</li><li ><a href="http://blog.wu-boy.com/2010/11/codeigniter-2-0-%e7%99%bc%e5%b1%95%e7%8b%80%e6%b3%81%e7%8f%be%e5%9c%a8%e6%9b%b4%e6%a3%92%e4%ba%86-%e4%b8%8d%e5%86%8d%e6%94%af%e6%8f%b4-php4/" class="wp_rp_title">CodeIgniter 2.0 發展狀況(現在更棒了) 不再支援 PHP4 </a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/05/2013-javascript-conference-front-tool-grunt-js/" class="wp_rp_title">2013 Javascript Conference: 你不可不知的前端開發工具</a> (3)</li><li ><a href="http://blog.wu-boy.com/2011/08/%e6%b7%b1%e5%85%a5%e6%8e%a2%e8%a8%8e-codeigniter-input-class-%e6%a0%b8%e5%bf%83%e7%a8%8b%e5%bc%8f%e6%b5%81%e7%a8%8b/" class="wp_rp_title">深入探討 CodeIgniter Input Class 核心程式流程</a> (6)</li><li ><a href="http://blog.wu-boy.com/2013/03/backbone-js-rewrite-into-coffeescript/" class="wp_rp_title">Backbone.js rewrite into CoffeeScript?</a> (0)</li><li ><a href="http://blog.wu-boy.com/2012/05/php-fastcgi-with-nginx-on-ubuntu-10-10-maverick/" class="wp_rp_title">在 Ubuntu 10.10 (Maverick) 架設 Nginx + PHP FastCGI</a> (3)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/05/internet-explorer-6-countdown/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Backbone Routing pushState in IE</title>
		<link>http://blog.wu-boy.com/2013/05/backbone-routing-pushstate-in-ie/</link>
		<comments>http://blog.wu-boy.com/2013/05/backbone-routing-pushstate-in-ie/#comments</comments>
		<pubDate>Thu, 09 May 2013 05:26:58 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[Backbone.js]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[pushState]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4190</guid>
		<description><![CDATA[Backbone.js 幫忙處理掉所有瀏覽器 Html5 History pushState 功能，除了 IE 9 以下(含 IE 9)不支援 history.pushState() 跟 history.replaceState()，其他 Browser 幾乎都支援了，在 Backbone.js 如何處理 URL 變化呢？以往透過 handle URL hash 來決定網頁要處理哪些資料，這也是 Backbone 預設的處理方式，範例如下 URL: http://xxx/#!/user/list http://xxx/#!/user/add Backbone.Router.extend&#40;&#123; &#160; routes: &#123; &#160; &#160; &#34;!/user/:action&#34;: &#34;user&#34; &#160; &#125;, &#160; initialize: function&#40;&#41; &#123; &#160; &#125;, &#160; user: function&#40;action, id&#41; &#123; &#160; &#160; &#160; &#125; &#125;&#41;; [...]]]></description>
				<content:encoded><![CDATA[<div style="margin:0 auto; text-align:center"><a href="http://www.flickr.com/photos/appleboy/7059615321/" title="backbone by appleboy46, on Flickr"><img class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm6.staticflickr.com/5338/7059615321_097833dea8.jpg" width="451" height="80" alt="backbone"><noscript><img src="http://farm6.staticflickr.com/5338/7059615321_097833dea8.jpg" width="451" height="80" alt="backbone"></noscript></a></div>
<p>Backbone.js 幫忙處理掉所有瀏覽器 <a href="http://diveintohtml5.info/history.html" target="_blank">Html5 History pushState</a> 功能，除了 IE 9 以下(含 IE 9)不支援 <strong>history.pushState()</strong> 跟 <strong>history.replaceState()</strong>，其他 Browser 幾乎都支援了，在 <a href="http://backbonejs.org" target="_blank">Backbone.js</a> 如何處理 URL 變化呢？以往透過 handle URL hash 來決定網頁要處理哪些資料，這也是 Backbone 預設的處理方式，範例如下</p>
<p>URL:</p>
<blockquote><p>http://xxx/#!/user/list<br />

http://xxx/#!/user/add</p></blockquote>

<p><span id="more-4190"></span></p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Backbone.<span style="color: #660066;">Router</span>.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; routes<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;!/user/:action&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;user&quot;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; user<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>action<span style="color: #339933;">,</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
Backbone.<span style="color: #660066;">history</span>.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>上面方法是通解，在各種瀏覽器包含 IE 都適用，那如果是使用 history.pushState 請改成底下:</p>
<p>URL:</p>
<blockquote><p>http://xxx/user/list<br />

http://xxx/user/add</p></blockquote>

<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Backbone.<span style="color: #660066;">Router</span>.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; routes<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;/user/:action&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;user&quot;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; user<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>action<span style="color: #339933;">,</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
Backbone.<span style="color: #660066;">history</span>.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>pushState<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> root<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>此作法在支援 html pushState 時候是可以按照您定義的 url 運作，但是在 IE 9 版本，網址就會被改成</p>
<p>URL:</p>
<blockquote><p>http://xxx/#/user/list<br />

http://xxx/#/user/add</p></blockquote>

<p>一樣會被加上 hash 值，該如何解決此問題呢，請把 Backbone.history.start 改成</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Backbone.<span style="color: #660066;">history</span>.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>pushState<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> hashChange<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> root<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>設定 <strong>hashChange</strong> property 為 false，讓 IE 9 不要使用 # 來取代網址，這樣就沒問題了。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2012/04/backbonejs-framework-tutorial-example-1/" class="wp_rp_title">Javascript 前端工具 Backbone.js Framework 初學介紹</a> (5)</li><li ><a href="http://blog.wu-boy.com/2013/03/backbone-js-rewrite-into-coffeescript/" class="wp_rp_title">Backbone.js rewrite into CoffeeScript?</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/04/javascript-cross-browser-best-practices/" class="wp_rp_title">[小技巧] JavaScript Cross Browser Best Practices </a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/02/backbone-js-event-bind-listento-and-stoplistening/" class="wp_rp_title">Backbone.js event bind 新功能 listenTo and stopListening</a> (0)</li><li ><a href="http://blog.wu-boy.com/2012/04/introduction-to-backbone-js-event/" class="wp_rp_title">Backbone.js Event 事件介紹</a> (2)</li><li ><a href="http://blog.wu-boy.com/2012/11/backbone-js-model-and-collection-tregger-event/" class="wp_rp_title">Backbone.js Model and Collection Tregger Event</a> (0)</li><li ><a href="http://blog.wu-boy.com/2012/05/the-first-javascript-developer-conference-in-taiwan/" class="wp_rp_title">台灣第一屆 JavaScript Conference Developer 會議</a> (2)</li><li ><a href="http://blog.wu-boy.com/2012/03/jquery-different-form-stoppropagation-with-stopimmediatepropagation/" class="wp_rp_title">jQuery stopPropagation 和 stopImmediatePropagation 比較</a> (1)</li><li ><a href="http://blog.wu-boy.com/2013/05/internet-explorer-6-countdown/" class="wp_rp_title">IE 6 瀏覽器用戶全球分佈</a> (1)</li><li ><a href="http://blog.wu-boy.com/2013/02/testing-for-internet-explorer-with-web-page/" class="wp_rp_title">使用不同 IE 版本測試網站</a> (1)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/05/backbone-routing-pushstate-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>測試 Web Responsive Design Tool</title>
		<link>http://blog.wu-boy.com/2013/05/web-responsive-design-test-tool/</link>
		<comments>http://blog.wu-boy.com/2013/05/web-responsive-design-test-tool/#comments</comments>
		<pubDate>Fri, 03 May 2013 03:21:45 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Google Extension]]></category>
		<category><![CDATA[Responsive Design]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4182</guid>
		<description><![CDATA[Web CSS Programer 在撰寫 Responsive CSS Style 時，手邊一定會有一堆 Device，來測試當畫面小於 480 px 或大於 768 px 時，呈現的版面是否有亂掉，公司也花費許多成本來測試，現在不需要這樣了，我們可以透過線上 Tool 或者是 Plugin 來測試 Responsive Web Page，首先來介紹 Viewport resizer，此工具用法很簡單，進入官網後，將官網 Javascript 連結加入到我的最愛或 bookmarks，之後打開您的測試網站，再點選該 bookmark，你會發現網站上面多了一條 tool bar，可以自訂或調整 view size，預設也給了平板手機等多種畫面調整，讓您測試 Media Queries 是否有錯誤。 另外一套 Tool 比較強大，那就是 Google Extension: Responsive Inspector (beta) released!，不過就是限制在 Google Chrome 瀏覽器才可以安裝，此擴充工具，還可以直接對應到 CSS Media Queries 位置，以及將自訂大小畫面存成圖檔並且上傳到 Server。底下是介紹影片 Related ViewGoogle Chrome [...]]]></description>
				<content:encoded><![CDATA[<div style="margin:0 auto; text-align:center"><a href="http://www.flickr.com/photos/appleboy/8703913582/" title="responsive-website-design-tips by appleboy46, on Flickr"><img class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm9.staticflickr.com/8395/8703913582_1e15c97803.jpg" width="500" height="294" alt="responsive-website-design-tips"><noscript><img src="http://farm9.staticflickr.com/8395/8703913582_1e15c97803.jpg" width="500" height="294" alt="responsive-website-design-tips"></noscript></a></a></div>
<p>Web CSS Programer 在撰寫 Responsive CSS Style 時，手邊一定會有一堆 Device，來測試當畫面小於 480 px 或大於 768 px 時，呈現的版面是否有亂掉，公司也花費許多成本來測試，現在不需要這樣了，我們可以透過線上 Tool 或者是 Plugin 來測試 Responsive Web Page，首先來介紹 <a href="http://lab.maltewassermann.com/viewport-resizer/" target="_blank">Viewport resizer</a>，此工具用法很簡單，進入官網後，將官網 Javascript 連結加入到我的最愛或 bookmarks，之後打開您的測試網站，再點選該 bookmark，你會發現網站上面多了一條 tool bar，可以自訂或調整 view size，預設也給了平板手機等多種畫面調整，讓您測試 <a href="https://developer.mozilla.org/en-US/docs/CSS/Media_queries" target="_blank">Media Queries</a> 是否有錯誤。<br />
<span id="more-4182"></span><br />
另外一套 Tool 比較強大，那就是 <a href="https://chrome.google.com/webstore/category/extensions?hl=zh-TW" target="_blank">Google Extension</a>: <a href="http://outof.me/responsive-inspector-beta-released/" target="_blank">Responsive Inspector (beta) released!</a>，不過就是限制在 Google Chrome 瀏覽器才可以安裝，此擴充工具，還可以直接對應到 CSS Media Queries 位置，以及將自訂大小畫面存成圖檔並且上傳到 Server。底下是介紹影片</p>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/ylMHAj0OU10" frameborder="0" allowfullscreen></iframe></p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2010/02/google-chrome-%e6%94%af%e6%8f%b4%e8%b6%85%e9%81%8e-40000-extensions-with-greasemonkey/" class="wp_rp_title">Google Chrome 支援超過 40,000 Extensions! with Greasemonkey</a> (1)</li><li ><a href="http://blog.wu-boy.com/2010/01/how-to-install-google-web-toolkit-with-eclipse/" class="wp_rp_title">How to install Google Web Toolkit  with Eclipse</a> (2)</li><li ><a href="http://blog.wu-boy.com/2011/11/front-end-engineer-love-livejs/" class="wp_rp_title">Front End Engineer 前端設計師必備工具 Live.js</a> (0)</li><li ><a href="http://blog.wu-boy.com/2010/01/google-chrome-%e6%8e%a8%e5%87%ba-4-0-%e7%a9%a9%e5%ae%9a%e7%89%88-mozilla-%e6%8e%a8%e5%87%ba-firefox-3-6/" class="wp_rp_title">Google Chrome 推出 4.0 穩定版 &#038; Mozilla 推出 FireFox 3.6</a> (0)</li><li ><a href="http://blog.wu-boy.com/2012/03/google-app-engine-frontend-instance-hours/" class="wp_rp_title">Google App Engine 收費機制 Frontend Instance Hours</a> (1)</li><li ><a href="http://blog.wu-boy.com/2010/04/css-ie-6-7-8-firefox-hack-%e6%94%af%e6%8f%b4%e9%80%8f%e6%98%8e%e8%83%8c%e6%99%af%e5%9c%96-background-or-img-javascript/" class="wp_rp_title">[CSS] IE 6, 7, 8 FireFox hack 支援透明背景圖 background or img javascript</a> (8)</li><li ><a href="http://blog.wu-boy.com/2011/05/%e5%8a%a0%e9%80%9f%e9%96%8b%e7%99%bc-css-%e5%b7%a5%e5%85%b7-sass/" class="wp_rp_title">加速開發 CSS 工具: Sass</a> (1)</li><li ><a href="http://blog.wu-boy.com/2011/03/2011-osdc-day-1-%e7%ad%86%e8%a8%98/" class="wp_rp_title">2011 OSDC Day 1 筆記</a> (3)</li><li ><a href="http://blog.wu-boy.com/2012/04/how-to-install-livereload-on-windows/" class="wp_rp_title">Windwos 下安裝 Web Developer tool LiveReload </a> (1)</li><li ><a href="http://blog.wu-boy.com/2010/03/%e5%9c%a8-ie8-firefox-chrome-css-%e7%bd%ae%e4%b8%ad%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%b3%95/" class="wp_rp_title">在 IE8 FireFox Chrome CSS 置中解決方法</a> (1)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/05/web-responsive-design-test-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Nginx + spdy module on Ubuntu or Debian</title>
		<link>http://blog.wu-boy.com/2013/04/install-nginx-spdy-module-on-ubuntu-or-debian/</link>
		<comments>http://blog.wu-boy.com/2013/04/install-nginx-spdy-module-on-ubuntu-or-debian/#comments</comments>
		<pubDate>Tue, 30 Apr 2013 15:42:30 +0000</pubDate>
		<dc:creator>appleboy</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://blog.wu-boy.com/?p=4179</guid>
		<description><![CDATA[上一篇提到 nginx 1.4.0 釋出並支援 SPDY，教學環境是 CentOS，這次在 Ubuntu 環境編譯遇到 /usr/bin/ld: cannot find -lperl 找不到 perl library，解法可以透過 aptitude 安裝 libperl5.14，安裝好後，到 /usr/lib 底下找到 libperl.so.5.14.2，由於檔案命名關係，請用 ln 將檔案 link 成 libperl.so $ ln -s libperl.so.5.14.2 libperl.so 接著可以正確編譯了，底下安裝相關套件 $ aptitude -y install libpcre3-dev libgd-dev libgd2-xpm-dev libgeoip-dev Related View在 Ubuntu 10.10 (Maverick) 架設 Nginx + PHP FastCGI (3)PHP MVC Framework 搭配 Nginx [...]]]></description>
				<content:encoded><![CDATA[<div style="margin:0 auto; text-align:center"><a href="http://www.flickr.com/photos/appleboy/8684224387/" title="nginx-logo by appleboy46, on Flickr"><img class="lazy " src="http://blog.wu-boy.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://farm9.staticflickr.com/8401/8684224387_19de454ebf.jpg" width="320" height="120" alt="nginx-logo"><noscript><img src="http://farm9.staticflickr.com/8401/8684224387_19de454ebf.jpg" width="320" height="120" alt="nginx-logo"></noscript></a></div>
<p>上一篇提到 <a href="http://blog.wu-boy.com/2013/04/nginx-1-4-0-support-spdy-module/" target="_blank">nginx 1.4.0 釋出並支援 SPDY</a>，教學環境是 CentOS，這次在 Ubuntu 環境編譯遇到 </p>
<blockquote><p>/usr/bin/ld: cannot find -lperl</p></blockquote>
<p>找不到 perl library，解法可以透過 aptitude 安裝 libperl5.14，安裝好後，到 /usr/lib 底下找到 libperl.so.5.14.2，由於檔案命名關係，請用 ln 將檔案 link 成 libperl.so</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> libperl.so.5.14.2 libperl.so</div></div>
<p>接著可以正確編譯了，底下安裝相關套件</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libpcre3-dev libgd-dev libgd2-xpm-dev libgeoip-dev</div></div>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Related View</h3><ul class="related_post wp_rp" style="visibility: visible"><li ><a href="http://blog.wu-boy.com/2012/05/php-fastcgi-with-nginx-on-ubuntu-10-10-maverick/" class="wp_rp_title">在 Ubuntu 10.10 (Maverick) 架設 Nginx + PHP FastCGI</a> (3)</li><li ><a href="http://blog.wu-boy.com/2012/10/php-mvc-framework-nginx-php-fpm/" class="wp_rp_title">PHP MVC Framework 搭配 Nginx + PHP-FPM 設定檔</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/06/force-phpmyadmin-ssl-with-nginx/" class="wp_rp_title">Nginx + phpMyAdmin 搭配 SSL 設定</a> (2)</li><li ><a href="http://blog.wu-boy.com/2013/04/nginx-1-4-0-support-spdy-module/" class="wp_rp_title">nginx 1.4.0 釋出並支援 SPDY</a> (3)</li><li ><a href="http://blog.wu-boy.com/2012/05/install-nginx-php-fastcgi-on-amazon-linux/" class="wp_rp_title">在 Fedora 或 Amazon Linux AMI 架設 Nginx + PHP FastCGI </a> (1)</li><li ><a href="http://blog.wu-boy.com/2012/11/nginx-check-if-file-exists/" class="wp_rp_title">Nginx 判斷檔案是否存在</a> (0)</li><li ><a href="http://blog.wu-boy.com/2013/06/how-to-install-gearman-on-ubuntu-or-debian-with-mysql/" class="wp_rp_title">How to install Gearman on Ubuntu or Debian with MySQL 安裝測試篇</a> (0)</li><li ><a href="http://blog.wu-boy.com/2011/03/ubuntu-debian-%e6%9e%b6%e8%a8%ad-apache-mpm-worker-mod_fcgid-%e7%ad%86%e8%a8%98/" class="wp_rp_title">Ubuntu (Debian) 架設 apache mpm worker mod_fcgid 筆記 </a> (0)</li><li ><a href="http://blog.wu-boy.com/2010/01/how-to-change-run-levels-and-init-d-scripts-in-ubuntu-debian/" class="wp_rp_title">How to change run levels and init.d scripts in Ubuntu &#038; Debian</a> (0)</li><li ><a href="http://blog.wu-boy.com/2009/02/debian-gnulinux-50-%e7%99%bc%e5%b8%83-zhcon-%e8%a7%a3%e6%b1%ba%e7%b5%82%e7%ab%af%e6%a9%9f%e4%ba%82%e7%a2%bc/" class="wp_rp_title">[Debian] GNU/Linux 5.0 發布 zhcon 解決終端機亂碼 </a> (3)</li></ul></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wu-boy.com/2013/04/install-nginx-spdy-module-on-ubuntu-or-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<media:rating>nonadult</media:rating></channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: blog.wu-boy.com @ 2013-06-19 14:12:29 by W3 Total Cache -->
