Trac - 課題トラッキングシステムのインストール
ソフトウェア開発・システム開発において、開発の終盤でのデバッグや調整は納期管理や品質管理上、非常に重要なプロセスになる。またそれらが納品されて稼動した後でも機能の整合性の評価やクライアントからの追加機能の要望に対応するためにも課題管理システムは重要な役割を果たしていく。オープンソースの課題管理システムと言えばやはり「Trac」。WEBベーの開発コラボレーションにとても適している。
そのインストールの概要は以下の通り。
準備作業
CentOS標準のPython 2.4.xを使用
Mod_Pythonをインストール
# yum install mod_python
RPMで、setuptoolsをインストール
# yum install python-setuptools
パーサーとなるGenshiをeasy_installでインストール
$ sudo easy_install Genshi
ライブラリのパスを通す。
include ld.so.conf.d/*.conf を編集してpostgreSQLのライブラリのパスを追加する。
/usr/lib
/usr/lib64
/usr/local/lib
/usr/local/pgsql/lib/
保存後次のコマンドを実行
# ldconfig
PostgreSQLを使用するのでそのモジュールを独自にコンパイルしてインストール
pyPgSQL-2.5.1 http://pypgsql.sourceforge.net/
psycopg2-2.0.9 http://initd.org/pub/software/psycopg/psycopg2-2.0.10.tar.gz
PosgreSQL関連の準備
postgresのユーザー権限となる
# su postgres
Trac用ユーザ作成
$ createuser -S -D -R (Trac用ユーザー名) ex. $ createuser -S -D -R tracuser
Tracプロジェクト用DB作成
$ createdb -O(Trac用ユーザー名) (Trac用DB名称) ex. $ createdb -O tracuser tracdb
Tracのインストール
Tracをダウンロード
http://trac.edgewall.org/
解凍したら次のコマンドでインストール
$ python setup.py build $ sudo python setup.py install
インストールが終わったら、課題管理のプロジェクトを作る。
プロジェクトを作る
この例では、/home/xxx/(ディレクトリ名)に、Trac サイトを設けるものとする。
以下のコマンドを実行する。
$ trac-admin /home/xxx/(ディレクトリ名) initenv
次のようにセットアップが進んでいく。
Creating a new Trac environment at /home/ricerco/trac/sobunsha Trac will first ask a few questions about your environment in order to initialize and prepare the project database. Please enter the name of your project. This name will be used in page titles and descriptions. Project Name [My Project]> (プロジェクト名 例:trac-project) Please specify the connection string for the database to use. By default, a local SQLite database is created in the environment directory. It is also possible to use an already existing PostgreSQL database (check the Trac documentation for the exact connection string syntax). Database connection string [sqlite:db/trac.db]> postgres://(DBユーザー名)@localhost/(DB名称) Please specify the type of version control system, By default, it will be svn. If you don't want to use Trac with version control integration, choose the default here and don't specify a repository directory. in the next question. Repository type [svn]>(※後でも設定可能なので空欄) Please specify the absolute path to the version control repository, or leave it blank to use Trac without a repository. You can also set the repository location later. Path to repository [/path/to/repos]>(※後でも設定可能なので空欄) Creating and Initializing Project (途中略) --------------------------------------------------------------------- Project environment for 'trac_sobunsha' created. You may now configure the environment by editing the file: /home/xxxx/trac/ディレクトリ名/conf/trac.ini If you'd like to take this new project environment for a test drive, try running the Trac standalone web server `tracd`: tracd --port 8000 home/xxxx/trac/(ディレクトリ名) Then point your browser to http://localhost:8000/(ディレクトリ名) There you can also browse the documentation for your installed version of Trac, including information on further setup (such as deploying Trac to a real web server). The latest documentation can also always be found on the project website: http://trac.edgewall.org/ Congratulations!
$tracd --port 8000 /home/xxx/(ディレクトリ名)
ブラウザで、「http://(サーバーIP):8000/(ディレクトリ名)」に接続してTracのサイトが表示されることを確認する。
Tracサイトにログインするためのパスワードを作る
パスワードの保存先を下記とした場合。
/home/xxx/(ディレクトリ名)/conf/trac-passwd
一人目の登録時にパスワードファイルを生成する
htpasswd -c -b /home/xxx/(ディレクトリ名)/conf/trac-passwd (アカウント名)(パスワード)
二人目からは追加するのみ
htpasswd -b /home/xxx/(ディレクトリ名)/conf/trac-passwd (アカウント名)(パスワード)
Trac用にVirtualHostを設定する
以下のようにVirtualHostを設定していく。
<VirtualHost *:80> # ServerName trac.example.com ServerAdmin support@example.com DocumentRoot "/home/xxx/(ディレクトリ名)" <Location /> SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnv /home/xxx/(ディレクトリ名) PythonOption TracUriRoot / </Location> <Location /login> AuthType Basic AuthName "Trac server" AuthUserFile /home/xxx/(ディレクトリ名)/conf/trac-passwd Require valid-user </Location> </VirtualHost>
Apacheを再起動する。
# service httpd restart
Tracサイト管理者の指定
ログインアカウントを設けたユーザーから管理者を次のコマンドで指定する。
#trac-admin /home/ricerco/trac/seishinkai-net/ permission add (ユーザ名) TRAC_ADMIN
trac.iniに以下を追加
[components] webadmin.* = enabled acct_mgr.* = enabled iniadmin.* = enabled
以上
前: firewall-setting

