Mon 28 Apr 2008

Install Trac and svn on ubuntu

Install Python2.5:

border@ubuntu:/bvcomsvn/svnrepos$ sudo apt-get install python

Install Apache(如果没有必要可以不用安装):

border@ubuntu:/bvcomsvn/svnrepos$ sudo apt-get install apache2
border@ubuntu:/bvcomsvn/tracs/web2.0$ sudo apt-get install libapache2-mod-python

Install Genshi:

border@ubuntu:~/tools$ wget http://ftp.edgewall.com/pub/genshi/Genshi-0.5.1.tar.gz
border@ubuntu:~/tools$ tar xfv Genshi-0.5.1.tar.gz
border@ubuntu:~/tools$ cd Genshi-0.5.1/
border@ubuntu:~/tools/Genshi-0.5.1$ sudo python setup.py install

Install Easy Install:

border@ubuntu:~/tools$ wget http://peak.telecommunity.com/dist/ez_setup.py
border@ubuntu:~/tools$ sudo python ez_setup.py

Install Trac:

border@ubuntu:~/tools$ svn checkout http://svn.edgewall.org/repos/trac/trunk trac
border@ubuntu:~/tools$ cd trac/
border@ubuntu:~/tools/trac$ sudo python setup.py install

Trac 和 Subversion 数据同步(http://trac.edgewall.org/wiki/TracSubversion):

border@ubuntu:/bvcomsvn/trac$ sudo apt-get install python-subversion

The Trac Environment ( http://trac.edgewall.org/wiki/TracEnvironment ):

border@ubuntu:/bvcomsvn$ trac-admin /bvcomsvn/trac/web2.0 initenv

设置用户权限:

linux 中使用 htdigest 创建用户,Windows 中使用 trac-digest.py(如果你没有安装Apache你可以自己创建
        trac-digest.py脚本来增加用户,参考: http://trac.edgewall.org/wiki/TracStandalone )

border@ubuntu:/bvcomsvn/tracs/web2.0$ htdigest -c /bvcomsvn/tracs/web2.0/passwd.digest localhost border
border@ubuntu:/bvcomsvn/tracs/web2.0$ htdigest /bvcomsvn/tracs/web2.0/passwd.digest localhost bvcom

border@ubuntu:/bvcomsvn/tracs/web2.0$ trac-admin /bvcomsvn/tracs/web2.0/ permission add admin TRAC_ADMIN
border@ubuntu:/bvcomsvn/tracs/web2.0$ trac-admin /bvcomsvn/tracs/web2.0/ permission add developer TICKET_ADMIN

border@ubuntu:/bvcomsvn/tracs/web2.0$ trac-admin /bvcomsvn/tracs/web2.0/ permission add border admin
border@ubuntu:/bvcomsvn/tracs/web2.0$ trac-admin /bvcomsvn/tracs/web2.0/ permission add bvcom developer

border@ubuntu:/bvcomsvn/tracs/web2.0$ trac-admin /bvcomsvn/tracs/web2.0/ permission remove anonymous TICKET_CREATE
border@ubuntu:/bvcomsvn/tracs/web2.0$ trac-admin /bvcomsvn/tracs/web2.0/ permission remove anonymous TICKET_MODIFY

运行Trac:

没有用户验证:
tracd -p 8000 /bvcomsvn/trac/
有用户验证:
border@ubuntu:/bvcomsvn/tracs/web2.0$ tracd -p 8000 --auth=web2.0,/bvcomsvn/tracs/web2.0/passwd.digest,localhost /bvcomsvn/tracs/web2.0/

trac-digest.py脚本:

from optparse import OptionParser
import md5

# build the options
usage = "usage: %prog [options]"
parser = OptionParser(usage=usage)
parser.add_option("-u", "--username",action="store", dest="username", type = "string",
                  help="the username for whom to generate a password")
parser.add_option("-p", "--password",action="store", dest="password", type = "string",
                  help="the password to use")
(options, args) = parser.parse_args()

# check options
if (options.username is None) or (options.password is None):
   parser.error("You must supply both the username and password")

# Generate the string to enter into the htdigest file
realm = 'trac'
kd = lambda x: md5.md5(':'.join(x)).hexdigest()
print ':'.join((options.username, realm, kd([options.username, realm, options.password])))
参考:

--EOF--

链接:

Tags: ubuntu, Trac, svn

进来Spamer太多,暂时关闭留言,如果有什么问题可以邮件联系。
borderj # gmail.com (Gtalk)
http://www.b0rder.com