]> granicus.if.org Git - apache/blob - docs/manual/configuring.xml.ja
Rebuilding various recent changes.
[apache] / docs / manual / configuring.xml.ja
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
3 <?xml-stylesheet type="text/xsl" href="./style/manual.ja.xsl"?>
4 <!-- English Revision: 420990:1061758 (outdated) -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <manualpage metafile="configuring.xml.meta">
24
25   <title>設定ファイル</title>
26
27 <summary>
28 <p>この文書では、Apache HTTP サーバを設定するのに使用するファイルについて
29 記述しています。</p>
30 </summary>
31
32   <section id="main">
33     <title>メインの設定ファイル</title>
34     <related>
35       <modulelist>
36         <module>mod_mime</module>
37       </modulelist>
38       <directivelist>
39         <directive module="core" type="section">IfDefine</directive>
40         <directive module="core">Include</directive>
41         <directive module="mod_mime">TypesConfig</directive>
42       </directivelist>
43     </related>
44
45     <p>Apache は <a href="mod/directives.html"
46     >ディレクティブ</a> を設定ファイルに平文で書くことにより設定します。
47     メインの設定ファイルは普通は <code>httpd.conf</code> という名前です。
48     このファイルの位置はコンパイル時に設定されますが、コマンドラインの
49     <code>-f</code> フラグにより上書きできます。
50     また、他の設定ファイルを <directive module="core">Include</directive>
51     ディレクティブによって追加でき、ワイルドカードを使用して多数の
52     設定ファイルを追加することができます。
53     どんなディレクティブも、これらの設定ファイルどれにでも入れることができます。
54     Apache は起動時か再起動時のみメイン設定ファイルの変更を認識します。</p>
55
56     <p>サーバは MIME
57     ドキュメントタイプを含んでいるファイルも読み込みます。ファイル名は
58     <directive module="mod_mime">TypesConfig</directive>
59     で設定され、デフォルトでは <code>mime.types</code>
60     になっています。</p>
61   </section>
62
63   <section id="syntax">
64     <title>設定ファイルの構文</title>
65
66     <p>Apache の設定ファイルは 1 行に 1 つのディレクティブからなります。
67     バックスラッシュ "\" はディレクティブが次の行に継続していることを
68     示すために行の最後の文字として使われているかもしれません。
69     行の最後とバックスラッシュの間に他の文字や空白があってはいけません。
70     </p>
71
72     <p>設定ファイルのディレクティブは大文字小文字を区別しませんが、
73     引数にはしばしば区別するものがあります。ハッシュ文字 "#"
74     で始まる行はコメントと見なされて無視されます。
75     設定ディレクティブと同一行の末尾にコメントが含まれていては<strong
76     >いけません</strong>。ディレクティブの前の空行と空白は無視されますので、
77     わかりやすくするためにディレクティブをインデントしても構いません。
78     </p>
79
80     <p>設定ファイルの構文エラーは、
81     <code>apachectl configtest</code>
82     かコマンドラインオプション
83     <code>-t</code> を使って調べられます。</p>
84   </section>
85
86   <section id="modules">
87     <title>モジュール</title>
88
89     <related>
90       <modulelist>
91         <module>mod_so</module>
92       </modulelist>
93       <directivelist>
94         <directive module="core" type="section">IfModule</directive>
95         <directive module="mod_so">LoadModule</directive>
96       </directivelist>
97     </related>
98
99     <p>Apache はモジュール化されたサーバです。
100     コアサーバには最も基本的な機能だけが含まれています。拡張機能は
101     Apache にロードされる<a href="mod/">モジュール</a
102     >として利用可能です。デフォルトでは、コンパイル時にモジュールの
103     <a href="mod/module-dict.html#Status">Base</a> セット (基本セット) が
104     サーバに含まれます。サーバが<a href="dso.html">動的ロード</a
105     >モジュールを使うようにコンパイルされている場合は、
106     モジュールを別にコンパイルして、いつでも
107     <directive module="mod_so">LoadModule</directive>
108     ディレクティブを使って追加できます。
109     そうでない場合は、モジュールの追加や削除をするためには Apache
110     を再コンパイルする必要があります。設定ディレクティブは <directive
111     module="core" type="section">IfModule</directive>
112     ブロックに入れることで特定のモジュールが存在するときだけ
113     設定ファイルに含まれるようにすることができます。</p>
114
115     <p>コマンドラインオプション <code>-l</code> を使って現時点で
116     どのモジュールがサーバにコンパイルされているかを知ることができます。</p>
117   </section>
118
119   <section id="scope">
120     <title>ディレクティブの適用範囲</title>
121
122     <related>
123       <directivelist>
124         <directive module="core" type="section">Directory</directive>
125         <directive module="core" type="section">DirectoryMatch</directive>
126         <directive module="core" type="section">Files</directive>
127         <directive module="core" type="section">FilesMatch</directive>
128         <directive module="core" type="section">Location</directive>
129         <directive module="core" type="section">LocationMatch</directive>
130         <directive module="core" type="section">VirtualHost</directive>
131       </directivelist>
132     </related>
133
134     <p>メイン設定ファイルにあるディレクティブはサーバ全体に適用されます。
135     サーバの一部分の設定だけを変更したい場合は <directive module="core"
136     type="section">Directory</directive>, <directive module="core"
137     type="section">DirectoryMatch</directive>, <directive module="core"
138     type="section">Files</directive>, <directive module="core"
139     type="section">FilesMatch</directive>, <directive module="core"
140     type="section">Location</directive>, <directive module="core"
141     type="section">LocationMatch</directive>
142     セクションの中に置くことで適用範囲を決められます。
143     これらのセクションはその中にあるディレクティブの適用範囲を
144     特定のファイルシステムの位置や URL に限定します。
145     非常に細粒度の設定を可能にするために、
146     セクションを入れ子にすることもできます。</p>
147
148     <p>Apache は同時に多くの違うウェブサイトを扱う能力があります。
149     これは <a href="vhosts/">バーチャルホスト</a> と呼ばれています。
150     特定のウェブサイトにのみ適用されるようにするために、
151     ディレクティブは
152     <directive module="core" type="section">VirtualHost</directive>
153     セクションの中に置くことでも適用範囲を変えることができます。</p>
154
155     <p>ほとんどのディレクティブはどのセクションにでも書けますが、
156     中にはコンテキストによっては意味をなさないものもあります。
157     例えば、プロセスの作成を制御しているディレクティブはメインサーバの
158     コンテキストにのみ書くことができます。
159     どのディレクティブをどのセクションに書くことができるかを知るためには
160     ディレクティブの <a href="mod/directive-dict.html#Context"
161     >コンテキスト</a> を調べてください。詳しい情報は、
162     <a href="sections.html">Directory, Location, Files
163     セクションの動作法</a>にあります。</p>
164   </section>
165
166   <section id="htaccess">
167     <title>.htaccess ファイル</title>
168
169     <related>
170       <directivelist>
171         <directive module="core">AccessFileName</directive>
172         <directive module="core">AllowOverride</directive>
173       </directivelist>
174     </related>
175
176     <p>Apache ではウェブツリーの中に置かれた特別なファイルを使って
177     非中央集権的な設定管理をできます。その特別なファイルは普通は
178     <code>.htaccess</code> という名前で、
179     <directive module="core">AccessFileName</directive>
180     ディレクティブでどんな名前にでも指定できます。
181     <code>.htaccess</code>
182     ファイルに書かれたディレクティブはファイルを置いた
183     ディレクトリとその全てのサブディレクトリに適用されます。
184     <code>.htaccess</code> ファイルは、メインの設定ファイルと同じ
185     構文を使います。
186     <code>.htaccess</code>
187     ファイルはすべてのリクエストで読み込まれるため、
188     変更はすぐに反映されます。</p>
189
190     <p>どのディレクティブが <code>.htaccess</code>
191     ファイルに書けるかを調べるには、ディレクティブの<a
192     href="mod/directive-dict.html#Context">コンテキスト</a>
193     を調べてください。サーバ管理者はさらにメイン設定ファイルの
194     <directive module="core">AllowOverride</directive>
195     を設定することでどのディレクティブを <code>.htaccess</code>
196     ファイルに書けるようにするかを制御することができます。</p>
197
198     <p><code>.htaccess</code> ファイルに関する詳しい情報は
199     <a href="howto/htaccess.html">.htaccess チュートリアル</a>
200     を参照してください。</p>
201   </section>
202 </manualpage>