SVN linux端配置

1.create a folder:
    mkdir /sandbox/svn
2.create svn repository:
    svnadmin create /sandbox/svn/project
3.edit passwd:
    [users]
    Hello=world
    Happy=day
    Ni=hao
4.edit authz:
    [groups]
    test = Hello,Happy
    [/]
    Ni=rw
    @test=r
5.edit svnserve
        [general]
        anon-access = read
        auth-access = write
        password-db = passwd
        authz-db = authz
        realm = /sandbox/svn/project
6. svnserve -d -r /sanbox/svn/project
7. auto boot when reboot linux host:
    cd /etc/init.d
    vim svn:

    #!/bin/bash  
    # chkconfig: - 85 15  
    # description: svn server  
    SVN_HOME=/svnroot/repos  
    if [ ! -f "/usr/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  

 

    chmod 755 svn
    chkconfig --add svn
    chkconfig svn on
    chkconfig --list|grep svn :

svn                0:off    1:off    2:on    3:on    4:on    5:on    6:off


Tips:
delete stored passwd:
    # rm -rf ~/.subversion/auth

posted @ 2015-07-11 15:49  微微微笑  阅读(208)  评论(0编辑  收藏  举报