1、安裝
# yum install subversion
# which svnserve //查看安裝路徑
# svnserve --version //查看版本
2、建立版本庫
# systemctl cat svnserve.service
/usr/lib/systemd/system/svnserve.service
[Unit]
Description=Subversion protocol daemon
After=syslog.target network.target[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/svnserve
ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS[Install]
WantedBy=multi-user.target
# cat /etc/sysconfig/svnserve
OPTIONS is used to pass command-line arguments to svnserve.
Specify the repository location in -r parameter:
OPTIONS="-r /var/svn"
# vim /etc/sysconfig/svnserve
OPTIONS is used to pass command-line arguments to svnserve.
Specify the repository location in -r parameter:
OPTIONS="-r /opt/svn"
# mkdir -p /opt/svn
# svnadmin create /opt/svn/iuyy
# ll /opt/svn/
# ll /opt/svn/test
3. 配置
3.1 編輯用戶文件passwd,新增兩個(gè)用戶:admin和user。
# cat /opt/svn/iuyy/conf/passwd
# vim /opt/svn/iuyy/conf/passwd
[users]
admin = administrator
3.2 編輯權(quán)限文件authz
# vim /opt/svn/iuyy/conf/authz
[/]
admin = rw
3.3 編輯svnserve.conf
# vim /opt/svn/iuyy/conf/svnserve.conf
[general]
anon-access = none
auth-access = writepassword-db = passwd
authz-db = authz
realm = blog
4、啟動(dòng)SVN服務(wù)
# systemctl start svnserve.service
# systemctl enable svnserve.service //設(shè)置為開機(jī)啟動(dòng)
5、開放防火墻端口
# firewall-cmd --zone=public --add-port=3690/tcp --permanent
# firewall-cmd --reload