install trac on Ubuntu

apt-get

sudo -s
apt-get install subversion
apt-get install trac

create trac

mkdir -p ~/trac/eto
cd ~/trac/eto
trac-admin . initenv
Project Name [My Project]> etoeto
Database connection string [sqlite:db/trac.db]>
Repository type [svn]>
Path to repository [/path/to/repos]> /home/eto/repos/eto
Templates directory [/usr/share/trac/templates]> 

configure

cd ~/trac/eto/conf
emacs -nw trac.ini
--- ./conf/trac.ini.org 2009-01-29 23:32:46.000000000 +0900
+++ ./conf/trac.ini     2009-01-30 00:29:47.000000000 +0900
@@ -20 +20 @@
-link = http://example.org/
+link = http://a2.eto.com:8000/
@@ -60 +60 @@
-descr = My example project
+descr = Eto personal
@@ -64 +64 @@
-url = http://example.org/
+url = http://a2.eto.com:8000/
@@ -86 +86 @@
-base_url = 
+base_url = http://a2.eto.com:8000/
@@ -89 +89 @@
-default_charset = iso-8859-15
+default_charset = cp93

start tracd

tracd --port 8000 /home/eto/trac/eto

アクセス管理

cd ~/trac/eto
trac-admin . permission remove anonymous BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW MILESTONE_VIEW REPORT_SQL_VIEW REPORT_VIEW ROADMAP_VIEW SEARCH_VIEW TICKET_CREATE TICKET_MODIFY TICKET_VIEW TIMELINE_VIEW WIKI_CREATE WIKI_MODIFY WIKI_VIEW
trac-admin . permission add authenticated BROWSER_VIEW CHANGESET_VIEW CONFIG_VIEW FILE_VIEW LOG_VIEW MILESTONE_ADMIN MILESTONE_CREATE MILESTONE_DELETE MILESTONE_MODIFY MILESTONE_VIEW REPORT_ADMIN REPORT_CREATE REPORT_DELETE REPORT_MODIFY REPORT_SQL_VIEW REPORT_VIEW ROADMAP_ADMIN ROADMAP_VIEW SEARCH_VIEW TICKET_ADMIN TICKET_APPEND TICKET_CHGPROP TICKET_CREATE TICKET_MODIFY TICKET_VIEW TIMELINE_VIEW TRAC_ADMIN WIKI_ADMIN WIKI_CREATE WIKI_DELETE WIKI_MODIFY WIKI_VIEW
trac-admin . permission list ←確認

ユーザ登録

cd ~/trac/eto/conf
touch users.htdigest
htdigest users.htdigest etolab eto

/etc/init.d/trac

#!/bin/bash
#
# tracd				 Startup script for Tracd
#
# chkconfig: - 86 14
# description: Tracd

LANG=C
export LANG

PYTHON=/usr/bin/python
TRACD=/usr/bin/tracd
#PORT=10080
PORT=8000
OPTION='--pidfile=/var/run/tracd.pid --auth eto,/home/eto/trac/eto/conf/users.htdigest,etolab /home/eto/trac/eto'

case "$1" in
'restart')
				$0 stop
				/usr/bin/sleep 1
				$0 start
				;;

'start')
				$PYTHON $TRACD --daemonize --port $PORT $OPTION
				;;

'stop')
				PS=`/bin/ps auxww | /bin/grep tracd | /usr/bin/awk '/daemonize/{print $2}'`
				if [ "$PSx" != "x" ]; then
								/bin/kill $PS
				fi
				;;

*)
				echo "Usage: $0 { start | stop | restart }"
				exit 1
				;;
esac
/etc/init.d/trac start

メッセージの日本語化

apt-get install trac-ja-resource

として,

Templates directory [/usr/share/trac/templates]> /usr/share/trac-ja-resource/templates

とすると,メッセージが日本語化する.しかし,リポジトリ内の表示をSJISに したいとすると破綻するので,あえてメッセージは日本語にしないままとした.

trac.ini default charset

Last modified: 2009-01-30