<?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>ダメ出し日記 &#187; Apache</title>
	<atom:link href="http://www.sfo.jp/blog/archives/category/software/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sfo.jp/blog</link>
	<description>自称・独立&#38;OSS系(?) SE、さとうふみやすの日記。OSS テクノロジ(株)に勤務。</description>
	<lastBuildDate>Fri, 23 Oct 2009 08:10:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Apache: mod_authz_ldap 0.26 on CentOS 4</title>
		<link>http://www.sfo.jp/blog/archives/2007/05/mod-authz-ldap-on-centos4.html</link>
		<comments>http://www.sfo.jp/blog/archives/2007/05/mod-authz-ldap-on-centos4.html#comments</comments>
		<pubDate>Wed, 02 May 2007 06:04:50 +0000</pubDate>
		<dc:creator>fumiyas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[仕事]]></category>

		<guid isPermaLink="false">http://www.sfo.jp/blog/archives/2007/05/mod-authz-ldap-on-centos4.html</guid>
		<description><![CDATA[
CentOS 4 付属の mod_authz_ldap 0.26 を使ってみた。
グループへのアクセス許可の設定がわかりにくかったので、設定例をメモしておこう。
つーか、付属のドキュメントが古い and/or 間違って [...]]]></description>
			<content:encoded><![CDATA[<p>
CentOS 4 付属の mod_authz_ldap 0.26 を使ってみた。
グループへのアクセス許可の設定がわかりにくかったので、設定例をメモしておこう。
つーか、付属のドキュメントが古い and/or 間違っているような?
最新版では直っているのかなぁ?
</p>

<p><pre class="code"><code>AuthType Basic
AuthName "Restricted Page"
Require group admin staff
AuthzLDAPMethod         ldap
AuthzLDAPServer         127.0.0.1:389
AuthzLDAPUserBase       ou=Users,dc=example,dc=com
AuthzLDAPUserScope      onelevel
AuthzLDAPUserKey        uid
AuthzLDAPGroupBase      ou=Groups,dc=example,dc=com
AuthzLDAPGroupScope     onelevel
AuthzLDAPGroupKey       cn
AuthzLDAPSetGroupAuth   map
AuthzLDAPMapUserToAttr  uid
AuthzLDAPMemberKey      memberUid
</code></pre>
<p>
識別名
<code>uid=<var>ユーザー名</var>,ou=Users,dc=example,dc=com</code>
とパスワードでシンプルバインドすることでユーザー認証の判定がされた後、
<code>ou=Groups,dc=example,dc=com</code> 以下のツリーから
<code>cn</code> 属性
の値が
<code>admin</code>
または
<code>staff</code>
、
かつ
<code>memberUid</code> 属性
の値が
<code>uid=<var>ユーザー名</var>,ou=Users,dc=example,dc=com</code>
エントリの
<code>uid</code> 属性の値 (ユーザー名)
となっているものを含むエントリがある場合、認可される…ということになっていると思う。
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sfo.jp/blog/archives/2007/05/mod-authz-ldap-on-centos4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache2: mod_dosdetector</title>
		<link>http://www.sfo.jp/blog/archives/2007/02/apache2-mod-dosdetector.html</link>
		<comments>http://www.sfo.jp/blog/archives/2007/02/apache2-mod-dosdetector.html#comments</comments>
		<pubDate>Sun, 04 Feb 2007 15:59:16 +0000</pubDate>
		<dc:creator>fumiyas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[リンク]]></category>

		<guid isPermaLink="false">http://www.sfo.jp/blog/archives/2007/02/apache2-mod-dosdetector.html</guid>
		<description><![CDATA[
はてなの人が開発
した対 DoS 攻撃用の Apache 用モジュール:



http://sourceforge.net/projects/moddosdetector/


まだ使ってないしソースも読んでないので [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://d.hatena.ne.jp/stanaka/20070204/1170553603">はてなの人が開発</a>
した対 DoS 攻撃用の Apache 用モジュール:
</p>

<p><blockquote>
<a href="http://sourceforge.net/projects/moddosdetector/">http://sourceforge.net/projects/moddosdetector/</a>
</blockquote>
<p>
まだ使ってないしソースも読んでないので、
トレードオフ (特に速度低下) は不明。
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sfo.jp/blog/archives/2007/02/apache2-mod-dosdetector.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache 1.3 と mod_layout 3.2 と Mailman</title>
		<link>http://www.sfo.jp/blog/archives/2007/01/apache13-mod-layout32-mailman.html</link>
		<comments>http://www.sfo.jp/blog/archives/2007/01/apache13-mod-layout32-mailman.html#comments</comments>
		<pubDate>Wed, 10 Jan 2007 05:26:14 +0000</pubDate>
		<dc:creator>fumiyas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mailman]]></category>
		<category><![CDATA[仕事]]></category>

		<guid isPermaLink="false">http://www.sfo.jp/blog/archives/2007/01/apache13-mod-layout32-mailman.html</guid>
		<description><![CDATA[
前回
の続き。
Apache 1.3 と mod_layout 3.2 にしてみる。
どちらも Debian 公式パッケージ。
Apache の設定はこんな感じ:


&#60;VirtualHost &#62;
Serv [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="/blog/archives/2007/01/apache22_mod_layout40.html">前回</a>
の続き。
Apache 1.3 と mod_layout 3.2 にしてみる。
どちらも Debian 公式パッケージ。
Apache の設定はこんな感じ:
</p>

<p><pre class="code"><code>&lt;VirtualHost <em>&gt;
ServerName ml.osstech.jp
<var>...</var>
LayoutDefaultHandlers Off
LayoutMerge On
Alias /mailman/images/  /usr/share/images/mailman/
ScriptAlias /mailman/   /usr/lib/cgi-bin/mailman/
Alias /pipermail/       /var/lib/mailman/archives/public/
&lt;Directory /usr/lib/cgi-bin/mailman&gt;
Order Mutual-Failure
Allow From All
LayoutHandler cgi-script
LayoutHeader /mailman-header.html
&lt;/Directory&gt;
&lt;Directory /usr/share/images/mailman&gt;
Order Mutual-Failure
Allow From All
&lt;/Directory&gt;
&lt;Directory /var/lib/mailman/archives/public&gt;
Order Mutual-Failure
Allow From All
AddDefaultCharset EUC-JP
LayoutHandler text/html
LayoutHeader /mailman-header.html
&lt;/Directory&gt;
<var>...</var>
&lt;/VirtualHost&gt;
</code></pre>
<p>
しかし…これだと CGI な URI に PATH<em>INFO が含まれている場合
(例えば <q>/path/to/cgi-script-name/pathinfo</q>)
に mod</em>layout が機能しない。
何故だぁ!
ソースを hack するのは面倒なので、伝家の宝刀 mod<em>rewrite で hack してみる。
以下を追加:
</p>
<pre class="code"><code>&lt;VirtualHost *&gt;
ServerName ml.osstech.jp
<var>...</var>
RewriteEngine On
RewriteCond %{REQUEST</em>URI} !^/mailman/images/
RewriteRule ^(/mailman/[^/]+)(/.</em>)$ $1 [passthrough,env=PATH_INFO:$2,last]
<var>...</var>
&lt;/VirtualHost&gt;
</code></pre>
<p>
今度はうまくいった。
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sfo.jp/blog/archives/2007/01/apache13-mod-layout32-mailman.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache 2.2 と mod_layout 4.0 (失敗)</title>
		<link>http://www.sfo.jp/blog/archives/2007/01/apache22-mod-layout40.html</link>
		<comments>http://www.sfo.jp/blog/archives/2007/01/apache22-mod-layout40.html#comments</comments>
		<pubDate>Tue, 09 Jan 2007 16:37:12 +0000</pubDate>
		<dc:creator>fumiyas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[ダメ出し]]></category>
		<category><![CDATA[仕事]]></category>

		<guid isPermaLink="false">http://www.sfo.jp/blog/archives/2007/01/apache22-mod-layout40.html</guid>
		<description><![CDATA[仕事で
公開メーリングリストサービス
を開始するにあたり、リストサーバーソフト Mailman の HTML テンプレートを変更できないか調査してみた。
結果、ほとんどカスタマイズできないことが判明した。
しょうがないの [...]]]></description>
			<content:encoded><![CDATA[<p>仕事で
<a href="http://ml.osstech.jp/">公開メーリングリストサービス</a>
を開始するにあたり、リストサーバーソフト Mailman の HTML テンプレートを変更できないか調査してみた。
結果、ほとんどカスタマイズできないことが判明した。
しょうがないので
Apache の
<a href="http://tangent.org/index.pl?lastnode_id=478&amp;node_id=362">mod_layout</a>
を試してみることにした。</p>

<p>Debian GNU/Linux 4.0 (etch) には Apache 1 用の
libapache-mod-layout
しか用意されていなかったので調べてみたところ、
Apache 2.2 向けには
<a href="http://cvs.tangent.org/mod_layout-4.0">CVS から mod<em>layout 4.0 の最新版をダウンロード</a>
しなければならないとのこと。
しかし…コンパイルできない。
こんな感じ:
<pre class="code"><code>apxs2 -c   mod</em>layout.c utility.c layout.c
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static i486-linux-gnu-gcc -prefer-pic -DLINUX=2 -D<em>GNU</em>SOURCE -D<em>LARGEFILE64</em>SOURCE -D<em>REENTRANT -I/usr/include/apr-1.0 -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread     -I/usr/include/apache2  -I/usr/include/apr-1.0   -I/usr/include/apr-1.0 -I/usr/include/postgresql  -c -o mod</em>layout.lo mod<em>layout.c &amp;&amp; touch mod</em>layout.slo
mod<em>layout.c: In function 'layout</em>filter':
mod<em>layout.c:278: error: expected ';' before '{' token
mod</em>layout.c: At top level:
mod<em>layout.c:561: error: expected expression before 'layout</em>conf'
mod<em>layout.c:561: error: initializer element is not constant
mod</em>layout.c:561: error: (near initialization for 'layout<em>cmds[4].cmd</em>data')
mod<em>layout.c:562: error: expected expression before 'layout</em>conf'
mod<em>layout.c:562: error: initializer element is not constant
mod</em>layout.c:562: error: (near initialization for 'layout<em>cmds[5].cmd</em>data')
mod<em>layout.c:567: error: expected expression before 'layout</em>conf'
mod<em>layout.c:567: error: initializer element is not constant
mod</em>layout.c:567: error: (near initialization for 'layout<em>cmds[10].cmd</em>data')
mod<em>layout.c:568: error: expected expression before 'layout</em>conf'
mod<em>layout.c:568: error: initializer element is not constant
mod</em>layout.c:568: error: (near initialization for 'layout<em>cmds[11].cmd</em>data')
mod<em>layout.c:569: error: expected expression before 'layout</em>conf'
mod<em>layout.c:569: error: initializer element is not constant
mod</em>layout.c:569: error: (near initialization for 'layout<em>cmds[12].cmd</em>data')
mod<em>layout.c:574: error: expected expression before 'layout</em>conf'
mod<em>layout.c:574: error: initializer element is not constant
mod</em>layout.c:574: error: (near initialization for 'layout<em>cmds[17].cmd</em>data')
mod<em>layout.c:575: error: expected expression before 'layout</em>conf'
mod<em>layout.c:575: error: initializer element is not constant
mod</em>layout.c:575: error: (near initialization for 'layout<em>cmds[18].cmd</em>data')
mod<em>layout.c:576: error: expected expression before 'layout</em>conf'
mod<em>layout.c:576: error: initializer element is not constant
mod</em>layout.c:576: error: (near initialization for 'layout<em>cmds[19].cmd</em>data')
mod<em>layout.c:577: error: expected expression before 'layout</em>conf'
mod<em>layout.c:577: error: initializer element is not constant
mod</em>layout.c:577: error: (near initialization for 'layout<em>cmds[20].cmd</em>data')
mod<em>layout.c:578: error: expected expression before 'layout</em>conf'
mod<em>layout.c:578: error: initializer element is not constant
mod</em>layout.c:578: error: (near initialization for 'layout<em>cmds[21].cmd</em>data')
apxs:Error: Command failed with rc=65536
.
make: *** [mod<em>layout.so] エラー 1
</code></pre>
ソースを見たところ、Apache 2.0 や 2.2 (や新しい APR) で非推奨になったり廃止された
API がずいぶん残っていた。
ということで、
<a href="/blog/download/mod_layout-4.0.2a.cvs20060928-apache2.2.patch">mod</em>layout 4.0.2a + CVS 版を Apache 2.2 でコンパイルするためのパッチを作成</a>。</p>

<p>これで無事にコンパイルできた。
しかし…安定動作しない。
ページが途切れたり、<q>(null)</q> と表示 (NULL ポインタ参照している?)
されたりする。
Prefork MPM なら大丈夫なのかなぁ?
ちなみに現在は Event MPM を利用している。</p>

<p>mod<em>layout はもう保守されていないようなので、
素直に諦め、Apache 1.3 + mod</em>layout 3.2  を試してみよう。
<a href="/blog/archives/2007/01/apache13_mod_layout32_mailman.html">続く</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sfo.jp/blog/archives/2007/01/apache22-mod-layout40.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache: Peruser MPM</title>
		<link>http://www.sfo.jp/blog/archives/2006/12/apache-peruser.html</link>
		<comments>http://www.sfo.jp/blog/archives/2006/12/apache-peruser.html#comments</comments>
		<pubDate>Fri, 15 Dec 2006 10:22:31 +0000</pubDate>
		<dc:creator>fumiyas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[仕事]]></category>

		<guid isPermaLink="false">http://www.sfo.jp/blog/archives/2006/12/apache-peruser.html</guid>
		<description><![CDATA[
Apache の WebDAV で、
ユーザーのホームディレクトリを各ユーザーの権限で読み書きするにはどうしたらよいか?
Apache の実効ユーザーを条件により動的に切り替えるには、MPM でどうにかするのが一般的? [...]]]></description>
			<content:encoded><![CDATA[<p>
Apache の WebDAV で、
ユーザーのホームディレクトリを各ユーザーの権限で読み書きするにはどうしたらよいか?
Apache の実効ユーザーを条件により動的に切り替えるには、MPM でどうにかするのが一般的?
(suExec は CGI なので対象外)
</p>

<p><p>
本命と見ていた
<a href="http://mpm.metux.de/index.php/Main_Page">Metux MPM</a>
は、ページを見ると最近は更新されていないみたい。
相変らず情報もほとんどない。
Metux MPM から派生したという
<a href="http://www.telana.com/peruser.php">Peruser MPM</a>
を見つけたが、
<q>I required a non-threaded Apache, <var>&#8230;</var></q>
ということで、スレッドではないらしい。
最近 Debian の公式パッケージに入った
<a href="http://home.samfundet.no/~sesse/mpm-itk/">ITK MPM</a>
とどっちがいいんだろう?
いずれの MPM も experimental 状態なのが気になるところ。
安定して動作したとしても、ユーザー (仮想ホスト) ごとにプロセスが必要だったり (Metux)、
スレッド対応でなかったりする (Peruser, ITK) ので、大規模な環境には向かなそう。
</p>
<p>
MPM は期待できなさそうなので、
他人のホームディレクトリへのアクセスは必要ないという前提にして、
ファイルとディレクトリの ACL 設定で実現するのが現実的だろうか。
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sfo.jp/blog/archives/2006/12/apache-peruser.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix: SMTP HELO コマンドの制限</title>
		<link>http://www.sfo.jp/blog/archives/2005/10/post-22.html</link>
		<comments>http://www.sfo.jp/blog/archives/2005/10/post-22.html#comments</comments>
		<pubDate>Thu, 27 Oct 2005 13:33:06 +0000</pubDate>
		<dc:creator>fumiyas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ダメ出し]]></category>
		<category><![CDATA[仕事]]></category>

		<guid isPermaLink="false">http://www.sfo.jp/blog/archives/2005/10/post-22.html</guid>
		<description><![CDATA[
某所で NetSky 系のウイルスが欝陶しい。
ウイルスである SMTP クライアントは
HELO 宛先アドレスのドメイン部
と喋るようなので、これで制限することにした。




まずは
/etc/postfix/he [...]]]></description>
			<content:encoded><![CDATA[<p>
某所で NetSky 系のウイルスが欝陶しい。
ウイルスである SMTP クライアントは
<q><code>HELO 宛先アドレスのドメイン部</code></q>
と喋るようなので、これで制限することにした。
</p>

<p><span id="more-67"></span>
<p>
まずは
<code class="file">/etc/postfix/helo<em>access</code>
を用意して、
<code class="commandline">postmap /etc/postfix/helo</em>access</code>
しておく。
内容は以下の通り:
</p>
<pre class="code"><code>example.com REJECT
</code></pre>
<p>
次に
<code class="file">/etc/postfix/main.cf</code>
に以下のような設定を追加して、
<code class="commandline">postfix reload</code>
する:
</p>
<pre class="code"><code>smtpd<em>helo</em>restrictions =
check<em>helo</em>access hash:/etc/postfix/helo<em>access
</code></pre>
<p>
で、試してみると…
<q><code>HELO exmaple.com</code></q>
だけでなく、
<q><code>HELO subdomain.exmaple.com</code></q>
も拒否してしまうのであった。
</p>
<p>
何で素直に exmaple.com だけを対象にしないのかね、まったく。
ちなみにこれと同じ変な仕様は、Apache の mod</em>access にもある。
いや待てよ、もしかしたら、これがいわゆる「普通」なのかも?!
だとしたらちょっと狂ってる。
<code class="command">qmail-smtpd</code>(8) の
<code class="file">rcpthosts</code> ファイルのように、
exmaple.com だったら exmaple.com だけにマッチし、
.example.com だったら example.com のサブドメインすべてにマッチするという仕様のほうが、
ずっと直感的でわかりやすく、なおかつ使い易いと思う。
</p>
<p>
気をとりなおして <code class="file">access</code>(5) を斜め読みしてから、
<code class="file">/etc/postfix/helo<em>access</code>
を以下のように変更してみた:
</p>
<pre class="code"><code>.example.com DUNNO
example.com REJECT
</code></pre>
<p>
しかし結果は変わらず。
</p>
<p>
もう一度 <code class="file">access</code>(5) をようく読んだところ、
<code class="parameter">parent</em>domain<em>matches</em>subdomains</code> が元凶であることが判明。
そこで
<code class="file">/etc/postfix/main.cf</code>
に以下を追加して無効にすることにした:
<pre class="code"><code>parent<em>domain</em>matches<em>subdomains =
</code></pre>
<p>
<code class="file">/etc/postfix/helo</em>access</code>
を最初のものに戻して試したところ、今度は成功した。
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sfo.jp/blog/archives/2005/10/post-22.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MT の Apache2 + mod_perl2 化、成功?</title>
		<link>http://www.sfo.jp/blog/archives/2005/08/mt-apache2-mod.html</link>
		<comments>http://www.sfo.jp/blog/archives/2005/08/mt-apache2-mod.html#comments</comments>
		<pubDate>Tue, 02 Aug 2005 15:50:47 +0000</pubDate>
		<dc:creator>fumiyas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.sfo.jp/blog/archives/2005/08/mt-apache2-mod.html</guid>
		<description><![CDATA[
MT は mod_perl1 に対応しているが、
mod_perl2 には対応しておらず、動作さえしない。
次のような問題があるのが理由:




MT には modperl1 対応のコードが含まれているが、
そのコー [...]]]></description>
			<content:encoded><![CDATA[<p>
MT は mod_perl1 に対応しているが、
mod_perl2 には対応しておらず、動作さえしない。
次のような問題があるのが理由:
</p>

<p><ul>
<li>
MT には mod<em>perl1 対応のコードが含まれているが、
そのコードが mod</em>perl2 環境下でも実行されてしまう。
(mod<em>perl1 と 2 とで API の互換性がない)
</li>
<li>
MT は、スクリプト実行時のカレントディレクトリがスクリプトが置かれているディレクトリであることを期待している。
(mod</em>perl2 は、カレントディレクトリを変更しない)
</li>
</ul>
<p>
<a href="http://www.wizard-limit.net/mt/pc/archives/000742.html">MT を改造して mod<em>perl2 対応を試みた例</a>がいくつかあるようだが、
成功例はないみたい。
そこで、以下のような Apache2 + mod</em>perl2 設定を考えてみた。
</p></p>

<p><span id="more-3"></span>
<pre class="config"><code>PerlSwitches -I./extlib -I./lib
&lt;VirtualHost *:80&gt;
ServerName www.sfo.jp
<var>...</var>
&lt;DirectoryMatch "^/project/sfo/www/www.sfo.jp/(lib/mt|var/mt/blog)"&gt;
Order Mutual-Failure
Allow From All
&lt;Files *.cgi&gt;
Options +ExecCGI
SetHandler perl-script
PerlFixupHandler "sub { \
chdir('/project/sfo/www/www.sfo.jp/lib/mt'); \
return OK; \
}"
PerlResponseHandler ModPerl::Registry
PerlOptions -ParseHeaders
PerlSetEnv MOD_PERL 0
&lt;/Files&gt;
&lt;/DirectoryMatch&gt;
<var>...</var>
&lt;/VirtualHost&gt;
</code></pre>
<p>簡単に解説すると、以下のような hack になる:</p>
<ul>
<li>
環境変数 <code>MOD_PERL</code> を <code>0</code> に上書きし、
MT の mod_perl1 対応コードが実行されないようにする。
</li>
<li>
MT の実行 (PerlResponseHandler) の前 (PerlFixupHandler) に、
カレントディレクトリを MT のディレクトリに移動する。
</li>
<li>
PerlSwitches は必要ないと思うのだが、ないとモジュールのロードに失敗することがある。何故だ…。
</li>
<li><em>MT の改造は必要なし!</em></li>
</ul>
<p>
現在、当サイトの MT は上記のような設定で動作している。
</p>
<p>
mod_perl2 に対応しているモジュールは、
以下のように mod_perl 判定するのが一般的なようなので、
それらはちゃんと mod_perl2 の API を利用してくれるはず:
<pre class="code"><code>if (exists $ENV{MOD_PERL}) {
eval "require mod_perl";
if (defined $mod_perl::VERSION) {
if ($mod_perl::VERSION >= 1.99) {
<var>...mod_perl2 対応のコード...</var>
} else {
<var>...mod_perl1 対応のコード...</var>
}
}
</code></pre>
<p>
問題点が 1つ。<code>chdir</code> の結果はスレッドローカルではなくなるため、
Apache2 の MPM が worker の場合、
複数の MT にこの hack を適用すると問題が発生するものと思われる。
（未確認)
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sfo.jp/blog/archives/2005/08/mt-apache2-mod.html/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>www.sfo.jp の MT 用 Apache の設定</title>
		<link>http://www.sfo.jp/blog/archives/2005/08/wwwsfojp-mt-apa.html</link>
		<comments>http://www.sfo.jp/blog/archives/2005/08/wwwsfojp-mt-apa.html#comments</comments>
		<pubDate>Tue, 02 Aug 2005 11:49:38 +0000</pubDate>
		<dc:creator>fumiyas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.sfo.jp/blog/archives/2005/08/wwwsfojp-mt-apa.html</guid>
		<description><![CDATA[
こんな感じになった。
MT は /project/sfo/www/www.sfo.jp/lib/mt にインストールして、
MT が生成するファイルは /project/sfo/www/www.sfo.jp/var/m [...]]]></description>
			<content:encoded><![CDATA[<p>
こんな感じになった。
MT は <code>/project/sfo/www/www.sfo.jp/lib/mt</code> にインストールして、
MT が生成するファイルは <code>/project/sfo/www/www.sfo.jp/var/mt</code> に置いてある。
</p>

<p><pre class="code"><code>&lt;VirtualHost <em>:80>
ServerName www.sfo.jp
<var>...</var>
AliasMatch ^/mt/static/(mt&#46;js|styles&#46;css|images/.</em>|docs/.*)$ /project/sfo/www/www.sfo.jp/lib/mt/$1
ScriptAlias /mt/ /project/sfo/www/www.sfo.jp/lib/mt/
Alias /blog/ /project/sfo/www/www.sfo.jp/var/mt/blog/
...
&lt;DirectoryMatch "^/project/sfo/www/www.sfo.jp/(lib/mt|var/mt/blog)"&gt;
Order Mutual-Failure
Allow From All
&lt;/DirectoryMatch&gt;
...
&lt;/VirtualHost&gt;
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sfo.jp/blog/archives/2005/08/wwwsfojp-mt-apa.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

