| 4 | | Trac is written in the Python programming language and needs a database, [http://sqlite.org/ SQLite], [http://www.postgresql.org/ PostgreSQL], or [http://mysql.com/ MySQL]. For HTML rendering, Trac uses the [http://genshi.edgewall.org Genshi] templating system. |
| 5 | | |
| 6 | | Since version 0.12, Trac can also be localized, and there's probably a translation available for your language. If you want to be able to use the Trac interface in other languages, then make sure you **first** have installed the optional package [#OtherPythonPackages Babel]. Lacking Babel, you will only get the default English version, as usual. If you install Babel later on, you will need to re-install Trac. |
| 7 | | |
| 8 | | If you're interested in contributing new translations for other languages or enhance the existing translations, then please have a look at [trac:wiki:TracL10N TracL10N]. |
| 9 | | |
| 10 | | What follows are generic instructions for installing and setting up Trac and its requirements. While you may find instructions for installing Trac on specific systems at [trac:wiki:TracInstallPlatforms TracInstallPlatforms] on the main Trac site, please be sure to '''first read through these general instructions''' to get a good understanding of the tasks involved. |
| 11 | | |
| 12 | | [[PageOutline(2-3,Installation Steps,inline)]] |
| 13 | | |
| 14 | | == Dependencies == |
| 15 | | === Mandatory Dependencies |
| 16 | | To install Trac, the following software packages must be installed: |
| 17 | | |
| 18 | | * [http://www.python.org/ Python], version >= 2.4 and < 3.0 |
| 19 | | //(note that we dropped the support for Python 2.3 in this release and that this will be the last Trac release supporting Python 2.4)// |
| 20 | | * [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version >= 0.6 |
| 21 | | * [http://genshi.edgewall.org/wiki/Download Genshi], version >= 0.6 (but < 0.7dev, i.e. don't use Genshi trunk) |
| 22 | | |
| 23 | | You also need a database system and the corresponding python bindings. |
| 24 | | The database can be either SQLite, PostgreSQL or MySQL. |
| 25 | | |
| 26 | | ==== For the SQLite database #ForSQLite |
| 27 | | |
| 28 | | If you're using Python 2.5 or 2.6, you already have everything you need. |
| 29 | | |
| 30 | | If you're using Python 2.4 and need pysqlite, you can download from |
| 31 | | [http://code.google.com/p/pysqlite/downloads/list google code] the Windows installers or the tar.gz archive for building from source: |
| 32 | | {{{ |
| 33 | | $ tar xvfz <version>.tar.gz |
| 34 | | $ cd <version> |
| 35 | | $ python setup.py build_static install |
| 36 | | }}} |
| 37 | | |
| 38 | | This will extract the SQLite code and build the bindings. |
| 39 | | |
| 40 | | To install SQLite, your system may require the development headers. Without these you will get various GCC related errors when attempting to build: |
| 41 | | |
| 42 | | {{{ |
| 43 | | $ apt-get install libsqlite3-dev |
| 44 | | }}} |
| 45 | | |
| 46 | | SQLite 2.x is no longer supported, and neither is !PySqlite 1.1.x. |
| 47 | | |
| 48 | | A known bug !PySqlite versions 2.5.2-4 prohibits upgrade of trac databases |
| 49 | | from 0.11.x to 0.12. Please use versions 2.5.5 and newer or 2.5.1 and |
| 50 | | older. See [trac:#9434] for more detail. |
| 51 | | |
| 52 | | See additional information in [trac:PySqlite]. |
| 53 | | |
| 54 | | ==== For the PostgreSQL database #ForPostgreSQL |
| 55 | | |
| 56 | | You need to install the database and its Python bindings: |
| 57 | | * [http://www.postgresql.org/ PostgreSQL], version 8.0 or later |
| | 4 | Trac は Python で書かれており、データベースとして [http://sqlite.org/ SQLite], [http://postgresql.org/ PostgreSQL], [http://mysql.com/ MySQL] のどれかが必要です。 Trac は HTML レンダリングのために [http://genshi.edgewall.org Genshi] テンプレートシステムを使用します。 |
| | 5 | |
| | 6 | バージョン 0.12 以降、 Trac はローカライズされているため、自分が普段使っている言語に翻訳されているかもしれません。 Trac のインタフェースで別の言語を使用したい場合は、任意のパッケージである [#OtherPythonPackages Babel] をインストールする必要があります。[#InstallingTrac Installing Trac] セクションのローカライゼーションのサポートの手順を参照してください。 Babel がない場合、通常通り、デフォルトの英語バージョンのみ使用することができます。 |
| | 7 | |
| | 8 | 新しい言語での翻訳の作成や、すでにある言語での翻訳のエンハンスをコントリビュートした場合は [[trac:TracL10N]] を見てみてください。 (訳注: 日本語の翻訳はすでにコントリビュートされています) |
| | 9 | |
| | 10 | Trac のインストールとセットアップに対する一般的な手順と必要な条件を以下に示します。 Trac を特定のシステムにインストールする手順は Trac Project サイトの [trac:TracInstallPlatforms TracInstallPlatforms] にありますが、 '''まず最初に以下の一般的な手順を読み通して''' タスクの関係を確実に理解してください。 |
| | 11 | |
| | 12 | [[PageOutline(2-3,インストール手順,inline)]] |
| | 13 | |
| | 14 | == 依存関係 == #Dependencies |
| | 15 | === 必須の依存関係 === #MandatoryDependencies |
| | 16 | Trac をインストールするためには以下のソフトウェアパッケージがインストールされていなければなりません: |
| | 17 | |
| | 18 | * [http://www.python.org/ Python], 2.5 以上 3.0 未満 |
| | 19 | (Python 2.4 のサポートは、このリリース(訳注: 1.0)で打ち切られました) |
| | 20 | * [http://peak.telecommunity.com/DevCenter/setuptools setuptools], 0.6 以上, [http://pypi.python.org/pypi/distribute ディストリビュート] を使用してもかまいません |
| | 21 | * [http://genshi.edgewall.org/wiki/Download Genshi], 0.6 以上(リリースはされていませんが 0.7dev でも正しく動作します) |
| | 22 | |
| | 23 | また、データベースと、それに対応する Python のバインディングが必要です。 |
| | 24 | データベースは SQLite, PostgreSQL, MySQL のいずれかが使用できます。 |
| | 25 | |
| | 26 | ==== SQLite の場合 ==== #ForSQLite |
| | 27 | |
| | 28 | Python 2.5 、 2.6 、 2.7 には、SQLite データベースのライブラリがPython の標準ディストリビューションに( `sqlite3` モジュールとして)同梱されています。 |
| | 29 | |
| | 30 | もちろん、最新の [[trac:Pysqlite]] をダウンロードすることも可能です。 |
| | 31 | [http://code.google.com/p/pysqlite/downloads/list google code] から Windows インストーラやソースからビルドするための |
| | 32 | tar.gz アーカイブがダウンロードできます。 |
| | 33 | {{{ |
| | 34 | $ tar xvfz <version>.tar.gz |
| | 35 | $ cd <version> |
| | 36 | $ python setup.py build_static install |
| | 37 | }}} |
| | 38 | |
| | 39 | 上記の手順で最新の SQLite コードがダウンロードされバインディングがビルドされます。 |
| | 40 | |
| | 41 | SQLite 2.x のサポートは終了しました。 |
| | 42 | |
| | 43 | 既知のバグとして、 PySqlite バージョン 2.5.2-4 では、 Trac のデータベースを |
| | 44 | 0.11.x から 0.12. にアップグレードすることができません。 2.5.5 以降か 2.5.1 と |
| | 45 | それ以前のバージョンを使用して下さい。詳細については、 [trac:#9434 本家チケット 9434] を参照して下さい。 |
| | 46 | |
| | 47 | [trac:PySqlite PySqlite] にさらに情報があります。 |
| | 48 | |
| | 49 | ==== PostgreSQL の場合 #ForPostgreSQL |
| | 50 | |
| | 51 | 下記いずれかの データベースと、データベースに対応した Python バインディングをインストールする必要があります: |
| | 52 | * [http://www.postgresql.org/ PostgreSQL], バージョン 8.0 以降 |
| 77 | | |
| 78 | | [http://subversion.apache.org/ Subversion] 1.5.x or 1.6.x and the '''''corresponding''''' Python bindings. |
| 79 | | |
| 80 | | There are [http://subversion.apache.org/packages.html pre-compiled SWIG bindings] available for various platforms. See also the TracSubversion page for details about Windows packages. |
| 81 | | |
| 82 | | Older versions starting from 1.4.0, etc. should still work. For troubleshooting information, check the [trac:TracSubversion#Troubleshooting TracSubversion] page. Versions prior to 1.4.0 won't probably work since trac uses svn core functionality (e.g. svn_path_canonicalize) that is not implemented in the python swig wrapper in svn <= 1.3.x (although it exists in the svn lib itself). |
| 83 | | |
| 84 | | Note that Trac '''doesn't''' use [http://pysvn.tigris.org/ PySVN], neither does it work yet with the newer `ctype`-style bindings. |
| 85 | | |
| 86 | | '''Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:#493 not supported]. |
| 87 | | |
| 88 | | |
| 89 | | ===== Others ===== |
| 90 | | |
| 91 | | Support for other version control systems is provided via third-parties. See [trac:PluginList] and [trac:VersionControlSystem]. |
| 92 | | |
| 93 | | ==== Web Server ==== |
| 94 | | A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server ] section below. |
| 95 | | |
| 96 | | Alternatively you configure Trac to run in any of the following environments. |
| 97 | | * [http://httpd.apache.org/ Apache] with |
| 98 | | - [http://code.google.com/p/modwsgi/ mod_wsgi], see [wiki:TracModWSGI] (preferred) |
| 99 | | - //[http://modpython.org/ mod_python 3.3.1], see TracModPython (deprecated)// |
| 100 | | * any [http://www.fastcgi.com/ FastCGI]-capable web server, see TracFastCgi |
| 101 | | * any [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web |
| 102 | | server, see [trac:TracOnWindowsIisAjp] |
| 103 | | * IIS with [http://code.google.com/p/isapi-wsgi/ Isapi-wsgi], see [trac:TracOnWindowsIisIsapi] |
| 104 | | * //as a last resort, a CGI-capable web server (see TracCgi), but usage of Trac as a cgi script |
| 105 | | is highly discouraged, better use one of the previous options.// |
| 106 | | |
| 107 | | |
| 108 | | ==== Other Python Packages ==== |
| 109 | | |
| 110 | | * [http://babel.edgewall.org Babel], version 0.9.5, |
| 111 | | needed for localization support[[BR]] |
| 112 | | ''Note: '' If you want to be able to use the Trac interface in other languages, then make sure you first have installed the optional package Babel. Lacking Babel, you will only get the default english version, as usual. If you install Babel later on, you will need to re-install Trac. |
| 113 | | * [http://docutils.sourceforge.net/ docutils], version >= 0.3.9 |
| 114 | | for WikiRestructuredText. |
| 115 | | * [http://pygments.pocoo.org Pygments] for |
| 116 | | [wiki:TracSyntaxColoring syntax highlighting]. |
| 117 | | [http://silvercity.sourceforge.net/ SilverCity] and/or |
| 118 | | [http://gnu.org/software/enscript/enscript.html Enscript] may still be used |
| 119 | | but are deprecated and you really should be using Pygments. |
| 120 | | * [http://pytz.sf.net pytz] to get a complete list of time zones, |
| 121 | | otherwise Trac will fall back on a shorter list from |
| 122 | | an internal time zone implementation. |
| 123 | | |
| 124 | | '''Attention''': The various available versions of these dependencies are not necessarily interchangable, so please pay attention to the version numbers above. If you are having trouble getting Trac to work please double-check all the dependencies before asking for help on the [trac:MailingList] or [trac:IrcChannel]. |
| 125 | | |
| 126 | | Please refer to the documentation of these packages to find out how they are best installed. In addition, most of the [trac:TracInstallPlatforms platform-specific instructions] also describe the installation of the dependencies. Keep in mind however that the information there ''probably concern older versions of Trac than the one you're installing'' (there are even some pages that are still talking about Trac 0.8!). |
| 127 | | |
| 128 | | |
| 129 | | == Installing Trac == |
| 130 | | === Using `easy_install` |
| 131 | | One way to install Trac is using [http://pypi.python.org/pypi/setuptools setuptools]. |
| 132 | | With setuptools you can install Trac from the subversion repository; |
| 133 | | |
| 134 | | A few examples: |
| 135 | | |
| 136 | | - first install of the latest stable version Trac 0.12.3, with i18n support: |
| | 72 | * [http://subversion.apache.org/ Subversion] 1.5.x または 1.6.x と '''''対応する''''' Python バインディング。1.0 から 1.2.4 や 1.3.2 、 1.4.2 などの古いバージョンも今のところ動作します。トラブルシューティングの情報が [trac:TracSubversion#Troubleshooting TracSubversion] のページに記載されていますので、確認してください |
| | 73 | |
| | 74 | 様々なプラットフォーム向けに [http://subversion.apache.org/packages.html SWIG バインディング] が用意されています。(このリストから Windows パッケージ用のコンパイル済みの SWIG バインディングを探してください。TracSubversion には [http://alagazam.net Algazam] がよいです。私も python 2.6 の基、使用しています。) |
| | 75 | |
| | 76 | Note: Trac は [http://pysvn.tigris.org/ PySVN] のような新しい `ctype` 形式のバインディングでは '''動作しません'''。 |
| | 77 | |
| | 78 | |
| | 79 | '''重要な Note:''' Subversion を使用するなら Trac を '''同じマシン''' にインストールする必要があります。リモートリポジトリは現在 [trac:#493 サポートされていません]。 |
| | 80 | |
| | 81 | |
| | 82 | ===== その他のバージョン管理システム ===== #Others |
| | 83 | |
| | 84 | Subversion 以外のバージョン管理システムのサポートはサードパーティから提供されます。 [trac:PluginList] や [trac:VersionControlSystem] を参照して下さい。 |
| | 85 | |
| | 86 | ==== Web サーバ ==== #WebServer |
| | 87 | Trac にはサーバ機能が組み込まれているので、 Web サーバは必須ではありません。このページに下にある [#RunningtheStandaloneServer スタンドアロンサーバの起動] セクションを参照してください。 |
| | 88 | |
| | 89 | Trac は下記の環境において動作します。 |
| | 90 | * [http://httpd.apache.org/ Apache] との組み合わせで |
| | 91 | - [http://code.google.com/p/modwsgi/ mod_wsgi], [wiki:TracModWSGI] と |
| | 92 | http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac を参照 |
| | 93 | - [http://modpython.org/ mod_python 3.3.1], 非奨励 (TracModPython 参照) |
| | 94 | * [http://www.fastcgi.com/ FastCGI] 対応 Web サーバ (TracFastCgi 参照) |
| | 95 | * [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP] 対応 Web |
| | 96 | サーバ ([trac:TracOnWindowsIisAjp TracOnWindowsIisAjp] 参照) |
| | 97 | * CGI 対応 Web サーバ (TracCgi 参照)。’’’Trac を CGI スクリプトとして使用することは |
| | 98 | 全く推奨されていませんので’’’ 、上記に挙げた方法を選択して下さい |
| | 99 | |
| | 100 | |
| | 101 | ==== その他の Python パッケージ ==== #OtherPythonPackages |
| | 102 | |
| | 103 | * [http://babel.edgewall.org Babel], 0.9.5 以上 |
| | 104 | ローカライズの機能を使用する場合は必要(リリースはされていませんが 1.0dev でも正しく動作します) |
| | 105 | * [http://docutils.sourceforge.net/ docutils], 0.3.9 以上 |
| | 106 | WikiRestructuredText の機能を使用する場合は必要 |
| | 107 | * [http://pygments.pocoo.org Pygments] |
| | 108 | [wiki:TracSyntaxColoring シンタックスハイライティング] の機能を使用する場合は必要 |
| | 109 | [http://silvercity.sourceforge.net/ SilverCity] や |
| | 110 | [http://gnu.org/software/enscript/enscript.html Enscript] も、今のところ使用できますが、 |
| | 111 | サポートを打ち切る予定なので、 Pygments を使用してください |
| | 112 | * [http://pytz.sf.net pytz] , タイムゾーンの完全なリストを取得する場合に必要 |
| | 113 | pytz がない場合、 Trac は内部で定義している |
| | 114 | 短いタイムゾーンの実装にフォールバックします |
| | 115 | |
| | 116 | '''Attention''': これらの依存関係は様々なバージョンで必ずしも置き換えできるとは限らないので、上記のバージョン番号に注意してください。 Trac を動かす上で問題が発生した場合は [trac:MailingList メーリングリスト] や [trac:IrcChannel IRC チャネル] で質問をする前にすべての依存関係を再度確認してください。 |
| | 117 | |
| | 118 | これらのパッケージのドキュメンテーションを参照して、それらが最も上手にインストールできる方法を探してください。また [trac:TracInstallPlatforms プラットフォーム特有の説明] の多くに、これらの依存関係のインストール方法が記述されています。しかしながら [trac:TracInstallPlatforms プラットフォーム特有の説明] の情報はあなたがインストールしている Trac より古い バージョンについての説明があることを覚えておいてください (なんと Trac 0.8 に関する説明をしているページもあります)。 |
| | 119 | |
| | 120 | |
| | 121 | == Trac のインストール == #InstallingTrac |
| | 122 | === `easy_install` を使用したインストール ===#Usingeasy_install |
| | 123 | Trac をインストールする方法のひとつに [http://pypi.python.org/pypi/setuptools setuptools] の利用があります。 |
| | 124 | setuptools を使用すると、 Trac を Subversion リポジトリからインストールすることもできます。 |
| | 125 | |
| | 126 | 例: |
| | 127 | |
| | 128 | - Trac 1.0 をインストールします: |
| 147 | | |
| 148 | | - upgrade to the latest trunk development version: |
| 149 | | {{{ |
| 150 | | easy_install -U Trac==dev |
| 151 | | }}} |
| 152 | | |
| 153 | | For upgrades, reading the TracUpgrade page is mandatory, of course. |
| 154 | | |
| 155 | | === From source |
| 156 | | If you want more control, you can download the source in archive form, or do a checkout from one of the official [[Trac:TracRepositories|source code repositories]]. |
| 157 | | |
| 158 | | Be sure to have the prerequisites already installed. You can also obtain the Genshi and Babel source packages from http://www.edgewall.org and follow for them a similar installation procedure, or you can just `easy_install` those, see [#Usingeasy_install above]. |
| 159 | | |
| 160 | | Once you've unpacked the Trac archive or performed the checkout, move in the top-level folder and do: |
| | 137 | この場合、ローカライズに対応していないバージョンである可能性があります。 |
| | 138 | リリースされているバージョンを使用するか、ソースからインストールするようにしてください |
| | 139 | |
| | 140 | === `pip` を使用したインストール === #Usingpip |
| | 141 | 'pip' は easy_install のリプレースであり、とても簡単に素早く Python パッケージをインストールすることができます。 |
| | 142 | Trac を 5 分程度でインストール、起動できます: |
| | 143 | |
| | 144 | pip によってインストールされる場所を `/opt/user/trac` とした場合の例です: |
| | 145 | |
| | 146 | - |
| | 147 | {{{ |
| | 148 | pip -E /opt/user/trac install trac psycopg2 |
| | 149 | }}} |
| | 150 | または |
| | 151 | - |
| | 152 | {{{ |
| | 153 | pip -E /opt/user/trac install trac mysql-python |
| | 154 | }}} |
| | 155 | |
| | 156 | PostgreSQL (libpq-dev) や MySQL (libmysqlclient-dev) へのバインディングも自動でビルドできるように、 pip が OS 固有のヘッダファイルを確実に利用できるようにして下さい。 |
| | 157 | |
| | 158 | また pip は (Genshi, Pygments などの) 依存関係を解決し、 pypi.python.org から最新のパッケージをダウンロードして、 `/opt/user/trac` の配下にインストールするところまで自動化されています。 |
| | 159 | |
| | 160 | すべてのコマンド (`tracd`, `trac-admin`) は `/opt/user/trac/bin` の配下にインストールされます。 `mod_python` (`PythonHandler` ディレクティブを使用する場合) や `mod_wsgi` (`WSGIDaemonProcess` ディレクティブを使用する場合) においても活用することができます。 |
| | 161 | |
| | 162 | 加えて、 Trac プラグインのうちのいくつか ([http://pypi.python.org/pypi?:action=search&term=trac&submit=search ここ] で一覧を見ることができます) も pip からインストールすることが可能です。 |
| | 163 | |
| | 164 | |
| | 165 | |
| | 166 | === ソースからのインストール === #Fromsource |
| | 167 | もちろん、ソースディレクトリのトップに格納されている setup.py を使用してインストールすることもできます。 |
| | 168 | |
| | 169 | (Trac-1.0.tar.gz など)リリースパッケージの .tar.gz や .zip ファイル、または直接リポジトリからソースを取得することが出来ます(詳細は Trac:SubversionRepository を参照してください)。 |
| | 170 | |
| 197 | | Note: If installing on Mac OS X 10.6 running {{{ easy_install http://svn.edgewall.org/repos/trac/trunk }}} will install into {{{ /usr/local }}} and {{{ /Library/Python/2.6/site-packages }}} by default |
| 198 | | |
| 199 | | The above will place your `tracd` and `trac-admin` commands into `/usr/local/bin` and will install the Trac libraries and dependencies into `/Library/Python/2.5/site-packages`, which is Apple's preferred location for third-party Python application installations. |
| 200 | | |
| 201 | | ==== Using `pip` |
| 202 | | 'pip' is an easy_install replacement that is very useful to quickly install python packages. |
| 203 | | To get a trac installation up and running in less than 5 minutes: |
| 204 | | |
| 205 | | Assuming you want to have your entire pip installation in /opt/user/trac: |
| 206 | | |
| 207 | | - |
| 208 | | {{{ |
| 209 | | pip -E /opt/user/trac install trac psycopg2 |
| 210 | | }}} |
| 211 | | or |
| 212 | | - |
| 213 | | {{{ |
| 214 | | pip -E /opt/user/trac install trac mysql-python |
| 215 | | }}} |
| 216 | | |
| 217 | | Make sure your OS specific headers are available for pip to automatically build PostgreSQL (libpq-dev) or MySQL (libmysqlclient-dev) bindings. |
| 218 | | |
| 219 | | pip will automatically resolve all dependencies (like Genshi, pygments, etc.) and download the latest packages on pypi.python.org and create a self contained installation in /opt/user/trac . |
| 220 | | |
| 221 | | All commands (tracd, trac-admin) are available in /opt/user/trac/bin. This can also be leveraged for mod_python (using !PythonHandler directive) and mod_wsgi (using WSGIDaemonProcess directive) |
| 222 | | |
| 223 | | Additionally, you can install several trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip. |
| 224 | | |
| 225 | | |
| 226 | | |
| 227 | | == Creating a Project Environment == |
| 228 | | |
| 229 | | A [TracEnvironment Trac environment] is the backend storage where Trac stores information like wiki pages, tickets, reports, settings, etc. An environment is basically a directory that contains a human-readable [TracIni configuration file], and various other files and directories. |
| 230 | | |
| 231 | | A new environment is created using [wiki:TracAdmin trac-admin]: |
| | 205 | Note: Mac OS X 10.6 上で {{{ easy_install http://svn.edgewall.org/repos/trac/trunk }}} を使用する場合は、オプションを指定しなくても {{{ /usr/local }}} および {{{ /Library/Python/2.6/site-packages }}} にインストールされます。 |
| | 206 | |
| | 207 | 上記の例は、 `tracd` と `trac-admin` コマンドを `/usr/local/bin` に、 Trac のライブラリと依存ファイルを `/Library/Python/2.5/site-packages` にインストールします。これらのパスは Apple での Pyhton サードパーティアプリケーションの標準ロケーションです。(訳注: つまり、上記と違うパスにインストールしたい場合のみ、オプションの指定が必要になります) |
| | 208 | |
| | 209 | |
| | 210 | == プロジェクト Environment の作成 == #CreatingaProjectEnvironment |
| | 211 | |
| | 212 | [TracEnvironment Trac Environment] は Trac が Wiki ページ、チケット、レポート、設定などの情報を保存するバックエンドストレージです。基本的に人間が読み込み可能な [TracIni 構成ファイル] と他の様々なファイルやディレクトリで構成されます。 |
| | 213 | |
| | 214 | 新しい Environment は [wiki:TracAdmin trac-admin] を使用して作成します: |
| 236 | | [TracAdmin trac-admin] will prompt you for the information it needs to create the environment, such as the name of the project and the [TracEnvironment#DatabaseConnectionStrings database connection string]. If you're not sure what to specify for one of these options, just press `<Enter>` to use the default value. |
| 237 | | |
| 238 | | Using the default database connection string in particular will always work as long as you have SQLite installed. |
| 239 | | For the other [DatabaseBackend database backends] you should plan ahead and already have a database ready to use at this point. |
| 240 | | |
| 241 | | Since 0.12, Trac doesn't ask for a [TracEnvironment#SourceCodeRepository source code repository] anymore when creating an environment. Repositories can be [TracRepositoryAdmin added] afterward, or the version control support can be disabled completely if you don't need it. |
| 242 | | |
| 243 | | Also note that the values you specify here can be changed later by directly editing the [TracIni conf/trac.ini] configuration file. |
| 244 | | |
| 245 | | Finally, make sure the user account under which the web front-end runs will have '''write permissions''' to the environment directory and all the files inside. This will be the case if you run `trac-admin ... initenv` as this user. If not, you should set the correct user afterwards. For example on Linux, with the web server running as user `apache` and group `apache`, enter: |
| | 219 | [TracAdmin trac-admin] は、プロジェクトの名前や [TracEnvironment#DatabaseConnectionStrings データベース接続文字列] など、 Environment を新規作成するために必要な情報を入力するためのプロンプトを表示します。これらの設定項目について特に変更が必要ない場合は、単に `<Enter>` を押下すると、デフォルト値が使用されます。 |
| | 220 | |
| | 221 | データベース接続文字列のデフォルトは SQLite が使用されます。 SQLite がインストールされている場合は、他の設定は不要です。 |
| | 222 | 他の [trac:DatabaseBackend データベースバックエンド] を使用する場合は、あらかじめデータベースが使用可能な状態にしておかねばなりません。 |
| | 223 | |
| | 224 | 0.12 以降で Trac は、新しい Environment の作成時に [TracEnvironment#SourceCodeRepository ソースコードリポジトリ] を尋ねないようになりました。リポジトリを後で [TracRepositoryAdmin 追加する] までの間、バージョン管理のサポートは無効化されます。 |
| | 225 | |
| | 226 | また、 ここで指定した値は [TracIni conf/trac.ini] 設定ファイルを直接編集することで後から変更できます。 |
| | 227 | |
| | 228 | 最後に、 Web のフロントエンドを実行しているユーザアカウントは、 Environment のディレクトリと、その中のすべてのファイルに対する書き込み権限が必要です。 `trac-admin ... initenv` の実行を該当するユーザで実行した場合は、この作業は不要ですが、そうでない場合、ただしユーザに権限を付与する作業が必要になります。たとえば Linux で `apache` ユーザ `apache` グループで Web サーバを起動する場合は: |
| 273 | | - [wiki:TracModWSGI mod_wsgi] |
| 274 | | - //[wiki:TracModPython mod_python] (no longer recommended, as mod_python is not actively maintained anymore)// |
| 275 | | - //[wiki:TracCgi CGI] (should not be used, as the performance is far from optimal)// |
| 276 | | |
| 277 | | Trac also supports [trac:TracOnWindowsIisAjp AJP] which may be your choice if you want to connect to IIS. Other deployment scenarios are possible: [trac:TracNginxRecipe nginx], [http://projects.unbit.it/uwsgi/wiki/Example#Traconapacheinasub-uri uwsgi], [trac:TracOnWindowsIisIsapi Isapi-wsgi] etc. |
| 278 | | |
| 279 | | ==== Generating the Trac cgi-bin directory ==== #cgi-bin |
| 280 | | |
| 281 | | In order for Trac to function properly with FastCGI you need to have a `trac.fcgi` file and for mod_wsgi a `trac.wsgi` file. These are Python scripts which load the appropriate Python code. They can be generated using the `deploy` option of [wiki:TracAdmin trac-admin]. |
| 282 | | |
| 283 | | There is, however, a bit of a chicken-and-egg problem. The [wiki:TracAdmin trac-admin] command requires an existing environment to function, but complains if the deploy directory already exists. This is a problem, because environments are often stored in a subdirectory of the deploy. The solution is to do something like this: |
| | 256 | - [wiki:TracModWSGI mod_wsgi] |
| | 257 | - //[wiki:TracModPython mod_python] (mod_python は現在活発なメンテナンスが行われていないため、推奨されません)// |
| | 258 | - //[wiki:TracCgi CGI] (最適なパフォーマンスに遠く及ばないため、使用すべきではありません)// |
| | 259 | |
| | 260 | Trac では [trac:TracOnWindowsIisAjp AJP] もサポートしており、IIS と接続したい場合に選択肢の一つとなるかもしれません。その他の選択肢もあります: [trac:TracNginxRecipe nginx], [http://projects.unbit.it/uwsgi/wiki/Example#Traconapacheinasub-uri uwsgi], [trac:TracOnWindowsIisIsapi Isapi-wsgi] 等。 |
| | 261 | |
| | 262 | ==== Trac の cgi-bin ディレクトリを生成する ==== #cgi-bin |
| | 263 | |
| | 264 | Trac を FastCGI などで正しく機能させるには、 FastCGI であれば `trac.fcgi` ファイル、 mod_wsgi であれば `trac.wsgi` ファイルが必要となります。これらのファイルは適切な Python コードをロードする Python スクリプトです。 [wiki:TracAdmin trac-admin] コマンドの `deploy` オプションを使用することで生成できます。 |
| | 265 | |
| | 266 | 若干の「卵が先か鶏が先か」問題があります。 [wiki:TracAdmin trac-admin] コマンドが機能するためには Environment が必要なのですが、 deploy には既に存在するディレクトリは使用できません。これに起因して、 Environment は depoly するディレクトリのサブディレクトリを使用することができません。この制限を回避するには次のようにします: |
| 292 | | ==== Mapping Static Resources ==== |
| 293 | | |
| 294 | | Out of the box, Trac will pass static resources such as style sheets or images through itself. For anything but a tracd only based deployment, this is far from optimal as the web server could be set up to directly serve those static resources (for CGI setup, this is '''highly undesirable''' and will cause abysmal performance). |
| 295 | | |
| 296 | | Web servers such as [http://httpd.apache.org/ Apache] allow you to create “Aliases” to resources, giving them a virtual URL that doesn't necessarily reflect the layout of the servers file system. We also can map requests for static resources directly to the directory on the file system, avoiding processing these requests by Trac itself. |
| 297 | | |
| 298 | | There are two primary URL paths for static resources - `/chrome/common` and `/chrome/site`. Plugins can add their own resources, usually accessible by `/chrome/<plugin>` path, so its important to override only known paths and not try to make universal `/chrome` alias for everything. |
| 299 | | |
| 300 | | Note that in order to get those static resources on the filesystem, you need first to extract the relevant resources from Trac using the [TracAdmin trac-admin]` <environment> deploy` command: |
| | 275 | ==== 静的なリソースをマッピングする ==== #MappingStatcResources |
| | 276 | |
| | 277 | 特に設定することなく Trac はスタイルシートや画像のような静的なリソースを扱うことができます。tracd は唯一基本的な動作環境ですが、 Web サーバがそれら静的リソースを直接供給するように設定することより、はるかに最適になります。(CGI でセットアップした場合、'''極めて望ましくない''' し、著しい性能悪化の原因となります) |
| | 278 | |
| | 279 | [http://httpd.apache.org/ Apache] のような Web サーバはリソースに対して "Alias" を設定することで仮想の URL を与え、サーバのファイルシステムのレイアウトとは異なる位置にマップすることができます。また、Trac自身によるこれらの要求に対する処理を避けて、直接ファイルシステム上のディレクトリへ静的リソースに対する要求をマッピングすることができます。 |
| | 280 | |
| | 281 | 静的なリソースに対する主要な URL パスとして `/chrome/common` と `/chrome/site` があります。プラグインを使用している場合、各々の静的リソースとして `/chrome/<plugin>` のようなパスが追加されていることがありますが、主要なパスに対して追加を行えるだけなので、 `/chrome` に対して `Alias` を設定しても、プラグインが提供する静的リソースに対してアクセスできる訳ではありません。(訳注: このような場合 `trac-admin` の `deploy` で作成された `htdocs` ディレクトリに対して `Alias` を使用してください) |
| | 282 | |
| | 283 | Note: ファイルシステムにおける静的なリソースを取得するためには、最初に [TracAdmin trac-admin] の ` <environment> deploy` コマンドを使用して、 Trac 関連のリソースを拡張する必要があります。 |
| 358 | | ==== Setting up the Plugin Cache ==== |
| 359 | | |
| 360 | | Some Python plugins need to be extracted to a cache directory. By default the cache resides in the home directory of the current user. When running Trac on a Web Server as a dedicated user (which is highly recommended) who has no home directory, this might prevent the plugins from starting. To override the cache location you can set the PYTHON_EGG_CACHE environment variable. Refer to your server documentation for detailed instructions on how to set environment variables. |
| 361 | | |
| 362 | | == Configuring Authentication == |
| 363 | | |
| 364 | | Trac uses HTTP authentication. You'll need to configure your webserver to request authentication when the `.../login` URL is hit (the virtual path of the "login" button). Trac will automatically pick the REMOTE_USER variable up after you provide your credentials. Therefore, all user management goes through your web server configuration. Please consult the documentation of your web server for more info. |
| 365 | | |
| 366 | | The process of adding, removing, and configuring user accounts for authentication depends on the specific way you run Trac. |
| 367 | | |
| 368 | | Please refer to one of the following sections: |
| 369 | | * TracStandalone#UsingAuthentication if you use the standalone server, `tracd`. |
| 370 | | * [wiki:TracModWSGI#ConfiguringAuthentication TracModWSGI#ConfiguringAuthentication] if you use the Apache web server, with any of its front end: `mod_wsgi` of course, but the same instructions applies also for `mod_python`, `mod_fcgi` or `mod_fastcgi`. |
| 371 | | * TracFastCgi if you're using another web server with FCGI support (Cherokee, Lighttpd, !LiteSpeed, nginx) |
| 372 | | |
| 373 | | == Granting admin rights to the admin user |
| 374 | | Grant admin rights to user admin: |
| | 341 | ==== プラグインキャッシュの設定 ==== #SettingupthePluginCache |
| | 342 | |
| | 343 | Python プラグインの中にはキャッシュディレクトリを必要とするものがあります。デフォルトではキャッシュディレクトリは、現在のユーザのホームディレクトリに置かれます。 Trac を Web サーバで動作させている場合、ホームディレクトリを持たない専用ユーザであることが多く (強く推奨します)、プラグインの起動が妨げられることがあります。キャッシュディレクトリの場所を変更するには、環境変数 PYTHON_EGG_CACHE を設定してください。環境変数を設定する方法の詳細は使用しているサーバのドキュメントから参照してください。 |
| | 344 | |
| | 345 | == 認証の構成 == #ConfiguringAuthentication |
| | 346 | |
| | 347 | Trac は HTTP 認証を使用します。`.../login` の URL ("ログイン"(英語版では "login") ボタンの仮想パス) がリクエストされた際に、認証を要求するように Web サーバを設定する必要があります。Trac は認証情報を得た後自動的に REMOTE_USER 変数を獲得します。そのため、すべてのユーザの管理は Web サーバ の設定で行います。設定方法等の詳細な情報は、利用している Web サーバのドキュメントを参照してください。 |
| | 348 | |
| | 349 | 認証のためのユーザアカウントを追加、削除、設定する方法は Trac を起動する方法により異なります。 |
| | 350 | |
| | 351 | 以下に記すセクションを適宜参照してください: |
| | 352 | * スタンドアロンサーバ `tracd` を使用する場合は TracStandalone#UsingAuthentication |
| | 353 | * Apache Web サーバ と `mod_wsgi` に代表される `mod_python` や `mod_fcgi`, `mod_fastcgi` といったフロントエンドを使用する場合は [wiki:TracModWSGI#ConfiguringAuthentication TracModWSGI#ConfiguringAuthentication] |
| | 354 | * Apache 以外の FCGI をサポートしている Web サーバ (Cherokee, Lighttpd, !LiteSpeed, nginx) を使用する場合 TracFastCgi |
| | 355 | |
| | 356 | == admin ユーザへの管理者権限の付与 == #Grantingadminrightstotheadminuser |
| | 357 | admin ユーザに管理者権限を付与します: |