windows 下安装 trac

windows 下安装 trac

------
参考:

http://how-to-solutions.com/how-to-install-trac-on-windows.html
http://luchar.iteye.com/blog/151051

------
基本 安装 步骤:

* 安装 python2.6.6
* 安装 Genshi-0.6.win32.exe
* 安装 svn1.6.2
* 安装 py26-pysvn-svn1612-1.7.4-1321.exe
* 安装 pysqlite-2.6.0.win32-py2.6.exe
* 安装 Trac-0.12.1.win32.exe
* 下载 ez_setup.py
      http://peak.telecommunity.com/dist/ez_setup.py
* 将 ez_setup.py 放到 python_home/Scripts/ 目录下,
* 安装 Account Manager Plugin
      在 python_home/Scripts/ 目录下,
      输入:
            easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk
      回车,
      则安装 该插件,
* 执行 ez_setup.py
      cmd 进入 python_home/Scripts/ 目录,
      输入 ez_setup.py ,回车,

------
创建 trac 项目

步骤:
* 创建 trac 项目
      cmd 进入 python_home/Scripts/ 目录,
      输入 trac-admin E:\workplace\trac_workplace\hello initenv , 回车,则在该目录创建trac项目,
      提示输入项目名称,则输入1个名称,然后回车,
      提示输入数据库连接,直接回车即可,
* 配置 trac
      进入 前面创建的 trac 项目根目录,如:E:\workplace\trac_workplace,记为 trac_proj_home,
      进入 trac_proj_home/conf,打开 trac.ini,在 [header_logo] 上面,加入如下内容:
            [components]
            acct_mgr.admin.accountmanageradminpage = enabled
            acct_mgr.api.accountmanager = enabled
            acct_mgr.db.sessionstore = enabled
            acct_mgr.htfile.htdigeststore = enabled
            acct_mgr.pwhash.htdigesthashmethod = enabled
            acct_mgr.web_ui.accountmodule = enabled
            acct_mgr.web_ui.loginmodule = enabled
            acct_mgr.web_ui.registrationmodule = enabled
            trac.web.auth.loginmodule = disabled
     
      进入 trac_proj_home/conf/ 目录,新建 passwd 文件,内容为空,
     
* 开启匿名用户 的 权限
      进入 python_home/Scripts/ 目录下,
      输入:
            trac-admin trac_proj_home permission add anonymous TRAC_ADMIN
      回车,
* 启动 trac
      进入 python_home/Scripts/ 目录下,
      输入:
            tracd –p 80 trac_proj_home,
      然后通过 http://localhost/ 访问,其中有项目列表
*

------
trac & apache 集成

步骤:
* 安装 mod_python-3.3.1.win32-py2.6-apache2.2.exe
      在网上找到这个文件,
      安装过程中要选择 apache 的安装目录,
      完成,
* 编辑 apache_home/conf/httpd.conf
      加入:
            #python
            LoadModule python_module modules/mod_python.so
* 编辑 apache_home/conf/httpd.conf
      加入:
            # setup trac on mod_python
            <location /trac/hello>
            SetHandler mod_python
            PythonInterpreter main_interpreter
            PythonHandler trac.web.modpython_frontend
            PythonOption TracEnv E:/workplace/trac_workplace/hello
            PythonOption TracUriRoot /trac/hello
            </location>
            <location /trac/hello/login>
            AuthType Basic
            AuthName mytrac
            AuthUserFile E:/workplace/trac_workplace/hello/conf/passwd
            Require valid-user
            </location>

      其中:
            "/trac/hello"                                    是 项目访问路径,
            "E:/workplace/trac_workplace/hello"                  是 trac 项目 的目录,
            "E:/workplace/trac_workplace/hello/conf/passwd"            是 trac 项目 所使用的 用户/密码 文件,最好和 trac 的配置一致

* 创建用户
      cmd 进入 apache_home/lib/ ,
      输入:
            htpasswd -c E:/workplace/trac_workplace/hello/conf/passwd eric
     
      输入2次密码,则创建成功

      其中:
            conf/passwd 是密码文件,
            eric 是 用户名
* 为用户分配权限
      进入 python_home/Scripts/ 目录下,
      输入:
            trac-admin trac_proj_home permission add eric TRAC_ADMIN
      回车,

      则为 eric 分配了管理员权限,
     
* 启动 服务 & 访问
      启动 apache,通过 http://localhost/trac/hello 可以访问上面创建的项目,
      其中
            "http://localhost"      是 apache 根地址,
            "/trac/hello"            是上面步骤中,在 apache 的 httpd.conf 中为 trac项目配置的路径,
* 登录
      用上面创建的 用户 进行登录 即可,
*

------

猜你喜欢

转载自kuchaguangjie.iteye.com/blog/857267