安裝 svn
1.下載軟件
wget http://subversion.tigris.org/downloads/subversion-1.6.6.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.gz
2.解壓安裝
tar -r subversion-1.6.6.tar.gz
3.檢測(cè)svn 是否安裝成功
svnserve --version
4.配置svn
建立svn根目錄
mkidr -p /opt/svn/
建立一個(gè)產(chǎn)品庫 多個(gè)產(chǎn)品可建立多個(gè)文件夾
mkdir -p /opt/tshop/
mkdir -p /opt/raynio/
svnadmin create/opt/svn/tshop
5.、修改版本配置庫文件
vi /opt/svn/tshop/conf/svnserve.conf
vi /opt/svn/raynio/conf/svnserve.conf
將以下的注釋解除
auth-access = write
password-db = passwd
realm = tshop
6.開始設(shè)置passwd用戶賬號(hào)信息
vi /data/svn/repos/conf/passwd
haozi =haozi
7.開始設(shè)置authz. 用戶訪問權(quán)限
vi /data/svn/repos/conf/authz
修改完之后的內(nèi)容如下:
haozi = rw
8、建立啟動(dòng)svn的用戶
useradd svn
根據(jù)提示,為用戶svn設(shè)置密碼
允許用戶svn訪問版本庫:
chown -R svn:svn /opt/svn
9、啟動(dòng)svn:
方式一:svnserve -d -r /opt/svn/ #默認(rèn)的啟動(dòng)端口號(hào)為3690
方式二:su – svn -c “svnserve -d –listen-port 9999 -r /opt/svn/”
10、檢查是否啟動(dòng)
netstat -tunlp | grep svn
11.服務(wù)器上的項(xiàng)目 checkout? svn版本庫中的代碼
svn checkout svn://ip/tshop/
svn checkout svn://ip/raynio/
12.如果遠(yuǎn)程 不可連接或者是無法 更新代碼
解決SVN 無法連接到服務(wù)器問題
問題描述:
1、由于目標(biāo)計(jì)算機(jī)積極拒絕,無法連接
2、由于連接方在一段時(shí)間后沒有正確答復(fù)或連接
解決方法
1、svn 未啟動(dòng),啟動(dòng)svn: svnserve -d -r ‘svn的倉庫路徑’
2、防火墻原因,開放svn端口: 添加3690端口
問題描述
報(bào)No repository found in … …錯(cuò)誤
解決方法
1、原因是svn指定運(yùn)行倉庫路徑錯(cuò)誤
2、查看svn進(jìn)程:
ps -aux|grep svn
root? ? 28813? 0.0? 0.0 166804? 936 ?? ? ? ? Ss? 11:50? 0:00 svnserve -d -r /mnt/svn
root? ? 29456? 0.0? 0.0 112640? 960 pts/0? ? S+? 13:14? 0:00 grep --color=auto svn
如果 svnserve -d -r /mnt/svn 指定的倉庫路徑與實(shí)際倉庫路徑不匹配,殺掉該進(jìn)程后重新指定正確的倉庫路徑
3、本人服務(wù)器實(shí)際倉庫路徑是 /mnt/svn/repos,殺死進(jìn)程:
kill -9 28813
4、重新啟動(dòng)SVN,指定正確SVN倉庫路徑:
svnserve -d -r /mnt/svn/repos
5、查看svn進(jìn)程:
ps -aux|grep svn
root? ? 28813? 0.0? 0.0 166804? 936 ?? ? ? ? Ss? 11:50? 0:00 svnserve -d -r /mnt/svn/repos
root? ? 29456? 0.0? 0.0 112640? 960 pts/0? ? S+? 13:14? 0:00 grep --color=auto svn