1.系統版本:ubuntu
#sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.10
Release: 16.10
Codename: yakkety
svn
2. Svn安裝測試
# sudo apt-get install subversionspa
# sudo mkdir /home/svn .net
# sudo svnadmin create /home/svn/reposorm
配置:ip
#vi authzget
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Averageit
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joepip
# [/foo/bar]
# harry = rw
# &joe = r
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[repos:/]
username = rw
#vi 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
username= password
#vi svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
2. Svn開機自啓動
該版本的ubuntu已經使用Systemd腳本管理開機啓動項了
1) #cd /etc/systemd/system/
2) #touch /etc/systemd/system/svn.service
3) #chmod 664 /etc/systemd/system/svn.service
#vi svn.service
[Uint]
Descpiption=Subversion Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/svnserve -d -r /home/***/svn
ExecStop=/usr/bin/killall svnserve
Restart=always
[Install]
WantedBy=multi-user.target
通知systemd有個新服務添加:
4) #systemctl daemon-reload
5)啓動和中止SVN服務
systemctl start svn.service
systemctl stop svn.service
用於測試剛纔建立的服務單元是否工做正常。
5)配置開機自動啓動
systemctl enable svn.service
6)其餘有用的命令
列出systemd管理的全部服務狀態
systemctl list-units --type service --all
檢查SVN服務運做狀態
systemctl status svn.service