TracFastCgiバージョン 1バージョン 2 との変更


以下の違いを無視:
日時:
2015/05/27 0:24:03 (11年前)
更新者:
trac
コメント:

--

凡例:

変更なし
追加
削除
更新
  • TracFastCgi

    v1 v2  
    11[[PageOutline]]
    22
    3 = Trac with FastCGI =
    4 
    5 [http://www.fastcgi.com/ FastCGI] interface allows Trac to remain resident much like with [wiki:TracModPython mod_python] or [wiki:TracModWSGI mod_wsgi]. It is faster than external CGI interfaces which must start a new process for each request.  Additionally, it is supported by much wider variety of web servers.
    6 
    7 Note that unlike mod_python, FastCGI supports [http://httpd.apache.org/docs/suexec.html Apache SuEXEC], i.e. run with different permissions than web server running with (`mod_wsgi` supports the `WSGIDaemonProcess` with user / group parameters to achieve the same effect).
    8 
    9 '''Note for Windows:''' Trac's FastCGI does not run under Windows, as Windows does not implement `Socket.fromfd`, which is used by `_fcgi.py`. If you want to connect to IIS, you may want to try [trac:TracOnWindowsIisAjp AJP]/[trac:TracOnWindowsIisAjp ISAPI].
     3= Trac を FastCGI で使用する = #TracwithFastCGI
     4
     5[http://www.fastcgi.com/ FastCGI] インターフェースを使用すると [wiki:TracModPython mod_python] や [wiki:TracModWSGI mod_wsgi] と同様に Trac を常駐させることができます。リクエスト毎に新しいプロセスを開始しなければならない CGI インターフェースよりも処理速度は速くなります。加えて、多種多様の Web サーバでサポートされています。
     6
     7Note: mod_python とは異なり、FastCGI では [http://httpd.apache.org/docs/suexec.html Apache SuEXEC] をサポートしています。つまり、Web サーバを実行しているユーザとは、異なる権限でプログラムを実行することができます。(`mod_wsgi` でサポートしている `WSGIDaemonProcess` におけるユーザ / グループと同じ効果を得ることができます)
     8
     9'''Windows 向け:''' Trac の FastCGI は Windows 環境下で動作しません。これは、`_fcgi.py` で用いられる `Socket.fromfd` が Windows では実行されないからです。もし IIS へ接続したい場合は、[trac:TracOnWindowsIisAjp AJP]/[trac:TracOnWindowsIisAjp ISAPI] に挑戦してみて下さい。
    1010
    1111[[PageOutline(2-3,Overview,inline)]]
    1212
    1313
    14 == Simple Apache configuration ==
    15 
    16 There are two FastCGI modules commonly available for Apache: `mod_fastcgi` and
    17 `mod_fcgid` (preferred). The latter is more up-to-date.
    18 
    19 The following sections focus on the FCGI specific setup, see also [wiki:TracModWSGI#ConfiguringAuthentication] for configuring the authentication in Apache.
    20 
    21 Regardless of which cgi module is used, be sure the web server has executable permissions on the cgi-bin folder. While FastCGI will throw specific permissions errors, mod_fcgid will throw an ambiguous error if this has not been done. (Connection reset by peer: mod_fcgid: error reading data from FastCGI server)
    22 
    23 === Set up with `mod_fastcgi` ===
    24 `mod_fastcgi` uses `FastCgiIpcDir` and `FastCgiConfig` directives that should be added to an appropriate Apache configuration file:
     14== 単純な Apache の設定 == #SimpleApacheconfiguration
     15
     16Apache で利用可能な FastCGI モジュールは 2 種類あります: `mod_fastcgi` と
     17`mod_fcgid` (推奨) です。後者の方がよりメンテナンスされています。
     18
     19次の項目では、FCGI の特定のセットアップに焦点を合わせています。Apache の認証の設定方法については [wiki:TracModWSGI#ConfiguringAuthentication] を参照してください。
     20
     21CGI モジュールを使用する場合は注意してください。また、必ず Web サーバに cgi-bin フォルダの実行権限を持たせてください。 FastCGI では詳細な権限に関するエラーが出力されますが、mod_fcgid ではこの処理が行われていない場合には、不明瞭なエラーしか出力されません。(Connection reset by peer: mod_fcgid: error reading data from FastCGI server の様な)
     22
     23=== `mod_fastcgi` でのセットアップ === #setupwithmod_fastcgi
     24`mod_fastcgi` では `FastCgiIpcDir` と `FastCgiConfig` ディレクティブを使用して Apache の設定ファイルに設定を行います:
    2525{{{
    2626# Enable fastcgi for .fcgi files
     
    2929<IfModule mod_fastcgi.c>
    3030   AddHandler fastcgi-script .fcgi
    31    FastCgiIpcDir /var/lib/apache2/fastcgi 
     31   FastCgiIpcDir /var/lib/apache2/fastcgi
    3232</IfModule>
    3333LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so
    3434}}}
    35 Setting `FastCgiIpcDir` is optional if the default is suitable. Note that the `LoadModule` line must be after the `IfModule` group.
    36 
    37 Configure `ScriptAlias` or similar options as described in TracCgi, but
    38 calling `trac.fcgi` instead of `trac.cgi`.
    39 
    40 Add the following to the Apache configuration file (below the `FastCgiIpcDir` line) if you intend to set up the `TRAC_ENV` as an overall default:
     35デフォルトの設定に問題がなければ、 `FastCgiIpcDir` の設定は必須ではありません。 `LoadModule` の行は `IfModule` グループの後になければいけないことに注意して下さい。
     36
     37`ScriptAlias` もしくは TracCgi で説明されている類似のオプションを設定しますが、
     38`trac.cgi` の代わりに `trac.fcgi` を指定してください。
     39
     40すべてデフォルトで `TRAC_ENV` をセットアップするつもりならば、Apache の設定ファイルに以下を追加します (`FastCgiIpcDir` より下に):
    4141{{{
    4242FastCgiConfig -initial-env TRAC_ENV=/path/to/env/trac
    4343}}}
    4444
    45 Alternatively, you can serve multiple Trac projects in a directory by adding this:
     45あるいは、以下を追加することで複数の Trac プロジェクトを提供できます:
    4646{{{
    4747FastCgiConfig -initial-env TRAC_ENV_PARENT_DIR=/parent/dir/of/projects
    4848}}}
    4949
    50 === Set up with `mod_fcgid` ===
    51 Configure `ScriptAlias` (see TracCgi for details), but call `trac.fcgi`
    52 instead of `trac.cgi`. Note that slash at the end - it is important.
     50=== `mod_fcgid` でのセットアップ === #Setupwithmod_fcgid
     51`ScriptAlias` を設定します。 (詳細は TracCgi を参照してください)、 ただし
     52trac.cgi` の代わりに `trac.fcgi` を呼び出します。 Note: 最後のスラッシュを忘れずに。とても重要です。
    5353{{{
    5454ScriptAlias /trac /path/to/www/trac/cgi-bin/trac.fcgi/
    5555}}}
    5656
    57 To set up Trac environment for `mod_fcgid` it is necessary to use
    58 `DefaultInitEnv` directive. It cannot be used in `Directory` or
    59 `Location` context, so if you need to support multiple projects, try
    60 alternative environment setup below.
     57`mod_fcgid` で Trac environment を設定するには `DefaultInitEnv`
     58ディレクティブを使用します。このディレクティブは `Direcotry` や `Location`
     59コンテキストで使用できないので、複数のプロジェクトを設定する場合、
     60以下に記述する Environment を設定する別の方法を試してください。
    6161
    6262{{{
     
    6464}}}
    6565
    66 === alternative environment setup ===
    67 A better method to specify path to Trac environment is to embed the path
    68 into `trac.fcgi` script itself. That doesn't require configuration of server
    69 environment variables, works for both FastCgi modules
    70 (and for [http://www.lighttpd.net/ lighttpd] and CGI as well):
     66=== Environment を設定する別の方法 === #alternativeenvironmentsetup
     67Trac environment へのパスを設定するための、より適した方法は、パスを
     68`trac.fcgi` スクリプト自体に書き込むことです。これによってサーバの環境変数を
     69設定する必要がなくなり、どちらの !FastCgi モジュール (および
     70[http://www.lighttpd.net/ lighttpd] や CGI など) でも、動作するようになります:
    7171{{{
    7272import os
    7373os.environ['TRAC_ENV'] = "/path/to/projectenv"
    7474}}}
    75 or
     75または
    7676{{{
    7777import os
     
    7979}}}
    8080
    81 With this method different projects can be supported by using different
    82 `.fcgi` scripts with different `ScriptAliases`.
    83 
    84 See [https://coderanger.net/~coderanger/httpd/fcgi_example.conf this fcgid example config] which uses a !ScriptAlias directive with trac.fcgi with a trailing / like this:
     81プロジェクトごとの `ScriptAlias` と `.fcgi` スクリプトを設定すれば、
     82起動スクリプトに `TRAC_ENV` 等を設定する方法を使用して複数のプロジェクトに対応することができます。
     83
     84この [https://coderanger.net/~coderanger/httpd/fcgi_example.conf fcgid 設定例] の通り、 !ScriptAlias ディレクティブでは末尾の / も含めて設定してください:
    8585{{{
    8686ScriptAlias / /srv/tracsite/cgi-bin/trac.fcgi/
    8787}}}
    8888
    89 == Simple Cherokee Configuration ==
    90 
    91 The configuration on Cherokee's side is quite simple. You will only need to know that you can spawn Trac as an SCGI process.
    92 You can either start it manually, or better yet, automatically by letting Cherokee spawn the server whenever it is down.
    93 First set up an information source in cherokee-admin with a local interpreter.
     89== Cherokee の簡単な設定 == #SimpleCherokeeConfiguration
     90
     91Cherokee 側の設定はとても簡単です。 Trac を SCGI プロセスとして起動できるかどうかのみ知っている必要があります。
     92Cherokee が起動していないときにはいつでも、 Cherokee が Trac を切り離せるようにすることによって、 Trac を手動で起動することも、いっそのこと自動的に起動することもできます。
     93最初に、ローカルのインタプリタである cherokee-admin で information source を設定します。
    9494
    9595{{{
     
    101101}}}
    102102
    103 If the port was not reachable, the interpreter command would be launched. Note that, in the definition of the information source, you will have to manually launch the spawner if you use a ''Remote host'' as ''Information source'' instead of a ''Local interpreter''.
    104 
    105 After doing this, we will just have to create a new rule managed by the SCGI handler to access Trac. It can be created in a new virtual server, trac.example.net for instance, and will only need two rules. The '''default''' one will use the SCGI handler associated to the previously created information source.
    106 The second rule will be there to serve the few static files needed to correctly display the Trac interface. Create it as ''Directory rule'' for ''/common'' and just set it to the ''Static files'' handler and with a ''Document root'' that points to the appropriate files: ''$TRAC_LOCAL/htdocs/'' (where $TRAC_LOCAL is a directory defined by the user or the system administrator to place local trac resources).
     103もしそのポート番号に到達できなければ、インタプリタコマンドは起動されたことになります。information source の定義において、 ''ローカルインタプリタ'' の代わりに、 ''リモートホスト'' を ''information source'' として使用するならば、 spawner を手動で起動する必要があることを覚えておいてください。
     104
     105そして、 Trac にアクセスするために SCGI ハンドラによって管理される新しいルールを作成しなければなりません。このルールは例えば、 trac.example.net という新しい仮想サーバ内で作成し、 2 つのルールのみを必要とします。 '''デフォルト''' ルールは以前に作成された information source に関する SCGI ハンドラで使用されます。
     1062 つ目のルールは Trac のインタフェースを正しく表示するために必要ないくつかの静的ファイルを扱うために設定します。ルールを ''/common'' の ''ディレクトリルール'' として作成し、 ''静的ファイル'' のハンドラを適切なファイルをポイントする ''ドキュメントルート'' と共に設定するだけです: ''$TRAC_LOCAL/htdocs/'' ($TRAC_LOCAL はユーザ又はローカル Trac リソース を置いたシステム管理者により定義されたディレクトリです)
    107107
    108108Note:\\
    109 If the tracd process fails to start up, and cherokee displays a 503 error page, you might be missing the [http://trac.saddi.com/flup python-flup] package.\\
    110 Python-flup is a dependency which provides trac with SCGI capability. You can install it on debian based systems with:
     109tracd プロセスが起動しない場合や cherokee が 503 エラーページを表示する場合、 [http://trac.saddi.com/flup python-flup] がインストールされていない可能性があります。\\
     110Python-flup は SCGI の能力を trac に与える従属関係にあります。 debian 基本システムからインストールできます:
    111111{{{
    112112sudo apt-get install python-flup
     
    114114
    115115
    116 == Simple Lighttpd Configuration ==
    117 
    118 The FastCGI front-end was developed primarily for use with alternative webservers, such as [http://www.lighttpd.net/ lighttpd].
    119 
    120 lighttpd is a secure, fast, compliant and very flexible web-server that has been optimized for high-performance
    121 environments.  It has a very low memory footprint compared to other web servers and takes care of CPU load.
    122 
    123 For using `trac.fcgi`(prior to 0.11) / fcgi_frontend.py (0.11) with lighttpd add the following to your lighttpd.conf:
     116== Lighttpd の簡単な設定 == #SimpleLighttpdConfiguration
     117
     118FastCGI フロントエンドは最初 [http://www.lighttpd.net/ lighttpd] のような、 Apache 以外の Web サーバのために開発されました。
     119
     120lighttpd はセキュアで高速で、規格に準拠したとても柔軟な Web サーバで、高いパフォーマンスの環境で最適化されます。
     121他の Web サーバに比べて CPU や、メモリの占有率がとても少ないです。
     122
     123`trac.fcgi`(0.11 以前) / fcgi_frontend.py (0.11) を lighttpd で使用するためには、 lighttpd.conf に以下の行を追加します:
    124124{{{
    125125#var.fcgi_binary="/usr/bin/python /path/to/fcgi_frontend.py" # 0.11 if installed with easy_setup, it is inside the egg directory
    126126var.fcgi_binary="/path/to/cgi-bin/trac.fcgi" # 0.10 name of prior fcgi executable
    127127fastcgi.server = ("/trac" =>
    128    
     128
    129129                   ("trac" =>
    130130                     ("socket" => "/tmp/trac-fastcgi.sock",
     
    138138}}}
    139139
    140 Note that you will need to add a new entry to `fastcgi.server` for each separate Trac instance that you wish to run. Alternatively, you may use the `TRAC_ENV_PARENT_DIR` variable instead of `TRAC_ENV` as described above,
    141 and you may set one of the two in `trac.fcgi` instead of in `lighttpd.conf`
    142 using `bin-environment` (as in the section above on Apache configuration).
    143 
    144 Note that lighttpd has a bug related to 'SCRIPT_NAME' and 'PATH_INFO' when the uri of fastcgi.server is '/' instead of '/trac' in this example (see [trac:#2418]). This should be fixed since lighttpd 1.4.23, and you may need to add `"fix-root-scriptname" => "enable"` as parameter of fastcgi.server.
    145 
    146 For using two projects with lighttpd add the following to your `lighttpd.conf`:
     140動かしたい Trac のインスタンス毎に `fastcgi.server` のエントリを追加する必要があります。別の方法として、上記の `TRAC_ENV` の代わりに `TRAC_ENV_PARENT_DIR` を使用でき、
     141`lighttpd.conf` に設定する代わりに `trac.fcgi` ファイルに
     142`bin-environment` (上記の Apache の設定 に書かれています) の2つのうちのどちらかを設定します。
     143
     144Note: lighttpd には 'SCRIPT_NAME' と 'PATH_INFO' に関するバグがあります。例として、 fastcgi.server の uri が '/trac' とするところを '/' としてしまいます。 ([trac:#2418 本家チケット 2418] 参照) このバグは lighttpd 1.4.23 以降で修正されています。 fastcgi.server のパラメータとして、 `"fix-root-scriptname" => "enable"` を追加する必要があるでしょう。
     145
     146lighttpd で2つのプロジェクトを動かすには、 `lighttpd.conf` に以下の設定を追加します:
    147147{{{
    148148fastcgi.server = ("/first" =>
     
    166166                )
    167167}}}
    168 Note that field values are different.  If you prefer setting the environment
    169 variables in the `.fcgi` scripts, then copy/rename `trac.fcgi`, e.g., to
    170 `first.fcgi` and `second.fcgi`, and reference them in the above settings.
    171 Note that the above will result in different processes in any event, even
    172 if both are running from the same `trac.fcgi` script.
     168Note: 各フィールドの値が異なることに注意して下さい。もし、
     169`.fcgi` スクリプト内の環境変数を設定する方が好ましいならば、 `trac.fcgi` スクリプトを
     170例えば、 `first.fcgi` や `second.fcgi` というようにコピー / リネームして、上記設定の中でこれらのスクリプトを参照するようにしてください。
     171両方のプロジェクトが同じ `trac.fcgi` スクリプトから起動しているとしても、
     172異なるプロセスになることに注意して下さい。
    173173
    174174{{{
    175175#!div class=important
    176 '''Note''' It's very important the order on which server.modules are loaded, if mod_auth is not loaded '''BEFORE''' mod_fastcgi, then the server will fail to authenticate the user.
    177 }}}
    178 
    179 For authentication you should enable mod_auth in lighttpd.conf 'server.modules', select auth.backend and auth rules:
     176'''Note''': server.modules をロードする順番はとても重要です。もし、 mod_auth が mod_fastcgi より '''先に''' mod_auth がロードされない設定になっていない場合、サーバはユーザ認証に失敗します。
     177}}}
     178
     179認証のために lighttpd.conf の 'server.modules' 中で mod_auth を有効にして、 auth.backend と認証方法を選択して下さい:
    180180{{{
    181181server.modules              = (
     
    215215
    216216}}}
    217 Note that lighttpd (I use version 1.4.3) stopped if password file doesn't exist.
    218 
    219 Note that lighttpd doesn't support 'valid-user' in versions prior to 1.3.16.
    220 
    221 Conditional configuration is also useful for mapping static resources, i.e. serving out images and CSS directly instead of through FastCGI:
     217Note: パスワードファイルがない場合、 lighttpd (確認したバージョンは 1.4.3) が停止するので注意して下さい。
     218
     219Note: バージョン 1.3.16 以前では lighttpd は 'valid-user' をサポートしていないので注意してください。
     220
     221条件付の設定は静的リソースをマッピングするときに便利です。例として FastCGI を経由せずに直接イメージファイルや CSS を参照するときなどです:
    222222{{{
    223223# Aliasing functionality is needed
     
    243243}
    244244}}}
    245 The technique can be easily adapted for use with multiple projects by creating aliases for each of them, and wrapping the fastcgi.server declarations inside conditional configuration blocks.
    246 Also there is another way to handle multiple projects and it's to use TRAC_ENV_PARENT_DIR instead of TRAC_ENV and use global auth, let's see an example:
     245複数のプロジェクトのそれぞれにエイリアスを作れば、複数のプロジェクトを動かすのは技術的には簡単です。 fastcgi.server を条件ブロックの中で宣言しラッピングします。
     246複数のプロジェクトをハンドルするもう一つの方法があります。 TRAC_ENV_PARENT_DIR を TRAC_ENV の代わりに使用し、グローバルの認証機構を使用します。サンプルを見てみましょう:
    247247{{{
    248248#  This is for handling multiple projects
     
    274274}}}
    275275
    276 Changing date/time format also supported by lighttpd over environment variable LC_TIME
     276lighttpd では環境変数の LC_TIME を上書きして、日付/時間のフォーマットを変更することも出来ます。
    277277{{{
    278278fastcgi.server = ("/trac" =>
     
    288288                 )
    289289}}}
    290 For details about languages specification see [trac:TracFaq TracFaq] question 2.13.
    291 
    292 Other important information like the [wiki:TracInstall#MappingStaticResources mapping static resources advices] are useful for non-fastcgi specific installation aspects.
     290使用言語指定の詳細については [http://trac.lighttpd.net/trac/wiki/TracFaq TracFaq] の 2.13 の質問を参照して下さい。
     291
     292[wiki:TracInstall#MappingStaticResources 静的なリソースのマッピングに関する事] の様な他の重要な情報は、fastcgi 以外でもインストールの詳細をつかむのに有効です。
    293293]
    294294
    295 Relaunch lighttpd, and browse to `http://yourhost.example.org/trac` to access Trac.
    296 
    297 Note about running lighttpd with reduced permissions:
    298 
    299 If nothing else helps and trac.fcgi doesn't start with lighttpd settings `server.username = "www-data"`, `server.groupname = "www-data"`, then in the `bin-environment` section set `PYTHON_EGG_CACHE` to the home directory of `www-data` or some other directory accessible to this account for writing.
    300 
    301 
    302 == Simple !LiteSpeed Configuration ==
    303 
    304 The FastCGI front-end was developed primarily for use with alternative webservers, such as [http://www.litespeedtech.com/ LiteSpeed].
    305 
    306 !LiteSpeed web server is an event-driven asynchronous Apache replacement designed from the ground-up to be secure, scalable, and operate with minimal resources. !LiteSpeed can operate directly from an Apache config file and is targeted for business-critical environments.
    307 
    308  1. Please make sure you have first have a working install of a Trac project. Test install with “tracd” first.
    309 
    310  2. Create a Virtual Host for this setup. From now on we will refer to this vhost as !TracVhost. For this tutorial we will be assuming that your trac project will be accessible via:
     295lighttpd を再起動し、ブラウザに `http://yourhost.example.org/trac` を入力して、 Trac にアクセスして下さい。
     296
     297制限された権限で lighttpd を起動するにあたって気をつけること:
     298
     299もし、 trac.fcgi が lighttpd の設定で `server.username = "www-data"` や `server.groupname = "www-data"` を設定しても起動せずどうしようもないときは、 `bin-environment` セクションの `PYTHON_EGG_CACHE` を `www-data` のホームディレクトリまたは `www-data` アカウントで書き込みが可能なディレクトリに設定して下さい。 (訳注: debian 系 Linux に限定した話だと思われます。 `www-data` は lighttpd を起動するユーザに適宜読み替えてください。)
     300
     301
     302== !LiteSpeed の簡単な設定 == #SimpleLighttpdConfiguration
     303
     304FastCGI フロントエンドは最初 [http://www.litespeedtech.com/ LiteSpeed] のような、 Apache 以外の Web サーバのために開発されました。
     305
     306!LiteSpeed Web サーバはイベント駆動、非同期型であり、 Apache に代わるものとしてセキュアで拡張可能になるようにゼロからデザインされています。そして、最低限のリソースで操作できます。 !LiteSpeed は Apache の設定ファイルから直接操作でき、ビジネスに不可欠な環境をターゲットにしています。
     307
     308 1. 最初に Trac プロジェクトをインストールして動作することを確認して下さい。最初のインストールでは、 "tracd" を使用します
     309
     310 2. このセットアップでは仮想ホストを作成します。以下、この仮想ホストのことを !TracVhost と呼びます。このチュートリアルで、先ほど作ったプロジェクトが以下の URL 経由でアクセスできると仮定します:
    311311
    312312{{{
     
    314314}}}
    315315
    316  3. Go “!TracVhost → External Apps” tab and create a new “External Application”.
    317 
    318 {{{
    319 Name: MyTracFCGI       
     316 3. "!TracVhost → External Apps" タブへ移動し、新しい "External Application" を作成します
     317
     318{{{
     319Name: MyTracFCGI
    320320Address: uds://tmp/lshttpd/mytracfcgi.sock
    321321Max Connections: 10
     
    325325Persistent Connection   Yes
    326326Connection Keepalive Timeout: 30
    327 Response Bufferring: No 
     327Response Bufferring: No
    328328Auto Start: Yes
    329329Command: /usr/share/trac/cgi-bin/trac.fcgi  <--- path to trac.fcgi
     
    332332}}}
    333333
    334  4. Optional. If you need to use htpasswd based authentication. Go to “!TracVhost → Security” tab and create a new security “Realm”.
     334 4. (非必須) htpasswd ベースの認証を使用するならば、 "!TracVhost → Security" タブへ移動し、新しいセキュリティ "Realm" を作成することができます
    335335
    336336{{{
     
    340340}}}
    341341
    342 If you don’t have a htpasswd file or don’t know how to create the entries within one, go to http://sherylcanter.com/encrypt.php, to generate the user:password combos.
    343 
    344  5. Go to “!PythonVhost → Contexts” and create a new “FCGI Context”.
    345 
    346 {{{
    347 URI: /trac/                              <--- URI path to bind to python fcgi app we created   
     342もし、 htpasswd ファイルを持っていない、もしくは作り方を知らない場合は、 http://sherylcanter.com/encrypt.php にアクセスし、ユーザ名:パスワード の一対を生成して下さい。
     343
     344 5. "!PythonVhost → Contexts" へ移動し、新しい "FCGI Context" を作成します
     345
     346{{{
     347URI: /trac/                              <--- URI path to bind to python fcgi app we created
    348348Fast CGI App: [VHost Level] MyTractFCGI  <--- select the trac fcgi extapp we just created
    349349Realm: TracUserDB                        <--- only if (4) is set. select realm created in (4)
    350350}}}
    351351
    352  6. Modify `/fullpathto/mytracproject/conf/trac.ini`
     352 6. /fullpathto/mytracproject/conf/trac.ini を修正します
    353353
    354354{{{
     
    359359}}}
    360360
    361  7. Restart !LiteSpeed, “lswsctrl restart”, and access your new Trac project at:
     361 7. !LiteSpeed を "lswsctrl restart" で再起動し、新しい Trac プロジェクトに以下の URL でアクセスします:
    362362
    363363{{{
     
    366366
    367367
    368 == Simple Nginx Configuration ==
    369 
    370 Nginx is able to communicate with FastCGI processes, but can not spawn them. So you need to start FastCGI server for Trac separately.
    371 
    372  1. Nginx configuration with basic authentication handled by Nginx - confirmed to work on 0.6.32
     368== Nginx 簡単な設定 == #SimpleNginxConfiguration
     369
     370Nginx は FastCGI プロセスを生成することはできませんが、伝達することができます。そのため、 Trac を独立して FastCGI サーバを開始する必要があります。
     371
     372 1. 基本認証を行う Nginx の設定 - 0.6.32 で動作することを確認しました
    373373{{{
    374374    server {
     
    439439}}}
    440440
    441  2. Modified trac.fcgi:
     441 2. trac.fcgi の変更:
    442442
    443443{{{
     
    451451     import trac.web._fcgi
    452452
    453      fcgiserv = trac.web._fcgi.WSGIServer(dispatch_request, 
     453     fcgiserv = trac.web._fcgi.WSGIServer(dispatch_request,
    454454          bindAddress = sockaddr, umask = 7)
    455455     fcgiserv.run()
     
    473473}}}
    474474
    475  3. reload nginx and launch trac.fcgi like that:
    476 
    477 {{{
    478 trac@trac.example ~ $ ./trac-standalone-fcgi.py 
    479 }}}
    480 
    481 The above assumes that:
    482  * There is a user named 'trac' for running trac instances and keeping trac environments in its home directory.
    483  * `/home/trac/instance` contains a trac environment
    484  * `/home/trac/htpasswd` contains authentication information
    485  * `/home/trac/run` is owned by the same group the nginx runs under
    486   * and if your system is Linux the `/home/trac/run` has setgid bit set (`chmod g+s run`)
    487   * and patch from ticket #T7239 is applied, or you'll have to fix the socket file permissions every time
    488 
    489 Unfortunately nginx does not support variable expansion in fastcgi_pass directive.
    490 Thus it is not possible to serve multiple trac instances from one server block.
    491 
    492 If you worry enough about security, run trac instances under separate users.
    493 
    494 Another way to run trac as a FCGI external application is offered in ticket #T6224
     475 3. nginx をリロードし、 trac.fcgi をこのように起動します:
     476
     477{{{
     478trac@trac.example ~ $ ./trac-standalone-fcgi.py
     479}}}
     480
     481上記設定は以下の条件だと仮定します:
     482 * trac のインスタンスを実行するためのユーザ名を 'trac' とします。ホームディレクトリに trac Environment をおきます
     483 * Trac environment は `/home/trac/instance` に配置します
     484 * `/home/trac/htpasswd` に認証情報が含まれています
     485 * `/home/trac/run` は nginx を起動しているグループが所有しています
     486  * Linux を使用しているならば、 `/home/trac/run` に (`chmod g+s run`) を設定します
     487  * [trac:#7239 本家チケット 7239] のパッチを適用し、ソケットファイルのパーミッションをそのつど修正しなければいけません
     488
     489残念ですが、 nginx は fastcgi_pass ディレクティブ内の変数展開をサポートしていません。
     490したがって、 1 つのサーバーブロックから複数の trac インスタンスを起動することができません。
     491
     492セキュリティ面で不安があるならば、 各 Trac インスタンスを別々のユーザで起動してください。
     493
     494Trac を FCGI の外部アプリケーションとして起動するもう一つの方法は、[trac:#6224 本家チケット 6224] を参照して下さい。
    495495
    496496----