作者:zccst
1,下載
http://subversion.apache.org/download/
共兩個檔案,分別是:subversion-1.6.21.tar.gz和subversion-deps-1.6.21.tar.gz
然後依次加壓。
2,安裝
# cd subversion-1.6.21
#./configure --prefix=/opt/svn
# make #編譯,如果提示錯誤, 則可能需要root許可權
# make install #安裝,此時可能需要root使用者權限
3,配置
(1) 將svn命令連結到/usr/local/bin目錄下(需要root許可權):
ln –s /usr/local/subversion/bin/svn /usr/local/bin
測試是否已經可以在使用者目錄下使用svn:
svn help 如果出現命令列表,則表示已經連結成功。
(2) 使用chmod命令,使 list checkout commit這三個命令指令碼有執行許可權:
chmod 777 list checkout commit
cp list checkout commit /usr/bin
svn用戶端安裝成功
4,出錯及解決辦法
測試一下:
svn checkout https://xxx.xxx.xxx/
結果報如下錯誤:svn: SSL is not supported
仔細一看,原因如下,svn --version顯示,ra_neon 不支援https :
* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme
從網上查了一下,說是在執行./configure 時要加上--with-ssl
ok,重新安裝,如下:
wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz
tar -zxvf openssl-1.0.0a.tar.gz
cd openssl-1.0.0a
./config
./config -t
make depend
make
make test
make install
重新安裝一遍SVN
./configure --with-openssl=/usr/local/ssl --with-ssl
ok,這次執行成功,接著執行make,make install 即可。
現在再次執行svn --version,顯示如下:
[wap@localhost boss]$ svn --version
svn, version 1.6.1 (r37116)
compiled Jun 17 2010, 14:59:48
Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules are available:
* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
- handles 'http' scheme
- handles 'https' scheme
可以看到,現在https也支援了。
這次執行
svn checkout https://xxx.xxx.xxx/
成功。
5,co的提示
Error validating server certificate for 'https://svn.baidu.com:443':
- The certificate is not issued by a trusted authority. Use the
fingerprint to validate the certificate manually!
Certificate information:
- Hostname: svn.baidu.com
- Valid: from Tue, 16 Mar 2010 10:45:03 GMT until Fri, 13 Mar 2020 10:45:03 GMT
- Issuer: baidu, baidu, BEIJING, BEIJING, CN
- Fingerprint: ad:77:84:4d:5d:fb:7a:c8:f7:2e:fb:48:20:86:3a:0e:73:43:e7:62
(R)eject, accept (t)emporarily or accept (p)ermanently?
直接P
如果不行,參考如下解決辦法
照理直接按p就可以讓svn以後忽略這個問題了,但是很奇怪,即便選擇了p,下次操作時還是會提示同樣的經過高,如果我只用命令操作問題
也不是太大,但是如果要用xcode進行代碼的控制的話,就非常蛋疼了,簡直沒法用。
但是這也不是什麼大問題,只要在 ~/.subversion/servers 中添加幾行配置就輕鬆搞定了 具體操作如下:
(1) 用命令開啟servers設定檔:open ~/.subversion/servers
(2) 在servers設定檔的末尾添加:
ssl-ignore-host-mismatch
= true
ssl-ignore-unknown-ca = true
ssl-ignore-invalid-date = true
(3)
我是這樣搞定的,你試試吧
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<https://svn.baidu.com:443> Subversion
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------