svn简介:
- [root@svn ~]# tar zxvf subversion-1.6.6.tar.gz
- [root@svn ~]# tar zxvf subversion-deps-1.6.6.tar.gz
- [root@svn ~]# cd subversion-1.6.6
- [root@svn subversion-1.6.6]#
- ./configure --prefix=/usr/local/svn --with-openssl=/usr/include/openssl --without-berkeley-db
- [root@svn subversion-1.6.6]# make && make install
- [root@svn ~]# /usr/local/svn/bin/svnserve --version svnserve, version 1.6.6 (r40053) compiled Feb 21 2012, 14:14:57 Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository back-end (FS) modules are available: * fs_fs : Module for working with a plain file (FSFS) repository.
- [root@svn ~]# mkdir -p /data/svn #创建svn版本库目录
- [root@svn ~]# /usr/local/svn/bin/svnadmin create /data/svn/repos #创建版本库
- [root@svn ~]# vim /data/svn/repos/conf/svnserve.conf
- [general]
- anon-access = none #非授权用户不允许访问
- auth-access = write #授权用户允许所有操作
- password-db = /usr/local/svn/conf/passwd.conf #密码数据库位置
- authz-db = /usr/local/svn/conf/authz.conf #授权文件位置
- realm = repos #设置仓库的授权域
- [root@svn svn]# mkdir conf && cd conf
- [root@svn conf]# touch passwd.conf;touch authz.conf
- [root@svn ~]# useradd test
- [root@svn ~]# passwd test
- [root@svn conf]# vim passwd.conf
- [users]
- testtest = test
- [root@svn conf]# vim authz.conf
- [groups]
- admin = test
- [/]
- @admin = rw
- [root@svn ~]# useradd -s /sbin/nologin svn
- [root@svn ~]# chown -R svn:svn /data/svn/
- echo "/usr/local/svn/bin/svnserve -d --listen-port 3690 -r /data/svn" >>/etc/rc.d/rc.local
- [root@svn ~]# vim /etc/init.d/svn
- #!/bin/bash
- # build this file in /etc/rc.d/init.d/svn
- # chmod 755 /etc/rc.d/init.d/svn
- # chkconfig: - 85 15
- # description: svn server
- SVN_HOME=/data/svn
- if [ ! -f "/usr/local/svn/bin/svnserve" ]
- then
- echo "svnserver startup: cannot start"
- exit
- fi
- case "$1" in
- start)
- echo "Starting svnserve..."
- /usr/local/svn/bin/svnserve -d --listen-port 3690 -r $SVN_HOME
- echo "Finished!"
- ;;
- stop)
- echo "Stoping svnserve..."
- killall svnserve
- echo "Finished!"
- ;;
- restart)
- $0 stop
- $0 start
- ;;
- *)
- echo "Usage: svn { start | stop | restart } "
- exit 1
- esac
- [root@svn ~]# chmod 755 /etc/init.d/svn
- [root@svn ~]# chkconfig svn on
- [root@svn ~]# /etc/init.d/svn start
- [root@svn ~]# /etc/init.d/svn stop
- Stoping svnserve...
- Finished!