SVN安裝
root@majin-All-Series:~# sudo apt-get -y install subversion
正在讀取軟件包列表... 完成
正在分析軟件包的依賴關(guān)系樹
正在讀取狀態(tài)信息... 完成
subversion 已經(jīng)是最新版 (1.9.7-4ubuntu1)。
下列軟件包是自動安裝的并且現(xiàn)在不需要了:
fonts-liberation2 fonts-opensymbol gir1.2-geocodeglib-1.0
gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0
gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3
libboost-date-time1.65.1 libboost-filesystem1.65.1
libboost-iostreams1.65.1 libboost-locale1.65.1 libcdr-0.1-1
libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2
libdazzle-1.0-0 libe-book-0.1-1 libedataserverui-1.2-2 libeot0
libepubgen-0.1-1 libetonyek-0.1-1 libevent-2.1-6 libexiv2-14
libfreerdp-client2-2 libfreerdp2-2 libgee-0.8-2 libgexiv2-2
libgom-1.0-0 libgpgmepp6 libgpod-common libgpod4 liblangtag-common
liblangtag1 liblirc-client0 liblua5.3-0 libmediaart-2.0-0
libmspub-0.1-1 libodfgen-0.1-1 libqqwing2v5 libraw16 librevenge-0.0-0
libsgutils2-2 libssh-4 libsuitesparseconfig5 libvncclient1 libwinpr2-2
libxapian30 libxmlsec1 libxmlsec1-nss lp-solve media-player-info
python3-mako python3-markupsafe syslinux syslinux-common
syslinux-legacy usb-creator-common
使用'sudo apt autoremove'來卸載它(它們)。
升級了 0 個軟件包,新安裝了 0 個軟件包,要卸載 0 個軟件包,有 2 個軟件包未 被升級。
創(chuàng)建版本庫
創(chuàng)建目錄文件夾
majin@majin-All-Series:~$ sudo mkdir /home/svn
majin@majin-All-Series:~$ sudo mkdir /home/svn/project_common
majin@majin-All-Series:~$
創(chuàng)建svn版本庫
majin@majin-All-Series:~$ sudo svnadmin create /home/svn/project_common/
majin@majin-All-Series:~$
SVN 管理
為了便于管理,將所有版本庫的密碼和權(quán)限設(shè)置在同一個文件下面,操作步驟如下:
- 取出~/project_common/conf/的authz和passwd兩個文件到svn根目錄下面
majin@majin-All-Series:/home/svn/project_common$ sudo cp ./conf/authz ../
[sudo] majin 的密碼:
majin@majin-All-Series:/home/svn/project_common$ sudo cp ./conf/passwd ../
majin@majin-All-Series:/home/svn/project_common$
- 修改每個版本庫目錄conf文件夾下面的svnserve.conf文件
majin@majin-All-Series:/home/svn$ sudo vim project_common/conf/svnserve.conf
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit http://subversion.apache.org/ for more information.
[general]
### The anon-access and auth-access options control access to the
### repository for unauthenticated (a.k.a. anonymous) users and
### authenticated users, respectively.
### Valid values are "write", "read", and "none".
### Setting the value to "none" prohibits both reading and writing;
### "read" allows read-only access, and "write" allows complete
### read/write access to the repository.
### The sample settings below are the defaults and specify that anonymous
### users have read-only access to the repository, while authenticated
### users have read and write access to the repository.
# anon-access = read
anon-access = none ## 增加此行
# auth-access = write
anon-access = write ## 增加此行
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
# password-db = passwd
password-db = ../../passwd ## 增加此行
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the
### directory containing this file. The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository. If you don't specify an authz-db,
### no path-based access control is done.
### Uncomment the line below to use the default authorization file.
# authz-db = authz
authz-db = ../../authz ## 增加此行
定義一下幾個角色用來測試
+ 配置管理員(svnadmin),用來管理整個庫
+ 項目經(jīng)理(manage),用來相關(guān)管理文檔
+ 開發(fā)人員 (dev),測試開發(fā)是否正常
創(chuàng)建方法
打開svn目錄下的passwd文件,創(chuàng)建方法是在[user]下面添加 username = passwd,記得“=”前后的空格,如下圖:(svnadmin控制所有項目,統(tǒng)一管理)
majin@majin-All-Series:/home/svn$ sudo vim passwd
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
# harry = harryssecret
# sally = sallyssecret
#
svnadmin = svnadmin
majin = majin
louwen = louwen
lqq = lqq
lcl = lcl
test1 = test1
dev = dev
pm = pm
啟動svn服務(wù)
一次啟動
sudo svnserve -d -r /home/svn
開機(jī)自啟動svn
- 在/etc/init.d目錄建立一個腳本文件svnd.sh
sudo vim /etc/init.d/svnd.sh
#! /bin/bash
# svn server startup
svnserve -d -r /home/svn
:wq
sudo chmod 777 svnd.sh
- 更新修改權(quán)限:
majin@majin-All-Series:/etc/init.d$ update-rc.d svnd.sh defaults
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
重新載入 systemd 狀態(tài)需要認(rèn)證。
Authenticating as: majin,,, (majin)
Password:
==== AUTHENTICATION COMPLETE ===
majin@majin-All-Series:/etc/init.d$