1.檢查是否已安裝
2.安裝
4. 修改環境變量
vi/etc/profile
文件末尾加入:
PATH=$PATH:/share/apps/svn/bin
export PATH
使環境變量生效
Source/etc/profile
6.創建倉庫目錄
例如:
7.創建項目
8.檢查是否創建成功
ll
8. 配置版本庫信息
項目配置:
vim svnserve.conf
修改:去掉註釋符
anon-access = none
auth-access = write
password-db = passwd
authzauthz-db = authz
realm = test
這裏要注意:每一行的都要你頂頭,不能有空格,不然會報錯
定義版本庫訪問權限:
# vim authz
添加: (svnuser爲svn用戶名,這裏可以用用戶組設置權限r:read w:wirte)
[/]
svnuser = rw
設定用戶密碼:
vim passwd
添加(用戶名=密碼):
svnuser = 123456
默認是3690端口,你也可以用別的。已開啓的跳過這一步
iptables -I INPUT -p tcp --dport 3690 -j ACCEPT
保存
/etc/rc.d/init.d/iptables save
重啓
service iptables restart
查看
/etc/init.d/iptables status
9.啓動SVN服務
-r:svn根目錄
假設服務端IP爲192.168.1.100,那麼如下設置後game的訪問目錄就爲:
ps:error while loading shared libraries的解決方法
./tests: error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory
出現這類錯誤表示,系統不知道xxx.so放在哪個目錄下,這時候就要在/etc/ld.so.conf中加入xxx.so所在的目錄。
一般而言,有很多的so會存放在/usr/local/lib這個目錄底下,去這個目錄底下找,果然發現自己所需要的.so文件。
所以,在/etc/ld.so.conf中加入/usr/local/lib這一行,保存之後,再運行:/sbin/ldconfig –v更新一下配置即可。
Linux SVN Server
SVN Server在每個倉庫中的hooks裏都有個pre-commit.tmpl文件,cp這個文件並改名爲pre-commit並添加可執行權限:chmod +x pre-commit。pre-commit文件內容如下:
REPOS=”$1″
TXN=”$2″# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
LOGMSG=`$SVNLOOK log -t “$TXN” “$REPOS” | grep “[a-zA-Z0-9]” | wc -c`if [ "$LOGMSG" -lt 10 ]; then
echo -e “Please provide a meaningful comment when committing changes.” 1>&2
exit 1
fi# All checks passed, so allow the commit.
exit 0
配置使用HTTP的方式訪問SVN
1.yum install httpd
2.yum install yum mod_dav_svn
-
vim /etc/httpd/conf.d/subversion.conf
-
LoadModule dav_svn_module modules/mod_dav_svn.so
-
LoadModule authz_svn_module modules/mod_authz_svn.so
-
<Location />
-
DAV svn
-
SVNParentPath /svn #根目錄
-
AuthType Basic
-
AuthName "Authorization test"
-
AuthzSVNAccessFile share/apps/svn/authz #驗證的權限文件目錄
-
AuthUserFile share/apps/svn/passwd #密碼文件,這個使用htpasswd方式新建的密文文件
-
Require valid-user
-
</Location>
在本地服務器上安裝svn客戶端TortoiseSVN 上傳幾個測試版本