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:~$ 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:~$ htdigest -c /bvcomsvn/tracs/web2.0/passwd.digest localhost border
border@ubuntu:~$ htdigest /bvcomsvn/tracs/web2.0/passwd.digest localhost bvcom
border@ubuntu:~$ trac-admin /bvcomsvn/tracs/web2.0/ permission add admin TRAC_ADMIN
border@ubuntu:~$ trac-admin /bvcomsvn/tracs/web2.0/ permission add developer TICKET_ADMIN
border@ubuntu:~$ trac-admin /bvcomsvn/tracs/web2.0/ permission add border admin
border@ubuntu:~$ trac-admin /bvcomsvn/tracs/web2.0/ permission add bvcom developer
border@ubuntu:~$ trac-admin /bvcomsvn/tracs/web2.0/ permission remove anonymous TICKET_CREATE
border@ubuntu:~$ trac-admin /bvcomsvn/tracs/web2.0/ permission remove anonymous TICKET_MODIFY
运行Trac:
没有用户验证:
tracd -p 8000 /bvcomsvn/trac/
有用户验证:
border@ubuntu:~$ tracd -p 8000 --auth=web2.0,/bvcomsvn/tracs/web2.0/passwd.digest,localhost /bvcomsvn/tracs/web2.0/
trac-digest.py脚本:
#!/usr/bin/python
# -*- mode: utf8-unix -*-
from optparse import OptionParser
# The md5 module is deprecated in Python 2.5
try:
from hashlib import md5
except ImportError:
from md5 import md5
realm = 'trac'
# 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")
parser.add_option("-r", "--realm",action="store", dest="realm", type = "string",
help="the realm in which to create the digest")
(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")
if (options.realm is not None):
realm = options.realm
# Generate the string to enter into the htdigest file
kd = lambda x: md5(':'.join(x)).hexdigest()
print ':'.join((options.username, realm, kd([options.username, realm, options.password])))
- 参考:
-
–EOF–







Recent Comments