CentOS 源碼安裝svn

1、 下載依賴包php

  1. apr源碼包python

    http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.5.2.tar.gzweb

  2. apr-util源碼包sql

    http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.5.4.tar.gzapache

  3. serf源碼包frontend

    https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2svn

  4. scons源碼包spa

    https://sourceforge.net/projects/scons/files/scons/2.5.1/   .net

  5. sqlite-amalgamation源碼包code

    http://www.sqlite.org/2017/sqlite-amalgamation-3160200.zip

  6. svn源碼包

    http://mirrors.cnnic.cn/apache/subversion/subversion-1.9.9.tar.gz

2、安裝依賴包

  apr  

> tar xf apr-1.5.2.tar.gz
> cd apr-1.5.2
> ./configure --prefix=/usr/local/apr
> make && make install

apr-util

> tar xf apr-util-1.5.4.tar.gz
> cd apr-util-1.5.4
> ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
> make && make install

scons

> tar xf scons-2.5.1.tar.gz
> cd scons-2.5.1
> python setup.py install --prefix=/usr/local/scons

serf

> tar xf serf-1.3.9.tar.bz2
> cd serf-1.3.9
> /usr/local/scons/bin/scons PREFIX=/usr/local/serf APR=/usr/local/apr APU=/usr/local/apr-util
> /usr/local/scons/bin/scons install
> cp /data/serf/lib/libserf-1.so* /usr/local/lib/

svn

> tar xf subversion-1.9.5.tar.gz
> mkdir /usr/local/subversion-1.9.5/sqlite-amalgamation
> unzip sqlite-amalgamation-3160200.zip -d /data/subversion-1.9.5/
> cd subversion-1.9.5
> mv sqlite-amalgamation-3160200 sqlite-amalgamation
> ./configure --prefix=/usr/local/subversion \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-serf=/usr/local/serf \
--enable-mod-activation
> make && make install

3、配置svnserve

  1. 查看版本

  svnserve --version

  2. 建立倉庫

  svnadmin create /data/svndata/

  3. 配置權限,用戶和密碼等信息

  svnserve.conf

  [general]

#禁止匿名訪問
anon-access = none
#受權用戶寫權限
auth-access = write
#用戶密碼文件
password-db = passwd
#受權登陸文件
authz-db = authz
#每一個svn項目認證名,建議寫項目名
realm = repos

  authz(權限配置,重點說一哈)

[groups]
backend_dev = zhangsan
frontend-dev = lisi
test = test01

[/]
admin = rw      #權限能按目錄來繼承,admin有根目錄下全部權限

[fxhk:/admin]    
@backend_dev=rw  #這個組有權限讀寫,其餘用戶無權限;

[fxhk:/web]      #項目的目錄就在fxhk這級目錄,對下一級目錄的權限控制能夠這麼寫
@frontend-dev=rw  

4、啓動腳本

  svnserve -d -r /data/svndata/ --listen-port 3690 --log-file=/var/log/svnserve.log

相關文章
相關標籤/搜索