1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"><head><!-- 4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 This file is generated from xml source: DO NOT EDIT 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 --> 8<title>mod_so - Apache HTTP サーバ</title> 9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 11<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" /> 12<script src="/style/scripts/prettify.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body> 17<div id="page-header"> 18<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p> 19<p class="apache">Apache HTTP サーバ バージョン 2.2</p> 20<img alt="" src="/images/feather.gif" /></div> 21<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 22<div id="path"> 23<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP サーバ</a> > <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> > <a href="../">バージョン 2.2</a> > <a href="./">モジュール</a></div> 24<div id="page-content"> 25<div id="preamble"><h1>Apache モジュール mod_so</h1> 26<div class="toplang"> 27<p><span>翻訳済み言語: </span><a href="/en/mod/mod_so.html" hreflang="en" rel="alternate" title="English"> en </a> | 28<a href="/ja/mod/mod_so.html" title="Japanese"> ja </a> | 29<a href="/ko/mod/mod_so.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 30<a href="/tr/mod/mod_so.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 31</div> 32<table class="module"><tr><th><a href="module-dict.html#Description">説明:</a></th><td>起動時や再起動時に実行コードとモジュールをサーバにロードする 33</td></tr> 34<tr><th><a href="module-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 35<tr><th><a href="module-dict.html#ModuleIdentifier">モジュール識別子:</a></th><td>so_module</td></tr> 36<tr><th><a href="module-dict.html#SourceFile">ソースファイル:</a></th><td>mod_so.c</td></tr> 37<tr><th><a href="module-dict.html#Compatibility">互換性:</a></th><td>このモジュールは Window では (常に含まれている) Base 38モジュールです</td></tr></table> 39<h3>概要</h3> 40 41 42 <p>いくつかのオペレーティングシステムでは、サーバの再コンパイルをする代わりに、 43 このモジュールを使用して 44 <a href="/dso.html">動的共有オブジェクト</a> 45 (DSO) 機構により、実行時に Apache にモジュールを読み込ませることが 46 できます。</p> 47 48 <p>Unix 上では、読み込まれるコードは通常は共有オブジェクトファイル 49 (普通 <code>.so</code> という拡張子が付いています) からです。 50 Windows 上ではこのモジュールの拡張子は <code>.so</code> か <code>.dll</code> 51 です。</p> 52 53 <div class="warning"><h3>警告</h3> 54 <p>Apache 1.3 のモジュールを直接 Apache 2.0 で使うことはできません 55 ― モジュールは Apache 2.0 用に動的にロードされるか、 56 直接組み込まれるために修正されなければなりません。</p> 57 </div> 58</div> 59<div id="quickview"><h3 class="directives">ディレクティブ</h3> 60<ul id="toc"> 61<li><img alt="" src="/images/down.gif" /> <a href="#loadfile">LoadFile</a></li> 62<li><img alt="" src="/images/down.gif" /> <a href="#loadmodule">LoadModule</a></li> 63</ul> 64<h3>トピック</h3> 65<ul id="topics"> 66<li><img alt="" src="/images/down.gif" /> Windows 用のロード可能なモジュールを作成する</li> 67</ul><ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div> 68<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 69<div class="section"> 70<h2>Windows 用のロード可能なモジュールを作成する</h2> 71 72 <div class="note"><h3>注</h3> 73 <p>Apache 1.3.15 と 2.0 とで Windows のモジュール名の形式は変更されました 74 ― モジュールは mod_foo.so という名前になりました。</p> 75 76 <p>まだ mod_so で ApacheModuleFoo.dll という名前のモジュールも 77 ロードされますが、新しい名前の付け方を使う方が好まれます。モジュールを 78 2.0 用に移植しているのであれば、2.0 の習慣に合うように名前を 79 修正してください。</p></div> 80 81 <p>Apache のモジュール API は UNIX と Windows 間では変更されていません。 82 多くのモジュールは全く変更なし、もしくは簡単な変更により Windows 83 で実行できるようになります。ただし、それ以外の Windows には無い Unix 84 アーキテクチャーの機能に依存したモジュールは動作しません。</p> 85 86 <p>モジュールが実際に動作するときは、 87 二つの方法のどちらかでサーバに追加することができます。まず、Unix 88 と同様にサーバにコンパイルして組み込むことができます。Windows 89 用の Apache は Unix 用の Apache にある <code>Configure</code> 90 プログラムがありませんので、モジュールのソースファイルを 91 ApacheCore プロジェクトファイルに追加し、シンボルを 92 <code>os\win32\modules.c</code> ファイルに追加する必要があります。</p> 93 94 <p>二つ目はモジュールを DLL としてコンパイルする方法です。 95 DLL は共有ライブラリで、実行時に 96 <code><code class="directive">LoadModule</code></code> 97 ディレクティブによりサーバに読み込むことができます。これらのモジュール 98 DLL はそのまま配布することが可能で、サーバを再コンパイルすることなく、Windows 99 用の Apache のすべてのインストールで実行することができます。</p> 100 101 <p>モジュール DLL を作成するためには、 102 モジュールの作成に小さな変更を行なう必要があります。 103 つまり、モジュールのレコード (これは後で作成されます。 104 以下を参照してください) が DLL からエクスポートされなければなりません。 105 これを行なうには、<code>AP_MODULE_DECLARE_DATA</code> (Apache 106 のヘッダファイルで定義されています) をモジュールのモジュールレコード 107 定義の部分に追加してください。たとえば、モジュールに</p> 108<div class="example"><p><code> 109 module foo_module; 110</code></p></div> 111 112 <p>があるとすると、それを次のもので置き換えてください。</p> 113<div class="example"><p><code> 114 module AP_MODULE_DECLARE_DATA foo_module; 115</code></p></div> 116 117 <p>Unix 上でもこのモジュールを 118 変更無しで使い続けられるように、このマクロは Windows 119 上でのみ効力を持ちます。<code>.DEF</code> 120 ファイルの方を良く知っているという場合は、 121 代わりにそれを使ってモジュールレコードを 122 エクスポートすることもできます。</p> 123 <p>さあ、あなたのモジュールの DLL を作成しましょう。これを、 124 libhttpd.lib 共有ライブラリがコンパイルされたときに作成された 125 ibhttpd.lib エクスポートライブラリとリンクしてください。この時に、 126 Apache のヘッダファイルが正しい位置にあるように、 127 コンパイラの設定を変える必要があるかもしれません。 128 このライブラリはサーバルートの modules ディレクトリにあります。 129 ビルド環境が正しく設定されるように、既存のモジュール用の .dsp を 130 取ってくるのが一番良いでしょう。もしくは、あなたの .dsp と 131 コンパイラとリンクのオプションを比較する、というものでも良いです。</p> 132 133 <p>これで DLL 版のモジュールが作成されているはずです。 134 サーバルートの <code>modules</code> 135 ディレクトリにモジュールを置いて、 136 <code><code class="directive">LoadModule</code></code> 137 ディレクティブを使って読み込んでください。</p> 138</div> 139<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 140<div class="directive-section"><h2><a name="LoadFile" id="LoadFile">LoadFile</a> <a name="loadfile" id="loadfile">ディレクティブ</a></h2> 141<table class="directive"> 142<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>指定されたオブジェクトファイルやライブラリをリンクする</td></tr> 143<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>LoadFile <em>filename</em> [<em>filename</em>] ...</code></td></tr> 144<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル</td></tr> 145<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 146<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_so</td></tr> 147</table> 148 149 <p>LoadFile ディレクティブは、サーバが起動されたときや再起動されたときに、 150 指定されたオブジェクトファイルやライブラリをリンクします。 151 これはモジュールが動作するために必要になるかもしれない追加の 152 コードを読み込むために使用されます。<em>Filename</em> は絶対パスか、<a href="core.html#serverroot">ServerRoot</a> からの相対パスです。</p> 153 154 <p>例:</p> 155 156 <div class="example"><p><code>LoadFile libexec/libxmlparse.so</code></p></div> 157 158 159</div> 160<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 161<div class="directive-section"><h2><a name="LoadModule" id="LoadModule">LoadModule</a> <a name="loadmodule" id="loadmodule">ディレクティブ</a></h2> 162<table class="directive"> 163<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>オブジェクトファイルやライブラリをリンクし、使用モジュールの 164リストに追加する</td></tr> 165<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>LoadModule <em>module filename</em></code></td></tr> 166<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル</td></tr> 167<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 168<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_so</td></tr> 169</table> 170 171 <p>LoadModule ディレクティブは <em>filename</em> 172 というオブジェクトファイルおよびライブラリをリンクし、<em>module</em> 173 という名前のモジュールの構造をアクティブなモジュールのリストに追加します。 174 <em>Module</em> はファイル中の <code>module</code> 175 型の外部変数の名前で、モジュールのドキュメントに 176 <a href="module-dict.html#moduleidentifier">モジュール識別子</a>として書かれているものです。例 :</p> 177 178 <div class="example"><p><code> 179 LoadModule status_module modules/mod_status.so 180 </code></p></div> 181 182 <p>これは ServerRoot の modules サブディレクトリから指定された名前の 183 モジュールをロードします。</p> 184 185</div> 186</div> 187<div class="bottomlang"> 188<p><span>翻訳済み言語: </span><a href="/en/mod/mod_so.html" hreflang="en" rel="alternate" title="English"> en </a> | 189<a href="/ja/mod/mod_so.html" title="Japanese"> ja </a> | 190<a href="/ko/mod/mod_so.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 191<a href="/tr/mod/mod_so.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 192</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">コメント</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 193<script type="text/javascript"><!--//--><![CDATA[//><!-- 194var comments_shortname = 'httpd'; 195var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_so.html'; 196(function(w, d) { 197 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 198 d.write('<div id="comments_thread"><\/div>'); 199 var s = d.createElement('script'); 200 s.type = 'text/javascript'; 201 s.async = true; 202 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 203 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 204 } 205 else { 206 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 207 } 208})(window, document); 209//--><!]]></script></div><div id="footer"> 210<p class="apache">Copyright 2013 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> 211<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 212if (typeof(prettyPrint) !== 'undefined') { 213 prettyPrint(); 214} 215//--><!]]></script> 216</body></html>