安裝
aptg libapache2-svn subversion
建立目錄
mkdir -p /home/svn/repository/
svnadmin create /home/svn/repository/PROJECT_NAME
設定owner
chown -R www-data.www-data /home/svn/repository/PROJECT_NAME
編輯
/etc/apache2/mods-available/dav_svn.conf
修改如下,如沒有,a2enmod dav_svn自動產生
DAV svn
SVNParentPath /home/svn/repository
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
AuthzSVNAccessFile /etc/apache2/dav_svn.authz
Require valid-user
編輯
/etc/apache2/dav_svn.authz
[PROJECT_NAME:/]
* =
user1 = rw
user2 = rw
PS:PROJECT_NAME:/目錄名
增加帳號/密碼到/etc/apache2/dav_svn.passwd
/usr/bin/htpasswd -c /etc/apache2/dav_svn.passwd user1
/usr/bin/htpasswd /etc/apache2/dav_svn.passwd user1
重新啟動apache
checkout(co)/commit(ci)/update(up)
svn co http://ip.or.domain/svn/PROJECT_NAME
備份:
svnadmin dump /path/to/project/ >/tmp/project.dump
還原:
編輯
/etc/apache2/mods-available/dav_svn.conf
修改如下,如沒有,a2enmod dav_svn自動產生
DAV svn
SVNParentPath /home/svn/repository
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
AuthzSVNAccessFile /etc/apache2/dav_svn.authz
Require valid-user
編輯
/etc/apache2/dav_svn.authz
[PROJECT_NAME:/]
* =
user1 = rw
user2 = rw
PS:PROJECT_NAME:/目錄名
增加帳號/密碼到/etc/apache2/dav_svn.passwd
/usr/bin/htpasswd -c /etc/apache2/dav_svn.passwd user1
/usr/bin/htpasswd /etc/apache2/dav_svn.passwd user1
重新啟動apache
checkout(co)/commit(ci)/update(up)
svn co http://ip.or.domain/svn/PROJECT_NAME
備份:
svnadmin dump /path/to/project/ >/tmp/project.dump
還原:
先刪除
rm /path/to/project
再建立
svnadmin create /path/to/project
svnadmin load /path/to/project < /tmp/project.dump
chown www-data.www-data -R /path/to/project
其他:
唯一識別ID:(Client端應該是認這個,uuid不同應該會不能用)
/PROJECT_NAME/db/uuid
svnadmin load /path/to/project < /tmp/project.dump
chown www-data.www-data -R /path/to/project
其他:
唯一識別ID:(Client端應該是認這個,uuid不同應該會不能用)
/PROJECT_NAME/db/uuid