Install Trac On Your Windows
阅读本文前,请参考前面两篇文章:
SVN服务器的搭建 和 ViewVC的安装
注:由于WordPress的限制,下面有些路径的反斜杠使用正斜杠代替
1. Download & Install trac-0.10.4.win32.exe
2. Download & Install pysqlite-2.3.4.win32-py2.3.exe
3. Download & Install mod_python-3.3.1.win32-py2.3-Apache2.0.exe
4. Download & Install clearsilver-0.9.14.win32-py2.3.exe
5. Download & Install setuptools-0.6c7.win32-py2.3.exe
6. 在httpd.conf中增加配置如下:
LoadModule python_module modules/mod_python.so
<Location /trac>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir c:/trac
PythonOption TracUriRoot /trac
</Location>
7. C:/>mkdir trac
8. C:/Trac>python c:/Python23/Scripts/trac-admin oa initenv
系统提示如下:
-----------------------------------------------------------------
Creating a new Trac environment at C:/Trac/oa
Trac will first ask a few questions about your environment in order to initalize and prepare the project database.Please enter the name of your project.This name will be used in page titles and descriptions.
Project Name [My Project]> OA
Please specify the connection string for the database to use. By default, a local SQLite database is created in the environment directory. It is also possible to use an already existing PostgreSQL database (check the Trac documentation for the exact connection string syntax).
Database connection string [sqlite:db/trac.db]>
Please specify the type of version control system, By default, it will be svn. If you don't want to use Trac with version control integration, choose the default here and don't specify a repository directory. in the next question.
Repository type [svn]>
Please specify the absolute path to the version control repository, or leave it blank to use Trac without a repository. You can also set the repository location later.
Path to repository [/path/to/repos]> c:/Repo/oa
Please enter location of Trac page templates. Default is the location of the site-wide templates installed with Trac.
Templates directory [C:/Python23/share/trac/templates]>
Creating and Initializing Project Installing default wiki pages
... ...
-----------------------------------------------------------------
9. 权限设置
<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "Trac"
AuthUserFile c:/Repo/passwd.txt
Require valid-user
</LocationMatch>
10. 管理
- 下载WebAdmin
WebAdmin是一个对Trac进行权限控制的插件,安装完成后可以在Trac页面中直接对权限进行控制,其下载地址为http://trac.edgewall.org/wiki/WebAdmin,页面中有许多版本,根据自己需要下载即可(Trac 0.11以后的版本会自动集成WebAdmin,只有0.11之前的版本需要手动下载安装)。
- 下载后得到一个压缩包,解压得到一个*.egg的文件夹
- 拷贝刚才解压得到的*.egg文件夹,粘贴到你所要配置的Trac目录下的plugins目录,例如
C:/Trac/oa/plugins
- 在控制台执行easy_install
C:/Python23/Scripts/easy_install.exe C:/Trac/oa/plugins/TracWebAdmin-0.1.2dev_r4240-py2.3.egg
- 在Trac.ini文件中加上以下代码:
[components] webadmin.* = enabled
- 执行Trac-Admin的Upgrade命令
C:/Trac>python c:/Python23/Scripts/trac-admin update
- 重启Apache
- 完成,在控制台中输入
C:/Trac>python c:/Python23/Scripts/trac-admin c:/Trac/oa
Welcome to trac-admin 0.10.4 Interactive Trac administration console.
Copyright (c) 2003-2006 Edgewall Software
Type: '?' or 'help' for help on commands.
Trac [c:/Trac/oa]>
即可进行管理,但这里的管理是基于命令行的
也可以:
C:/>python c:/Python23/Scripts/trac-admin c:/Trac/oa permission add charry TRAC_ADMIN
这样的话,就可以用charry这个账户登陆到web页面进行管理了,只是没有命令行的管理界面强大。