Changes between Initial Version and Version 1 of pm/Tracメモ


Ignore:
Timestamp:
1970/01/01 09:19:22 (54 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pm/Tracメモ

    v1 v1  
     1= Tracとは? = 
     2Tracとは、オープンソースで開発されているバグトラッキングシステムです。まぁ、バグトラッキングシステムにもBuzillaをはじめ色々ありますが、Tracは次のような特徴があります。 
     3 
     4 * シンプルなユーザインタフェース 
     5 * バグ修正とSubversionのソースコードの連携 
     6 * wikiの統合によるコミュニケーション機能 
     7 * 強力なリンク機能。[34]や#123などと書くだけで、Subversionのチェンジセットやチケットへリンクを貼ることができます。 
     8 
     9Tracは、次のオープンソースプロジェクトで利用されています。 
     10 * [http://www.edgewall.com/trac/ Trac] 
     11 * [http://springide.org/project SpringIDE] 
     12 * [http://dev.rubyonrails.org/ Ruby on Rails] 
     13 * [http://www.meadowy.org/meadow/ Meadow] 
     14 * [http://www.namazu.org/trac-namazu/trac.cgi/wiki Namazu] 
     15 
     16Ruby on RailsやSpringIDEなど新鋭のプロジェクトを中心に採用が進んでおり、今最も注目のバグトラッキングシステムと言えるでしょう。 
     17 
     18 
     19=== 参考リンク === 
     20 * [http://www.i-act.co.jp/project/products/products.html trac とは(インタアクト)] 
     21 
     22インタアクトのサイトでは、tracを日本語化したtrac-jaが配布されています。また、マニュアルの日本語化も行っています。 
     23 
     24 * [http://trac-hacks.org/wiki/ Trac Hack] 
     25 
     26Tracの拡張機能、マクロなどが投稿されているサイトです。 
     27 
     28= インストール = 
     29適当に作ったパッケージがhttp://ultimania.org/debian/にあります。/etc/apt/sources.listに次の行を追加し、 
     30{{{ 
     31 deb http://ultimania.org/debian/ ./ 
     32 deb http://www.backports.org/debian/ sarge-backports main contrib 
     33}}} 
     34apt-getでインストールしてください。 
     35{{{ 
     36 # apt-get install trac python2.3-japanese-codecs 
     37}}} 
     38ここでは、Subversionのリポジトリで日本語を扱うために、python2.3-japanese-codecsをインストールしておきます。 
     39 
     40 
     41== 依存関係でインストールできない場合 == 
     42下記のパッケージも一緒にインストールしてみるとよい。 
     43 * python2.3-subversion 
     44 * python2.3-sqlite 
     45 * python2.3-clearsilver 
     46 
     47= セットアップ = 
     48Tracを利用するには、SubversionのリポジトリとTracのデータベースを生成します。 
     49=== Subversionのディレクトリの作成  === 
     50{{{ 
     51 # svnadmin create /tmp/svn 
     52}}} 
     53=== Tracのプロジェクトの作成  === 
     54{{{ 
     55 # rm -rf /tmp/trac 
     56 # trac-admin /tmp/trac initenv 
     57 Creating a new Trac environment at /tmp/trac 
     58   
     59 Trac will first ask a few questions about your environment 
     60 in order to initalize and prepare the project database. 
     61    
     62 Please enter the name of your project.  
     63 This name will be used in page titles and descriptions.  
     64   
     65 Project Name [My Project]> Project Ultimania          ☆プロジェクト名 
     66   
     67  Please specify the connection string for the database to use.  
     68  By default, a local SQLite database is created in the environment  
     69  directory. It is also possible to use an already existing  
     70  PostgreSQL database (check the Trac documentation for the exact  
     71  connection string syntax).  
     72   
     73 Database connection string [sqlite:db/trac.db]>  
     74   
     75  Please specify the absolute path to the project Subversion repository.  
     76  Repository must be local, and trac-admin requires read+write  
     77  permission to initialize the Trac database.  
     78   
     79 Path to repository [/var/svn/test]> /tmp/svn           ☆Subversionのリポジトリのパス 
     80   
     81  Please enter location of Trac page templates.  
     82  Default is the location of the site-wide templates installed with Trac.  
     83   
     84 Templates directory [/usr/share/trac/templates]>  
     85   
     86 Creating and Initializing Project  
     87  Configuring Project  
     88   trac.repository_dir  
     89   ... 
     90}}} 
     91次のようにやってもok。 
     92{{{ 
     93 # trac-admin /tmp/trac initenv "Project Name" sqlite:db/trac.db /tmp/svn /usr/share/trac/templates 
     94}}} 
     95=== Tracの簡易起動 === 
     96{{{ 
     97 # tracd -p 8081 /tmp/trac 
     98}}} 
     99これで、tracdを起動したホストの8081ポートへブラウザでアクセスすると、Tracを利用することができます。 
     100 
     101=== PostgreSQLの利用 === 
     102PythonからPostgreSQLを利用するpsycopg(Debianの場合python2.3-psycopgパッケージ)をインストールし、 
     103 
     104conf/trac.iniファイルのdatabaseプロパティを下記のように設定する。 
     105{{{ 
     106 database = postgres://<ユーザ名>:<パスワード>@localhost/<データベース名> 
     107}}} 
     108例えば、次のように記述 
     109{{{ 
     110 database = postgres://trac:tracpass@localhost/trac 
     111}}} 
     112データベースはもちろん作成しておくこと。 
     113 
     114= Webから利用 = 
     115== CGI == 
     116Tracは簡易Webサーバが入っているとはいえ、ふつーはApacheを使います。Apacheで利用するには、設定ファイルに次のように記述します。 
     117{{{ 
     118 <LocationMatch "/[[:alnum:]]+/login"> 
     119      AuthType Basic 
     120      AuthName "Trac Authentication" 
     121      AuthUserFile /home/trac/.htpasswd 
     122      Require valid-user 
     123 </LocationMatch> 
     124  
     125 ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi 
     126 <Location "/trac"> 
     127    SetEnv TRAC_ENV "/tmp/trac" 
     128 </Location> 
     129ついでに、SVNのリポジトリの設定も記述 
     130 <Location /svn> 
     131    DAV svn 
     132    SVNPath /tmp/svn 
     133 </Location> 
     134}}} 
     135== mod_python == 
     136cgiを使うと劇重だが、mod-pythonを使うとかなり早くなる。mod-pythonのインストールは、次の通り。 
     137{{{ 
     138 # apt-get install libapache2-mod-python2.3 
     139}}} 
     140Apacheの設定は、上記の設定を次のように変更する。 
     141{{{ 
     142 ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi 
     143 <Location "/trac"> 
     144 #  SetEnv TRAC_ENV "/tmp/trac" 
     145    SetHandler mod_python 
     146    PythonHandler trac.web.modpython_frontend 
     147    PythonOption TracEnv /tmp/trac 
     148    PythonOption TracUriRoot /trac 
     149 </Location> 
     150}}} 
     151== FastCGI == 
     152FastCGIは、アプリケーションプロセスをWebサーバと別に実行しておき、Webサーバとアプリケーションプロセスで通信する仕組みである。この方法もmod_pythonと同様に高速化できるが、より汎用的に作られている。 
     153mod_fastcgiとmod_fcgidの2種類がある。mod_fcgidの方が新しく安定しているようなので、mod_fcgidを利用することをお勧めする。 
     154=== mod_fcgid  === 
     155{{{ 
     156 # apt-get install libapache2-mod-fcgid 
     157 # a2enmod fcgid 
     158/etc/apache2/mod-enabled/fcgid.conf 
     159 <IfModule mod_fcgid.c> 
     160 # TRAC_ENVもしくはTRAC_ENV_PARENT_DIRを設定 
     161   DefaultInitEnv TRAC_ENV /home/trac/test 
     162 #  DefaultInitEnv TRAC_ENV_PARENT_DIR /home/trac 
     163   AddHandler fcgid-script .fcgi 
     164   SocketPath /var/lib/apache2/fcgid/sock 
     165 </IfModule> 
     166DefaultInit 
     167/etc/apache2/site-enabled/xxx  
     168 ScriptAlias /trac /usr/share/trac/cgi-bin/trac.fcgi 
     169 <Location "/trac"> 
     170 </Location> 
     171}}} 
     172=== mod_fastcgi === 
     173{{{ 
     174 FastCgiConfig -initial-env TRAC_ENV=/tmp/trac 
     175 ScriptAlias /trac /usr/share/trac/cgi-bin/trac.fcgi 
     176 <Location "/trac"> 
     177 </Location> 
     178}}}