Chinaunix首页 | 论坛 | 博客
  • 博客访问: 156467
  • 博文数量: 31
  • 博客积分: 1720
  • 博客等级: 上尉
  • 技术积分: 305
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-13 13:47
文章分类

全部博文(31)

文章存档

2014年(3)

2013年(1)

2012年(10)

2011年(1)

2010年(3)

2009年(13)

分类: LINUX

2009-08-13 18:46:41

环境: Centos 5.3 
 
目标:CentOS作为服务器,来管理项目的源代码和wiki文档。
 
步骤:
 
1. 安裝 Trac:
 
   使用的是trac-0.10版本,没有用最新的,由于python版本是2.4的,trac-0.11需要2.5以上版本。
  
   从网上下载安装包:
 
   其他的安装包,setuptools, genshi, sqlite, clearsilver
 
2. 安装apache,
   使用yum install httpd
 
3. 安装git
   从网上搜到git的源码,然后安装。
 
4.  建立 git repository:
     % cd /path/to/your/src
     % git init
     % tar xzvf  your.src.tar.gz
     % git add *
     % git commit -a -m "First revision"
 
    % cd /path/to/your/git-web
     % git clone --bare /path/to/your/src   prj1.git     
     % touch prj1.git/git-daemon-export-ok

     % ls -F git-web/prj1.git
       branch/    config    HEAD   hooks/    info/    objects/     refs/      description
确认上述建立成功:
     % cd /path/to/new/src
     % git clone ssh://your-ip-address/path/to/your/git-web/prj1.git
你可以看到clone下来的源代码就是你项目的源代码。
 
5.  设置trac环境
 
  % cd /path/to/trac; mkdir prj1
     % trac-admin  /path/to/trac-env/prj1  initenv

         Repository : /path/to/your/git-web/prj1.git
         Version Control = git

     % pwd
      /path/to/trac-env

      修改 trac.cgi, 加入一行:
        try:
              import os
++         os.environ['TRAC_ENV_PARENT_DIR'] = '/path/to/trac-env'
              import pkg-resources
 
 
 
   设定登陆密码
     % htdigest -c shares/trac.htpasswd "your-realm" user_acc
       New password:
       Re-type new password:
           其中:
               your-realm : 這個字串要跟 httpd.conf 中的設定一致,以下的動作中會說明.
               user-acc : 使用者帳號

     % htdigest shares/trac.htpasswd "your-realm" user_acc
        ==> 加第二個以上的使用者時,不需要 "-c" 參數了
 
6. 安裝 gitplugin

  官方网上有tar包,可以安装。

   % pythod setup.py bdist_egg
        ==> output 在 dist/TracGit-0.10.0.1-py2.4.egg
     % cp dist/TracGit-0.10.0.1-py2.4.egg /path/to/trac-env/prj1/plugins
     root $ chown -R apache.apache /path/to/trac-env/prj1/plugins

7.8. 修改 trac 环境设置 trac.ini
     % cd /path/to/trac-env/prj1/conf
     % vi trac.ini
        [logging]
           log-type = none file          <--- 需要 debug 時

        新增以下內容:
        [git]
                cached_repository = true
                persistent_cache = true
                shortrev_len = 6
                git_bin = /path/to/git  <--- 可用 "which git" 找一下你的 git 程式是安裝到哪

        [components]
                gitplugin.* = enabled
                

8. 测试是否成功:

% tracd --port 8000 /path/to/trac-env/prj1

     连接:

 

9. 到页面上需要登录时需要如下:

$ tracd -p 8080 --\
   auth=project1,/path/to/users.htdigest,your-realm /path/to/project1

    

就可以到页面上登录你的用户,然后修改页面以及wiki更新。



 
  
阅读(2044) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:XEN中VLAN的建立

给主人留下些什么吧!~~