
Tracが必要になったので、インストール手順をメモしておきます。
環境- CentOS 5
- Apache 2.2.3
- Trac 0.11.2.1
- Subversion 1.4.2
- mod_python 3.2.8
手順1. yumリポジトリにdag追加「CentOS-Base.repo」ファイルに以下を追記します。
[dag]
name=Dag RPM Repository for Redhat EL4
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
2. trac、subversion、mod_pythonインストールyumからtrac、subversion、mod_pythonをインストールします。
# yum install -y trac subversion mod_python
3. subversionリポジトリ作成Trac連携をするために、プロジェクト作成前にリポジトリを作成しておきます。
# mkdir -p /path/to/sample
# svnadmin create /path/to/sample
# svn mkdir file://localhost/path/to/sample/trunk -m "create"
# svn mkdir file://localhost/path/to/sample/branches -m "create"
# svn mkdir file://localhost/path/to/sample/tags -m "create"
4. tracプロジェクト作成Tracプロジェクト用ディレクトリを作成します。
# mkdir /path/to/trac
パーミッションを変更します。
# chmod 701 /home/trac
Tracプロジェクトを作成します。
# trac-admin /home/trac/test initenv
--
Project Name [My Project]> TEST Project
Database connection string [sqlite:db/trac.db]> [ENTER]
Repository type [svn]> [ENTER]
Path to repository [/path/to/repos]> /path/to/SVNリポジトリ名
Templates directory [/usr/share/trac/templates]> [ENTER]
ディレクトリオーナー変更
# chown -R nobody.nobody /path/to/trac/
5. htpasswdファイル作成プロジェクトのユーザID・パスワードを追加します。
# htpasswd -c /path/to/trac/.htpasswd kenjiro
--
New password:
Re-type new password:
6. TRAC_ADMIN権限ユーザーを追加管理者権限をユーザに付与します。
# trac-admin /path/to/trac/test permission add kenjiro TRAC_ADMIN
7. httpd.conf修正・追記ユーザ名を変更します。
User nobody
Group nobody
virtualhostを設定します。
<VirtualHost *:80>
DocumentRoot /path/to/trac
ServerName Server IP or domain
<Location />
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /path/to/trac
PythonOption TracUriRoot /
<LimitExcept PROPFIND OPTIONS REPORT>
AuthType Basic
AuthName "TEST Project Authentication"
AuthUserFile /path/to/trac/.htpasswd
Require valid-user
</LimitExcept>
</Location>
</VirtualHost>
8. Apache再起動apacheを再起動して、 ServerNameで指定したドメインにアクセスします。
# /etc/init.d/httpd restart
とりあえず動作するレベルです。
trac.iniなどプロジェクトに応じて変更が必要になります。
プラグインなども豊富にありますので、いろいろ試してみるとおもしろいかもしれないですね。