<?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>Wei-Hao Syu&#039;s Blog 徐偉浩的部落格 &#187; mod_proxy</title>
	<atom:link href="http://blog.pighead.cc/whsyu/tag/mod_proxy/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pighead.cc/whsyu</link>
	<description>~FORMOSAN~</description>
	<lastBuildDate>Thu, 02 Feb 2012 08:10:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Apache 的 mod_proxy</title>
		<link>http://blog.pighead.cc/whsyu/2007/09/22/apache-mod_proxy/</link>
		<comments>http://blog.pighead.cc/whsyu/2007/09/22/apache-mod_proxy/#comments</comments>
		<pubDate>Sat, 22 Sep 2007 07:21:00 +0000</pubDate>
		<dc:creator>Wei-Hao Syu</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_proxy]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://blog.pighead.cc/whsyu/2007/09/22/23/</guid>
		<description><![CDATA[[華語, cmn-Hant-TW] 用 mod_rewrite 可以解決掉大半在同一台伺服器上轉來轉去的問題，而因為我們大部份的網頁都是放在同一台機器同一個網址下面，一切運作正常。 不過在幫王韋中做轉址的時候就有轉到外面機器的需求，而如果用 mod_rewrite 的話外部轉址是會用轉向 (redirect) 的方式，那網址會跑到那邊去，這樣並不符合需求。 網路上找了找，找到了這篇和這篇，看來用 PorxyPass 來轉址應該就可以了，然後我們的 apache 當然是沒有加 mod_proxy 啦，重編就解決了。 然後在 httpd.conf 裡面加了這行： LoadModule proxy_module libexec/apache22/mod_proxy.so 結果吃了個 403，看了一下 log 發現了這個警告： [warn] proxy: No protocol handler was valid for the URL /a. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in [...]]]></description>
			<content:encoded><![CDATA[<p class="bb-post-separator"><strong>[華語, cmn-Hant-TW]  </strong></p><p>用 mod_rewrite 可以解決掉大半在同一台伺服器上轉來轉去的問題，而因為我們大部份的網頁都是放在<a href="http://pighead.cc">同一台機器</a>同一個網址下面，一切運作正常。</p>
<p>不過在幫<a href="http://www.vinny.idv.tw">王韋中</a>做轉址的時候就有轉到外面機器的需求，而如果用 mod_rewrite 的話外部轉址是會用轉向 (redirect) 的方式，那網址會跑到那邊去，這樣並不符合需求。</p>
<p>網路上找了找，找到了<a href="http://mail-archives.apache.org/mod_mbox/httpd-users/200301.mbox/%3c!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAC5B4UawN1hGCdQBIVF6f8cKAAAAQAAAAmWtN+d99EkOQmo+RE5DG9AEAAAAA@verbocht.be%3e">這篇</a>和<a href="http://chitsaou.wordpress.com/2007/07/17/apache-mongrel-ror/">這篇</a>，看來用 PorxyPass 來轉址應該就可以了，然後我們的 apache 當然是沒有加 mod_proxy 啦，重編就解決了。</p>
<p>然後在 httpd.conf 裡面加了這行：</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">LoadModule proxy_module libexec/apache22/mod_proxy.so</pre></div></div>

<p>結果吃了個 403，看了一下 log 發現了這個警告：</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">[warn] proxy: No protocol handler was valid for the URL /a. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule</pre></div></div>

<p>好吧，那只好乖乖的把東西加上去了</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">LoadModule proxy_http_module libexec/apache22/mod_proxy_http.so</pre></div></div>

<p>試了一下，看起來應該是沒啥太大問題，之後有需要的話就可以直接用，順便把 mod_proxy 的設定加進 <a href="http://www.freshports.org/sysutils/portconf/">ports.conf</a> 以後昇級 apache 的時候才會記得順便編譯好。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pighead.cc/whsyu/2007/09/22/apache-mod_proxy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

