github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_2_34/manual/vhosts/fd-limits.html.ja.utf8 (about) 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 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> 5 <!-- 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 This file is generated from xml source: DO NOT EDIT 8 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 9 --> 10 <title>ファイル記述子の限界 - Apache HTTP サーバ バージョン 2.2</title> 11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 13 <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" /> 14 <script src="../style/scripts/prettify.min.js" type="text/javascript"> 15 </script> 16 17 <link href="../images/favicon.ico" rel="shortcut icon" /><link href="http://httpd.apache.org/docs/current/vhosts/fd-limits.html" rel="canonical" /></head> 18 <body id="manual-page" class="no-sidebar"><div id="page-header"> 19 <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> 20 <p class="apache">Apache HTTP サーバ バージョン 2.2</p> 21 <img alt="" src="../images/feather.gif" /></div> 22 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> 23 <div id="path"> 24 <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><div id="page-content"><div class="retired"><h4>Please note</h4> 25 <p> This document refers to a legacy release (<strong>2.2</strong>) of Apache httpd. The active release (<strong>2.4</strong>) is documented <a href="http://httpd.apache.org/docs/current">here</a>. If you have not already upgraded, please follow <a href="http://httpd.apache.org/docs/current/upgrading.html">this link</a> for more information.</p> 26 <p>You may follow <a href="http://httpd.apache.org/docs/current/vhosts/fd-limits.html">this link</a> to go to the current version of this document.</p></div><div id="preamble"><h1>ファイル記述子の限界</h1> 27 <div class="toplang"> 28 <p><span>翻訳済み言語: </span><a href="../en/vhosts/fd-limits.html" hreflang="en" rel="alternate" title="English"> en </a> | 29 <a href="../fr/vhosts/fd-limits.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | 30 <a href="../ja/vhosts/fd-limits.html" title="Japanese"> ja </a> | 31 <a href="../ko/vhosts/fd-limits.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 32 <a href="../tr/vhosts/fd-limits.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 33 </div> 34 <div class="outofdate">この日本語訳はすでに古くなっている 35 可能性があります。 36 最近更新された内容を見るには英語版をご覧下さい。 37 </div> 38 39 40 <p>たくさんのバーチャルホストを運用する場合、もし、 41 各バーチャルホストごとに異なるログファイルが指定してあると、 42 Apache がファイル記述子 (<cite>ファイルハンドル</cite>とも呼ばれます) 43 を使い切ってしまうことがあります。Apache が使用するファイル 44 記述子の数は、各エラーログファイルにつき 1 つ、他のログファイルの 45 ディレクティブにつき 1 つ、さらに内部で使用する 10 から 20、 46 の合計になります。Unix オペレーティングシステムではプロセスごとに 47 使用可能なファイル記述子の数を制限しています。たいていの場合は 64 で、 48 普通は大きな値のハードリミットまで増やすことができます。</p> 49 50 <p>Apache は必要に応じて上限を拡大しようと試みますが、 51 以下のような場合にはうまくいかないかもしれません。</p> 52 53 <ol> 54 <li>利用しているシステムで <code>setrlimit()</code> 55 システムコールが提供されていない。</li> 56 57 <li>システム上で <code>setrlimit</code>(RLIMIT_NOFILE) が動作しない 58 (たとえば Solaris 2.3 のように)。</li> 59 60 <li>要求されるファイル記述子の数が 61 ハードリミットを超えてしまう。</li> 62 63 <li>システムにファイル記述子に関して別の制限が存在してしまっている。 64 たとえば、stdio ストリームではファイル記述子を 256 以上使えない 65 (Solaris 2)、など。</li> 66 </ol> 67 68 <p>問題が発生した時に取り得る対処方法は次のとおり:</p> 69 70 <ul> 71 <li>ログファイルの数を減らす。<code class="directive"><a href="../mod/core.html#virtualhost"><VirtualHost></a></code> 72 セクションでログファイルを指定せず、メインのログファイルにのみ記録する。 73 (これに関する詳しい情報は以下の<a href="#splitlogs">ログファイルの分割</a>を読んでください。)</li> 74 75 <li> 76 もし、前述の 1 または 2 の場合であれば、 77 Apache を起動する前にファイル記述子を増やします。 78 たとえば次のようなスクリプトを使います。 79 80 <div class="example"><p><code> 81 <code>#!/bin/sh<br /> 82 ulimit -S -n 100<br /> 83 exec httpd</code> 84 </code></p></div> 85 </li> 86 </ul> 87 </div> 88 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 89 <div class="section"> 90 <h2><a name="splitlogs" id="splitlogs">ログファイルの分割</a></h2> 91 92 <p>複数のバーチャルホストのログを同じログファイルに収集しようとしているときには、 93 各バーチャルホストについて統計的な解析を実行するために後でログファイルを 94 分割したくなるかもしれません。これは以下のようにして実現できます。</p> 95 96 <p>まず、バーチャルホストの情報をログのエントリに追加する必要があります。 97 これは <code class="directive"><a href="../mod/mod_log_config.html#logformat">LogFormat</a></code> 98 ディレクティブの <code>%v</code> 変数を使うことでできます。 99 これをログのフォーマット文字列の先頭に追加します:</p> 100 101 <div class="example"><p><code> 102 LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost<br /> 103 CustomLog logs/multiple_vhost_log vhost 104 </code></p></div> 105 106 <p>これは common log format のログを作成しますが、それぞれの行の先頭に 107 正規化されたバーチャルホストの名前 108 (<code class="directive"><a href="../mod/core.html#servername">ServerName</a></code> 109 ディレクティブに書かれているもの) が付加されます。 110 (ログファイルのカスタマイズの詳細については <a href="../mod/mod_log_config.html#formats">Custom Log Formats</a> を 111 読んでください。)</p> 112 113 <p>ログファイルを各部分 (バーチャルホスト毎に 1 ファイル) に分けたいときは、 114 <code><a href="../programs/other.html">split-logfile</a></code> 115 を使って行なうことができます。プログラムは Apache 配布の 116 <code>support</code> ディレクトリにあります。</p> 117 118 <p>以下のようなコマンドでこのプログラムを実行します:</p> 119 120 <div class="example"><p><code> 121 split-logfile < /logs/multiple_vhost_log 122 </code></p></div> 123 124 <p>このプログラムはバーチャルホストのログファイルの名前とともに実行され、 125 ログファイルに現れるそれぞれのバーチャルホスト毎に一つのファイルを作成します。 126 それぞれのファイルは <code>ホスト名.log</code> という名前になります。</p> 127 128 </div></div> 129 <div class="bottomlang"> 130 <p><span>翻訳済み言語: </span><a href="../en/vhosts/fd-limits.html" hreflang="en" rel="alternate" title="English"> en </a> | 131 <a href="../fr/vhosts/fd-limits.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | 132 <a href="../ja/vhosts/fd-limits.html" title="Japanese"> ja </a> | 133 <a href="../ko/vhosts/fd-limits.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 134 <a href="../tr/vhosts/fd-limits.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 135 </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> 136 <script type="text/javascript"><!--//--><![CDATA[//><!-- 137 var comments_shortname = 'httpd'; 138 var comments_identifier = 'http://httpd.apache.org/docs/2.2/vhosts/fd-limits.html'; 139 (function(w, d) { 140 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 141 d.write('<div id="comments_thread"><\/div>'); 142 var s = d.createElement('script'); 143 s.type = 'text/javascript'; 144 s.async = true; 145 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 146 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 147 } 148 else { 149 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 150 } 151 })(window, document); 152 //--><!]]></script></div><div id="footer"> 153 <p class="apache">Copyright 2017 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> 154 <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[//><!-- 155 if (typeof(prettyPrint) !== 'undefined') { 156 prettyPrint(); 157 } 158 //--><!]]></script> 159 </body></html>