Changes between Version 3 and Version 4 of TracCgi


Ignore:
Timestamp:
Dec 30, 2016, 2:54:46 AM (7 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracCgi

    v3 v4  
    1 = CGI として Trac をインストールする = #InstallingTracasCGI
     1= Installing Trac as CGI
     2[[TracGuideToc]]
     3[[PageOutline]]
    24
    3 {{{
    4 #!div class=important
    5   ''Trac を CGI 経由で使用するのは、他の方法である [TracModPython mod_python], [TracFastCgi FastCGI] や Windows 上の [trac:TracOnWindowsIisAjp IIS/AJP] よりも極めて遅いことに注意して下さい。''
     5{{{#!div class=important
     6 ''Please note that using Trac via CGI is the slowest deployment method available. It is slower than [TracModPython mod_python], [TracFastCgi FastCGI] and even [trac:TracOnWindowsIisAjp IIS/AJP] on Windows.''
    67}}}
    78
    8 CGI スクリプトは、 Web サーバがリクエストを受信した時にアプリケーションを起動するためのエントリポイントになります。下記のスクリプトで `trac.cgi` を生成できます:
    9 {{{
    10 trac-admin /path/to/env deploy /path/to/www/trac
    11 }}}
    12 指定したパス内の `cgi-bin` フォルダに `trac.cgi` が作成されます。''`trac.cgi` が Web サーバで実行可能か確認してください''。このコマンドは指定したパスの `htdocs` ディレクトリに `静的リソース` ファイルもコピーします。
     9CGI script is the entrypoint that web-server calls when a web-request to an application is made. The `trac.cgi` script can be created using the `trac-admin <env> deploy <dir>` command which automatically substitutes the required paths, see TracInstall#cgi-bin. Make sure the script is executable by your web server.
    1310
    14 == Apache web-server 設定 == #Apacheweb-serverconfiguration
     11== Apache web-server configuration
    1512
    16 [http://httpd.apache.org/ Apache HTTPD] を使用している場合、 Trac で CGI を動作させる設定方法は 2 通りあります:
     13In [http://httpd.apache.org/ Apache] there are two ways to run Trac as CGI:
    1714
    18  1. `ScriptAlias` を使用し、 `trac.cgi` スクリプトを URL にマップする。(推奨)
    19  2. CGI プログラムが実行可能な、 Web サーバ上のディレクトリ (通常は `cgi-bin` が使用される) に `trac.cgi` ファイルをコピーする。シンボリックリンクでも代用できますが、その場合 `cgi-bin` ディレクトリでは `FollowSymLinks` オプションを有効にして下さい
     15 1. Use a `ScriptAlias` directive that maps an URL to the `trac.cgi` script (recommended)
     16 1. Copy the `trac.cgi` file into the directory for CGI executables used by your web server (commonly named `cgi-bin`). You can also create a symbolic link, but in that case make sure that the `FollowSymLinks` option is enabled for the `cgi-bin` directory.
    2017
    21 `http://yourhost.example.org/trac` で Trac を実行するには、インストールしたマシンのApache の設定ファイルに、 `trac.cgi` パスに変更した上で、`ScriptAlias` ディレクティブを追加します。
    22 {{{
     18To make Trac available at `http://yourhost.example.org/trac` add `ScriptAlias` directive to Apache configuration file, changing `trac.cgi` path to match your installation:
     19{{{#!apache
    2320ScriptAlias /trac /path/to/www/trac/cgi-bin/trac.cgi
    2421}}}
    2522
    26  ''このディレクティブを使用するには `mod_alias` モジュールを有効にしておく必要があります。''
     23 ''Note that this directive requires enabled `mod_alias` module.''
    2724
    28 Trac のプロジェクトが 1 つの場合、 `TRAC_ENV` 環境変数を使用してプロジェクトへのパスを指定する必要があります:
    29 {{{
     25If you're using Trac with a single project you need to set its location using the `TRAC_ENV` environment variable:
     26{{{#!apache
    3027<Location "/trac">
    3128  SetEnv TRAC_ENV "/path/to/projectenv"
     
    3330}}}
    3431
    35 もしくは、複数のプロジェクトを扱うために、それらの親ディレクトリを `TRAC_ENV_PARENT_DIR` を使用して設定することができます。
    36 {{{
     32Or to use multiple projects you can specify their common parent directory using the `TRAC_ENV_PARENT_DIR` variable:
     33{{{#!apache
    3734<Location "/trac">
    3835  SetEnv TRAC_ENV_PARENT_DIR "/path/to/project/parent/dir"
     
    4037}}}
    4138
    42  ''Note: `SetEnv` ディレクティブを使用するには `mod_env` モジュールをインストールし有効にしておく必要があります。 trac.cgi に TRAC_ENV を設定することで代用できます。 "try" と "from trac.web ..." の間に以下のコードを加えてください:''
     39 ''Note that the `SetEnv` directive requires enabled `mod_env` module. It is also possible to set TRAC_ENV in trac.cgi. Just add the following code between "try:" and "from trac.web ...":''
    4340
    44 {{{
     41{{{#!python
    4542    import os
    4643    os.environ['TRAC_ENV'] = "/path/to/projectenv"
    4744}}}
    4845
    49  ''もしくは、 TRAC_ENV_PARENT_DIR を設定します:''
     46 '' Or for TRAC_ENV_PARENT_DIR: ''
    5047
    51 {{{
     48{{{#!python
    5249    import os
    5350    os.environ['TRAC_ENV_PARENT_DIR'] = "/path/to/project/parent/dir"
    5451}}}
    5552
    56 [http://httpd.apache.org/docs/suexec.html Apache suEXEC] 機能を使用している場合、 [trac:ApacheSuexec ApacheSuexec] を参照して下さい。
     53If you are using the [http://httpd.apache.org/docs/suexec.html Apache suEXEC] feature please see [trac:ApacheSuexec].
    5754
    58 システムによっては、`trac.cgi` ファイルの shebang 行を編集して、実際に Python がインストールされているパスを指すように修正する必要がある ''かもしれません''。 Windows システム上では、 Windowsが .cgi ファイルを実行できるように設定する必要があるでしょう。 (エクスプローラ -> ツール -> フォルダオプション -> ファイルの種類 -> CGI を Python と関連付ける)
     55On some systems, you ''may'' need to edit the shebang line in the `trac.cgi` file to point to your real Python installation path. On a Windows system you may need to configure Windows to know how to execute a .cgi file (Explorer -> Tools -> Folder Options -> File Types -> CGI).
    5956
    60 === WSGI を使用する === #UsingWSGI
     57=== Using WSGI
    6158
    62 [http://pythonweb.org/projects/webmodules/doc/0.5.3/html_multipage/lib/example-webserver-web-wsgi-simple-cgi.html CGI] 内で [http://henry.precheur.org/python/how_to_serve_cgi WSGI ハンドラー] を実行することができます。[wiki:TracModWSGI#Thetrac.wsgiscript アプリケーション機能を作成すること] もできますし、用意されている `trac.wsgi` のアプリケーションを使用することもできます。
     59You can run a [http://henry.precheur.org/python/how_to_serve_cgi WSGI handler] [http://pythonweb.org/projects/webmodules/doc/0.5.3/html_multipage/lib/example-webserver-web-wsgi-simple-cgi.html under CGI].  You can [wiki:TracModWSGI#Thetrac.wsgiscript write your own application function], or use the deployed trac.wsgi's application.
    6360
    64 == 静的なリソースをマッピングする == #MappingStaticResources
     61== Mapping Static Resources
    6562
    66 TracInstall#MappingStaticResources を参照してください。
     63See TracInstall#MappingStaticResources.
    6764
    68 == 認証を追加する == #AddingAuthentication
     65== Adding Authentication
    6966
    70 TracInstall#ConfiguringAuthentication を参照してください。
     67See TracInstall#ConfiguringAuthentication.
    7168
    7269----