Tracインストール

モジュール一式

モジュール名コンフィグレーション
openssl-0.9.8d.tar.gz#./configure --prefix=/usr/local
autoconf-2.61.tar.gz#./configure --prefix=/usr/local
automake-1.9.6.tar.gz#./configure --prefix=/usr/local
libtool-1.5.22.tar.gz#./configure --prefix=/usr/local
db-4.5.20.tar.gz #cd build_unix
#../dist/configure
Python-2.5.tar.gz#./configure --prefix=/usr/local
httpd-2.2.3.tar.gz
./configure --prefix=/usr/local/apache223 --enable-so --enable-dav --with-berkeley-db=/usr/local/BerkeleyDB.4.5 --enable-ssl --with-ssl=/usr/local/ssl
mod_python-3.2.10.tgz
./configure --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/bin/bin/python --with-python-src=../Python-2.5
sqlite-3.3.8.tar.gz#./configure --prefix=/usr/local --disable-tcl
pysqlite-2.3.2.tar.gz#./configure --with-apache=/usr/local/apache --with-python=/usr/local/bin/python
swig-1.3.10.tar.gz#./configure --prefix=/usr/local/swing-1.3.10
subversion-1.4.2.tar.gz
subversion-deps-1.4.2.tar.gz
neon-0.26.2.tar.gz
depsモジュールはマージ、neonは入れ替えてsubversionコンパイルします
※コンフィグレーションは下記参照
trac-0.10.3-ja-1.zip#python ./setup.py install
clearsilver-0.10.4.tar.gz#./configure --prefix=/usr/local

ld.so.confの内容 
○ld.so.conf読み込みコマンド 
# /sbin/ldconfig

# more /etc/ld.so.conf
/usr/kerberos/lib
/usr/X11R6/lib
/usr/lib/qt-3.1/lib
/usr/lib
/usr/local/lib
/usr/local/BerkeleyDB.4.5/lib
/usr/local/subversion/lib
/usr/local/subersion/lib/svn
/usr/local/subversion/lib/libsvn
/usr/local/lib/python2.5/site-packages

open-sslインストール

# rpm -e opensslxxx
# rpm -qa | grep opensslxxx・・・確認

# ./config -fPIC shared --prefix=/usr/local/ssl
# make
# make test
# make install

apache コンパイル

「--with-berkeley-db」を必ず設定します
./configure --prefix=/usr/local/apache223 --enable-so --enable-dav --with-berkeley-db=/usr/local/BerkeleyDB.4.5

# ln -s /usr/local/apache223 /usr/local/apache

mod_python コンパイル

./configure --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/bin/bin/python --with-python-src=../Python-2.5
LoadModule python_module modules/mod_python.so

swigインストール

./configure --prefix=/usr/local/swig-1.3.31

subversion コンパイル

「--with-berkeley-db」を必ず設定します。
「--with-apr」、「--with-apr-util」の指定は、berkeley-db連携と同一バージョンである必要があるの、Apacheのものを
必ず参照します。
./configure --prefix=/usr/local/subversion142 \

    • with-berkeley-db=/usr/local \
    • with-swig=/usr/local/swig-1.3.31 \

PYTHON=/usr/local/bin/python \

    • enable-swig-binding=python \
    • with-apxs=/usr/local/apache/bin/apxs \
    • with-apr=/usr/local/apache \
    • with-apr-util=/usr/local/apache \
    • with-zlib \
    • enable-ssl \
    • with-ssl \
    • with-libs=/usr/lib:/usr/local/lib:/usr/local/ssl:/usr/local/ssl/lib

make && make install && make swig-py && make install-swig-py

#ln -s /usr/local/subversion142 /usr/local/subversion

/usr/local/lib/python2.5/site-packages/subversion.pthの内容

/usr/local/subversion/lib/svn-python/
/usr/local/subversion/lib/svn-python/svn/
/usr/local/subversion/lib/svn-python/libsvn/

pythonsvnのlibの参照を設定

#ln -s /usr/local/subversion/lib/svn-python/* /usr/local/lib/python2.5/site-packages

Apache-httpd.conf
httpd.conf

LoadModule python_module modules/mod_python.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

Include conf/extra/httpd-python.conf

httpd-python.conf


SetHandler mod_python
PythonHandler trac.web.modpython_frontend
# PythonHandler trac.ModPythonHander
PythonOption TracEnvParentDir /opt/trac
PythonOption TracUriRoot /proj


AuthType Basic
AuthName "test"
AuthUserFile /opt/trac/test/.htpasswd
Require valid-user

Subversion自動起動

/etc/service

svnserve 3690/tcp # Subversion
svnserve 3690/udp # Subversion

/etc/xinet.d/svnserve

service svn
{
disable = no
socket_type = stream
wait = no
user = svnuser
server = /usr/bin/svnserve
server_args = -i -r /home/svnuser/repos
log_on_failure += USERID
}

.htpasswd作成

・ファイルを作成してアカウントを追加します
htpasswd -b -c /opt/trac/test/.htpasswd fedora fedorapass
・アカウントを追加
htpasswd -b /opt/trac/test/.htpasswd fedora fedorapass

trac

python ./setup.py install

ClearSilver
これは一番最後にインストール

./configure --with-apache= --with-python=/usr/bin/bin/python
make && make install


trac初期化
tracのtestプロジェクトの作成

# trac-admin /opt/trac/test initenv

/opt/trac/test/conf/trac.ini 内容抜粋

[trac]
authz_file =
authz_module_name =
base_url =
check_auth_ip = true
database = sqlite:db/trac.db
default_charset = iso-8859-15
default_handler = WikiModule
htdocs_location =
ignore_auth_case = false
mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search
metanav = login,logout,settings,help,about
permission_store = DefaultPermissionStore
repository_dir = /var/svn
repository_type = svn

PYTHONPATHの設定

export PYTHONPATH=/usr/local/lib/python2.5:/usr/local/lib/python2.5/site-packages

トラブルシュート

結果的には apsaps-util、swigの連携を適切に行います。

(1)trac-adminで「Warning:You should install the SVN bindings」が出てるとtracのページが適切に表示できません

(2)「TracError: Unsupported version control system "svn"」とtracページに出力されます

(3)pythonからsvnのライブラリが参照できているか確認します
#python -c "import svn"
#python -c "import svn.repos"

(4)pythonのlib参照エラーの出力
Traceback (most recent call last):
File "", line 1, in
NameError: name 'svn' is not defined

(5)「TracError: ClearSilver not installed (No module named neo_cgi)」が出力したらclearsilverを再インストールします