TracCgi のバージョン 1 とバージョン 2 との変更
- 日時:
- 2015/05/27 0:24:03 (11年前)
凡例:
- 変更なし
- 追加
- 削除
- 更新
-
TracCgi
v1 v2 1 = Installing Trac as CGI =1 = CGI として Trac をインストールする = #InstallingTracasCGI 2 2 3 3 {{{ 4 4 #!div class=important 5 '' 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.''5 ''Trac を CGI 経由で使用するのは、他の方法である [TracModPython mod_python], [TracFastCgi FastCGI] や Windows 上の [trac:TracOnWindowsIisAjp IIS/AJP] よりも極めて遅いことに注意して下さい。'' 6 6 }}} 7 7 8 CGI script is the entrypoint that web-server calls when a web-request to an application is made. To generate the `trac.cgi` script run:8 CGI スクリプトは、 Web サーバがリクエストを受信した時にアプリケーションを起動するためのエントリポイントになります。下記のスクリプトで `trac.cgi` を生成できます: 9 9 {{{ 10 10 trac-admin /path/to/env deploy /path/to/www/trac 11 11 }}} 12 `trac.cgi` will be in the `cgi-bin` folder inside the given path. ''Make sure it is executable by your web server''. This command also copies `static resource` files to a `htdocs` directory of a given destination. 12 指定したパス内の `cgi-bin` フォルダに `trac.cgi` が作成されます。''`trac.cgi` が Web サーバで実行可能か確認してください''。このコマンドは指定したパスの `htdocs` ディレクトリに `静的リソース` ファイルもコピーします。 13 13 14 == Apache web-server configuration ==14 == Apache web-server 設定 == #Apacheweb-serverconfiguration 15 15 16 In [http://httpd.apache.org/ Apache] there are two ways to run Trac as CGI:16 [http://httpd.apache.org/ Apache HTTPD] を使用している場合、 Trac で CGI を動作させる設定方法は 2 通りあります: 17 17 18 1. Use a `ScriptAlias` directive that maps an URL to the `trac.cgi` script (recommended)19 2. C opy 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.18 1. `ScriptAlias` を使用し、 `trac.cgi` スクリプトを URL にマップする。(推奨) 19 2. CGI プログラムが実行可能な、 Web サーバ上のディレクトリ (通常は `cgi-bin` が使用される) に `trac.cgi` ファイルをコピーする。シンボリックリンクでも代用できますが、その場合 `cgi-bin` ディレクトリでは `FollowSymLinks` オプションを有効にして下さい 20 20 21 To make Trac available at `http://yourhost.example.org/trac` add `ScriptAlias` directive to Apache configuration file, changing `trac.cgi` path to match your installation: 21 `http://yourhost.example.org/trac` で Trac を実行するには、インストールしたマシンのApache の設定ファイルに、 `trac.cgi` パスに変更した上で、`ScriptAlias` ディレクティブを追加します。 22 22 {{{ 23 23 ScriptAlias /trac /path/to/www/trac/cgi-bin/trac.cgi 24 24 }}} 25 25 26 '' Note that this directive requires enabled `mod_alias` module.''26 ''このディレクティブを使用するには `mod_alias` モジュールを有効にしておく必要があります。'' 27 27 28 If you're using Trac with a single project you need to set its location using the `TRAC_ENV` environment variable:28 Trac のプロジェクトが 1 つの場合、 `TRAC_ENV` 環境変数を使用してプロジェクトへのパスを指定する必要があります: 29 29 {{{ 30 30 <Location "/trac"> … … 33 33 }}} 34 34 35 Or to use multiple projects you can specify their common parent directory using the `TRAC_ENV_PARENT_DIR` variable: 35 もしくは、複数のプロジェクトを扱うために、それらの親ディレクトリを `TRAC_ENV_PARENT_DIR` を使用して設定することができます。 36 36 {{{ 37 37 <Location "/trac"> … … 40 40 }}} 41 41 42 ''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 ...":''42 ''Note: `SetEnv` ディレクティブを使用するには `mod_env` モジュールをインストールし有効にしておく必要があります。 trac.cgi に TRAC_ENV を設定することで代用できます。 "try" と "from trac.web ..." の間に以下のコードを加えてください:'' 43 43 44 44 {{{ … … 47 47 }}} 48 48 49 '' Or for TRAC_ENV_PARENT_DIR:''49 ''もしくは、 TRAC_ENV_PARENT_DIR を設定します:'' 50 50 51 51 {{{ … … 54 54 }}} 55 55 56 If you are using the [http://httpd.apache.org/docs/suexec.html Apache suEXEC] feature please see [http://trac.edgewall.org/wiki/ApacheSuexec]. 56 [http://httpd.apache.org/docs/suexec.html Apache suEXEC] 機能を使用している場合、 [trac:ApacheSuexec ApacheSuexec] を参照して下さい。 57 57 58 On 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). 58 システムによっては、`trac.cgi` ファイルの shebang 行を編集して、実際に Python がインストールされているパスを指すように修正する必要がある ''かもしれません''。 Windows システム上では、 Windowsが .cgi ファイルを実行できるように設定する必要があるでしょう。 (エクスプローラ -> ツール -> フォルダオプション -> ファイルの種類 -> CGI を Python と関連付ける) 59 59 60 === Using WSGI ===60 === WSGI を使用する === #UsingWSGI 61 61 62 You 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. 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` のアプリケーションを使用することもできます。 63 63 64 == Mapping Static Resources ==64 == 静的なリソースをマッピングする == #MappingStaticResources 65 65 66 See TracInstall#MappingStaticResources. 66 TracInstall#MappingStaticResources を参照してください。 67 67 68 == Adding Authentication ==68 == 認証を追加する == #AddingAuthentication 69 69 70 See TracInstall#ConfiguringAuthentication. 70 TracInstall#ConfiguringAuthentication を参照してください。 71 71 72 72 ----
![(please configure the [header_logo] section in trac.ini)](/python/trac/mypz/chrome/common/trac_logo_mini.png)