<?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>EragonJ - A humble navigator &#187; Apache</title>
	<atom:link href="http://eragonj.hax4.in/blog/category/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://eragonj.hax4.in/blog</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 12:33:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>[RoR] Passenger + Apache = 無敵金身</title>
		<link>http://eragonj.hax4.in/blog/ror-passenger-apache.html</link>
		<comments>http://eragonj.hax4.in/blog/ror-passenger-apache.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 13:01:36 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[ln]]></category>
		<category><![CDATA[Module]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[Sybolic Link]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=313</guid>
		<description><![CDATA[Tweet 目前為了要把RoR和Apache做個整合，所以在網路上找尋可能的實作方式，找著找著，就找到Passenger這個Apache_mod，真是太好了，接下來就是來看一下要如何設定了。 文件參考 以下是用「MAC OSX 10.5.8」、「Apache2.2.13」當工作環境，如果有出入的話麻煩自行微調一下。 剛開始要先有Apache，這是理所當然的，不過原先在蘋果上面已經綁了一個Apache Server，而在Passenger 1.0.3以後有支援原生的Apache Server，因為照理說大家都已經有了，所以我們就直接跳過安裝Apache這一步吧。 接下來就是透過Gem裝一下我們的Passenger寶石。 這邊我在裝的時候花了一些時間，可能要耐心等候一下，大概有幾分鐘。 再來就是讓Apache來建立這個Module 等這個Module安裝成功後，就會得這個畫面： 截取重要的那一段訊息之後： 現在我們就可以把這一段Apache的設定放入httpd.conf的設定檔。 不知道大家的設定檔位置是在哪，我的話是放在「/private/etc/apache2/httpd.conf」， 接下來就可以把剛剛的那一段設定寫在檔案的最後面，讓Apache會在啟動時去讀取那個模組，並自動設定好Passenger的位置和Ruby bin的位（這一段是因人而異的，所以通常每個人都不太一樣，要寫入自己安裝完Module時的那段設定）。 Good，基本的模組設定如果都成功的話就可以開始設定我們的Rails專案了。 BTW，如果Passenger發生了什麼問題的話，直接修改你的「httpd.conf」把那三行comment掉就可以停止載入Passenger了。對了忘記提醒一下，只要有「動到」Apache的任何一個設定檔，就一直要reload Apache哦，別傻傻的一直試，想說怎麼都沒有效果出來。 再來是Passenger的簡單應用， 因為原本在「httpd.conf」的最後面有寫入「Include /private/etc/apache2/other/*.conf」，所以我們就在other這個資料夾新增一個適用於自己專案的設定檔，這邊就叫他「test.conf」吧。（以下用VirtualHost來設定路徑） 然後因為我的專案是叫做「test」，所以我就在「test.conf」這樣設定： 在這邊有幾點要注意的就是當你要部署一個專案的時候，一定要把「DocumentRoot」指到你的專案的「public」資料夾，而且要「Disable MultiViews」。 所以現在只要打「http://localhost」就可以看到我們的頁面囉。 再來要補充的是進階用法：如果我們不要直接Match我們的專案到該網域的話，那要怎麼做到Sub URI? （如http://localhost/test 可以指向到我們的test專案，而 http://localhost/ 可能就還是我們原先的Apache welcome頁面) 看官方的做法真的是很酷，要利用到Symbolic Link來部署我們的專案，超酷，那該怎麼做呢?來看一下我的設定檔。 一步步解釋，因為用到Sybolic Link，所以如果我有很多種不同的專案時（如 /test , /abc , /def ），那我就會有很多個Link，所以先統一放在「/Users/EragonJ/links」這個資料夾內，接下來再把他們指向到你要的專案下的public資料夾，請看圖例： Symbolic Link是這樣製作的「ln -s 被指向的位置 symbolic link的名字」， OK，設定好我們的Link後，再來就是要修改一下原先的conf檔（依照上面那個Gist的註解來做修改），那個RailsBaseURI就是我們「http://localhost/xxxx」的「xxxx」，也就是原本想要實作的Sub URI，只要透過Directory內的Symbolic Link [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fror-passenger-apache.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/ror-passenger-apache.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/ror-passenger-apache.html"  data-text="[RoR] Passenger + Apache = 無敵金身" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>目前為了要把RoR和Apache做個整合，所以在網路上找尋可能的實作方式，找著找著，就找到Passenger這個Apache_mod，真是太好了，接下來就是來看一下要如何設定了。<br />
<br/><br />
<a href="http://www.modrails.com/documentation/Users%20guide%20Apache.html">文件參考</a><br />
<br/><br />
以下是用「MAC OSX 10.5.8」、「Apache2.2.13」當工作環境，如果有出入的話麻煩自行微調一下。<br />
<br/><br />
剛開始要先有Apache，這是理所當然的，不過原先在蘋果上面已經綁了一個Apache Server，而在Passenger 1.0.3以後有支援原生的Apache Server，因為照理說大家都已經有了，所以我們就直接跳過安裝Apache這一步吧。<br />
<br/><br />
接下來就是透過Gem裝一下我們的Passenger寶石。<br />
<script src="http://gist.github.com/319448.js?file=gistfile1.sh"></script><br />
這邊我在裝的時候花了一些時間，可能要耐心等候一下，大概有幾分鐘。<br />
<br/><br />
再來就是讓Apache來建立這個Module<br />
<script src="http://gist.github.com/319456.js?file=gistfile1.sh"></script><br />
等這個Module安裝成功後，就會得這個畫面：<br />
<a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/03/pic.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/03/pic-1024x574.png" alt="" title="pic" width="512" height="287" class="alignnone size-large wp-image-315" /></a><br />
<br/><br />
截取重要的那一段訊息之後：<br />
<script src="http://gist.github.com/319459.js?file=gistfile1.sh"></script><br />
現在我們就可以把這一段Apache的設定放入httpd.conf的設定檔。<br />
<br/><br />
不知道大家的設定檔位置是在哪，我的話是放在「/private/etc/apache2/httpd.conf」，<br />
<br/><br />
接下來就可以把剛剛的那一段設定寫在檔案的最後面，讓Apache會在啟動時去讀取那個模組，並自動設定好Passenger的位置和Ruby bin的位（這一段是因人而異的，所以通常每個人都不太一樣，要寫入自己安裝完Module時的那段設定）。<br />
<br/><br />
Good，基本的模組設定如果都成功的話就可以開始設定我們的Rails專案了。<br />
<br/><br />
BTW，如果Passenger發生了什麼問題的話，直接修改你的「httpd.conf」把那三行comment掉就可以停止載入Passenger了。對了忘記提醒一下，只要有「動到」Apache的任何一個設定檔，就一直要reload Apache哦，別傻傻的一直試，想說怎麼都沒有效果出來。<br />
<br/><br />
再來是Passenger的簡單應用，<br />
<br/><br />
因為原本在「httpd.conf」的最後面有寫入「Include /private/etc/apache2/other/*.conf」，所以我們就在other這個資料夾新增一個適用於自己專案的設定檔，這邊就叫他「test.conf」吧。（以下用VirtualHost來設定路徑）<br />
<br/><br />
然後因為我的專案是叫做「test」，所以我就在「test.conf」這樣設定：<br />
<script src="http://gist.github.com/319469.js?file=gistfile1.txt"></script><br />
在這邊有幾點要注意的就是當你要部署一個專案的時候，一定要把「DocumentRoot」指到你的專案的「public」資料夾，而且要「Disable MultiViews」。<br />
<br/><br />
所以現在只要打「http://localhost」就可以看到我們的頁面囉。<br />
<br/><br />
再來要補充的是進階用法：如果我們不要直接Match我們的專案到該網域的話，那要怎麼做到Sub URI? （如http://localhost/test 可以指向到我們的test專案，而 http://localhost/ 可能就還是我們原先的Apache welcome頁面)<br />
<br/><br />
看官方的做法真的是很酷，要利用到Symbolic Link來部署我們的專案，超酷，那該怎麼做呢?來看一下我的設定檔。<br />
<script src="http://gist.github.com/319474.js?file=gistfile1.txt"></script><br />
一步步解釋，因為用到Sybolic Link，所以如果我有很多種不同的專案時（如 /test , /abc , /def ），那我就會有很多個Link，所以先統一放在「/Users/EragonJ/links」這個資料夾內，接下來再把他們指向到你要的專案下的public資料夾，請看圖例：<br />
<a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/03/link.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/03/link.png" alt="" title="link" width="382" height="52" class="alignnone size-full wp-image-323" /></a><br />
<br/><br />
Symbolic Link是這樣製作的「ln -s 被指向的位置 symbolic link的名字」，<br />
<script src="http://gist.github.com/319483.js?file=gistfile1.sh"></script><br />
OK，設定好我們的Link後，再來就是要修改一下原先的conf檔（依照上面那個Gist的註解來做修改），那個RailsBaseURI就是我們「http://localhost/xxxx」的「xxxx」，也就是原本想要實作的Sub URI，只要透過Directory內的Symbolic  Link 去幫我們指向到我們的「test/public」，就可以了。<br />
<br/><br />
以上是我在玩Passenger的一些小心得，如果有什麼錯誤的地方麻煩留言指正，而更進階的玩法就麻煩參照官網上的資料囉。<br />
<br/><br />
我們下次見。<br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/ror-passenger-apache.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Apache] Enable .htaccess on Mac OS</title>
		<link>http://eragonj.hax4.in/blog/apache-enable-htaccess-on-mac-os.html</link>
		<comments>http://eragonj.hax4.in/blog/apache-enable-htaccess-on-mac-os.html#comments</comments>
		<pubDate>Mon, 21 Sep 2009 18:29:00 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=31</guid>
		<description><![CDATA[Tweet Teach 要注意的是MAC OSX 10.5 的apache httpd.conf 存放路徑和以往有點差異 My location of httpd.conf : /private/etc/apache2/httpd.conf 要改httpd.conf &#038; 個人.conf 兩個設定檔下: AllowOverride All]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fapache-enable-htaccess-on-mac-os.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/apache-enable-htaccess-on-mac-os.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/apache-enable-htaccess-on-mac-os.html"  data-text="[Apache] Enable .htaccess on Mac OS" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p><a href="http://www.clagnut.com/blog/350/">Teach</a></p>
<p>要注意的是MAC OSX 10.5 的apache httpd.conf 存放路徑和以往有點差異</p>
<p>My location of httpd.conf : <br />
<blockquote>/private/etc/apache2/httpd.conf</p></blockquote>
<p>要改httpd.conf &#038; 個人.conf 兩個設定檔下:<br />    AllowOverride All</p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/apache-enable-htaccess-on-mac-os.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

