<?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>minor tranquilizer &#187; Mongrel</title>
	<atom:link href="http://www.ookawara.com/archives/tag/mongrel/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ookawara.com</link>
	<description>イロ イッカイ ズツ・・・</description>
	<lastBuildDate>Sun, 29 Jan 2012 10:17:45 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ISAPI_Rewrite</title>
		<link>http://www.ookawara.com/archives/562</link>
		<comments>http://www.ookawara.com/archives/562#comments</comments>
		<pubDate>Wed, 31 Mar 2010 13:31:34 +0000</pubDate>
		<dc:creator>ookawara.com</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ISAPI_Rewrite]]></category>
		<category><![CDATA[Mongrel]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[RoR]]></category>

		<guid isPermaLink="false">http://www.ookawara.com/archives/562</guid>
		<description><![CDATA[とあるシステムで、ISAPI_Rewriteなるものを使っている。 Ruby on Rails のアプリを開発して Mongrel で稼働させ、Windows Server (IIS6) 経由で呼び出そうというもの。 な [...]]]></description>
			<content:encoded><![CDATA[<p>とあるシステムで、ISAPI_Rewriteなるものを使っている。</p>
<p>Ruby on Rails のアプリを開発して Mongrel で稼働させ、Windows Server (IIS6) 経由で呼び出そうというもの。 <br/>なんでこんなことをやりたいかっていうと、IISでWindows統合認証を行い、認証済みのユーザだけがアプリを使え、かつWindows認証アカウントをアプリ側でもアカウントとして利用するという構成をとったため。</p>
<p>最初はIIS6 上で FastCGI を使って RoR を動かそうと思ったんだけど、なんか安定してなさそうなので、IIS を Proxy にしようと。（Apache使えよとかいうつっこみはいったん流して）</p>
<p>IISそのものには Proxy 機能は装備されていないのだが、IIS 用のアドインとして <a href="http://www.helicontech.com/isapi_rewrite/">ISAPI_Rewrite</a> というものが <a href="http://www.helicontech.com/">Helicon Tech</a> 社から提供されている。これはもともと Apache で言うところの mod_rewrite 相当のURL書き換え機能を提供するもの。</p>
<p>ISAPI_Rewrite には2種類のラインナップがあって、完全フリー版では Proxy はできないのだが、シェアウェア版（45日トライアル版あり。$99くらい）だと Proxy としても使える機能がある。</p>
<p>そこで今回はシェアウェア版を購入して、Proxy として使うことにした。</p>
<p>ダウンロード＆インストールは極めて簡単なので省略。 <br/>で、Mongrel が <a href="http://localhost:3000/">http://localhost:3000/</a> で動いており、これをIIS側の <a href="http://localhost/">http://localhost/</a> で受けてポート3000に流す。</p>
<p>設定はIISマネージャのWebサイトプロパティにISAPI_Rewrite設定タブがあるので、そこから設定エディタを開き「RewriteProxy /(.*) http\://localhost\:3000/$1 [A,I,U]」と記述。</p>
<p>文法は mod_proxy準拠（微妙に違うところもあるらしいが）。末尾の鍵括弧内はフラグだが、ここに「A」オプションをつけると、認証したユーザアカウント情報を httpヘッダに付加してくれる。たまにWWWで見かける Apache における方法と違うので、最初これが分からなくてあせった。 <br/>（落ち着いてドキュメントを読めばちゃんと書いてあったのだが）</p>
<p>あとライセンスキーの設定方法も最初分からなかったが、README を読んだら書いてあった。 <br/>インストール時に引数指定する、設定エディタに書く、の2種類があるようだ。</p>
<p>設定してみたが45日後にちゃんと効いているかちょっとドキドキする。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ookawara.com/archives/562/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- Quick Cache: failed to write cache. The cache/ directory is either non-existent ( and could not be created ) or it is not writable. -->
