Chinaunix首页 | 论坛 | 博客
  • 博客访问: 201076
  • 博文数量: 489
  • 博客积分: 410
  • 博客等级: 下士
  • 技术积分: 2590
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-01 22:50
文章分类

全部博文(489)

文章存档

2011年(489)

我的朋友

分类:

2011-09-04 12:27:25

最近同事说想用svn来代替CVS工作.研究了一下,安装了一套svn trac的系统.下面简单总结一下.以备以后使用时参考.
参考文档:http://www.open-china.net/blog/45231.html
1.首先安装subvision
 yum install -y subversion mod_dav_svn mod_python python-setuptools
这个时候报了一个错,
 file /usr/share/man/man8/svnserve.8.gz from install of subversion-1.6.13-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386类似的还好几行.网上查找,都是要去掉一个yum仓库,看了我的配置,里面只有基本的配置,没有它们提到的仓库,先手工删除这个文件,再yum还是不行.然后rpm -e subversion-1.4.2-4.el5_3.1.i386 --nodeps,再次yum安装,没有报错了.还是更习惯用rpm些,呵呵.刚才搜这个错误信息时,还有提到先yum remove也行.
2.安装python

# install python
yum -y install python.i386 python-devel.i386 python-lxml.i386 python-sqlite.i386 python-clearsilver.i386 swig.i386 python-setuptools.noarch

3.下载安装python模板clearsilver
wget
rpm -i clearsilver-0.10.4-1.el5.rf.i386.rpm
wget
rpm -i python-clearsilver-0.10.4-1.el5.rf.i386.rpm

4.#安装Trac
wget
tar zxvf Trac-0.11.4.tar.gz
cd Trac-0.11.4
python setup.py build && python setup.py install

5.配置

a.建立svn及trac目录

mkdir /srv/svn
mkdir /srv/trac/

b.#新建svn项目
svnadmin create /srv/svn/project
#新建trac项目
trac-admin /srv/trac/project initenv
#按提示操作,`Path to repository` is: /srv/svn/project

c.#改文件所属为apache 我是改成一个普通用户,因为我用的是nfs共享.根据自己的需要更改这个用户,同时保证和httpd.conf中一致.
chown -R apache.apache /srv/svn/project
chown -R apache.apache /srv/trac/project

d.vi /etc/httpd/conf.d/subersion.conf,加入下列内容


LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn".  Each repository
# must be readable and writable by the 'apache' user.  Note that if
# SELinux is enabled, the repositories must be labelled with a context
# which httpd can write to; this will happen by default for
# directories created in /var/ Use "restorecon -R /var/www/svn"
# to label the repositories if upgrading from a previous release.
#

#
# To create a new repository "" using
# this configuration, run as root:
#
#   # cd /var/www/svn
#   # svnadmin create stuff
#   # chown -R apache.apache stuff
#


   DAV svn
   SVNParentPath /srv/svn

#   # Limit write permission to list of valid users.
  
#      # Require SSL connection for password protection.
#      # SSLRequireSSL
#
      AuthType Basic
      AuthName "subversion repository"
      AuthUserFile /srv/svn/conf/svn-auth-file
      Require valid-user
      AuthzSVNAccessFile /srv/svn/conf/svn-access-file
  

e. vi /etc/httpd/conf.d/trac.conf


    SetHandler mod_python
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnv /srv/trac/project
    SetEnv PYTHON_EGG_CACHE /tmp
    PythonOption TracUriRoot /trac/project
    AuthType None
        AuthType Basic
        AuthName "svn.xxx.com"
        AuthUserFile /srv/svn/conf/svn-auth-file
        Require valid-user

6.生成htppasswd文件和用户
htpasswd -cm /srv/svn/conf/svn-auth-file admin
service httpd restart

7.这时已经可以用浏览器进行测试了

8.然后也可以用 windows的svn客户端进行操作.

9.给svn服务器配置了一个域名,设置了一个自动跳转到trac页面.

在DocumentRoot下vi index.html,加入下面的内容

 

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4.   <title>Redirection</title>
  5.   <meta http-equiv="refresh" content="0;URL=/trac/project">
  6. </head>
  7. <body>
  8. <h1><center>
  9.                 edirecting to trac bug system ...<br>
  10.         <a href="/trac/project">Come here!</a>
  11. </h1>
  12. </body>
  13. </html>

 这样访问svn.xxx.com时就直接跳到页面上了.然后输入用户名和密码就能正确访问该页面了.

阅读(190) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~