CentOS下使用yum安裝配置和使用svn

來源:互聯網
上載者:User

標籤:blog   http   io   ar   os   使用   sp   java   for   

安裝說明

系統內容:CentOS-6.3
安裝方式:yum install (源碼安裝容易產生版本相容的問題)
安裝軟體:系統自動下載SVN軟體

檢查已安裝版本

?
1234567891011 #檢查是否安裝了低版本的SVN[[email protected] /]# rpm -qa subversion#卸載舊版本SVN[[email protected] modules]# yum remove subversion安裝SVN[[email protected] modules]# yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql確認已安裝了svn模組[[email protected] /]# cd /etc/httpd/modules[[email protected] modules]# ls | grep svnmod_authz_svn.somod_dav_svn.so

驗證安裝
 

檢驗已經安裝的SVN版本資訊 
[[email protected] modules]# svnserve --version 
svnserve,版本 1.6.11 (r934486) 
編譯於 Jun 23 2012,00:44:03 

著作權 (C) 2000-2009 CollabNet。 
Subversion 是開放原始碼軟體,請參閱 http://subversion.tigris.org/ 網站。 
此產品包含由 CollabNet( http://www.Collab.Net/) 開發的軟體。 

下列版本庫後端(FS) 模組可用: 
* fs_base : 模組只能操作BDB版本庫。 
* fs_fs : 模組與文字檔(FSFS)版本庫一起工作。 
Cyrus SASL 認證可用。 

程式碼程式庫建立 

SVN軟體安裝完成後還需要建立SVN庫 
?
12 [[email protected] modules]# mkdir -p /opt/svn/repositories[[email protected] modules]# svnadmin create /opt/svn/repositories
執行上面的命令後,自動建立repositories庫,查看/opt/svn/repositories 檔案夾發現包含了conf, db,format,hooks, locks, README.txt等檔案,說明一個SVN庫已經建立。 

配置程式碼程式庫 

進入上面產生的檔案夾conf下,進行配置 
[[email protected] modules]# cd /opt/svn/repositories/conf 

使用者密碼passwd配置 
?
12 [[email protected] password]# cd /opt/svn/repositories/conf[[email protected] conf]# vi + passwd
修改passwd為以下內容: 
?
1234 [users]# harry = harryssecret# sally = sallyssecretzhoulf=123456

許可權控制authz配置 

[root @admin conf]# vi + authz 
目的是設定哪些使用者可以訪問哪些目錄,向authz檔案追加以下內容: 
#設定[/]代表根目錄下所有的資源 
[/] 
zhoulf=rw 
服務svnserve.conf配置 

[root @admin conf]# vi + svnserve.conf 

追加以下內容: 
?
1234567891011 [general]#匿名訪問的許可權,可以是read,write,none,預設為readanon-access=none#使授權使用者有寫入權限auth-access=write#密碼資料庫的路徑password-db=passwd#存取控制檔案authz-db=authz#認證命名空間,subversion會在認證提示裡顯示,並且作為憑證緩衝的關鍵字realm=/opt/svn/repositories

配置防火牆連接埠 
?
12345 [[email protected] conf]# vi /etc/sysconfig/iptables添加以下內容:-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT儲存後重啟防火牆[[email protected] conf]# service iptables restart
啟動SVN 
?
1 svnserve -d -r /opt/svn/repositories
查看SVN進程 
?
12 [[email protected] conf]# ps -ef|grep svn|grep -v greproot 12538 1 0 14:40 ? 00:00:00 svnserve -d -r /opt/svn/repositories
檢測SVN 連接埠 
?
12 [[email protected] conf]# netstat -ln |grep 3690tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN
停止重啟SVN 
?
12 [[email protected] password]# killall svnserve //停止[[email protected] password]# svnserve -d -r /opt/svn/repositories // 啟動

測試 

SVN服務已經啟動,使用用戶端測試連接。 
用戶端串連地址:svn://192.168.15.231 
使用者名稱/密碼: zhoulf/123456 
測試建立檔案夾等操作。

 

 

另附:

CentOS下svn的安裝配置和使用

一,安裝必須的軟體包

        $ yum install subversion 
        $ yum install mod_dav_svn   二,基本的SVN伺服器配置 

        1,建立一個目錄用於儲存SVN所有檔案                # mkdir /home/svn         2,建立一個版本倉庫                # svnadmin create /home/svn/test         3,初始化版本倉庫中的目錄,匯入原始代碼                如果原代碼已經有svn的相關檔案,則切換到原代碼目錄,先刪除這些svn相關的檔案和檔案夾。假定/home/user/code/src存放原始碼                # cd /home/user/code/src                # find ./ -name "*.svn" | xargs rm -rf                # svn import /home/user/code/src file:///home/svn/test/ -m "init test code"         4,添加使用者                在/home/svn/test/conf/passwd檔案添加形如“username=password"的條目。                [users]                admin = adminpass                user1 = 123456          5,修改使用者存取原則                /home/svn/test/conf/authz記錄使用者的存取原則:                        [groups]                                                [test:/]                        admin = rw                        user1 = r                        * =                                                [test:/modue]                        admin = rw                        user1 = rw                        * =                以上表示admin具有所有的讀寫權限,user1在modue檔案夾下可讀可寫,根目錄下唯讀。也可以配置組的許可權。         6,修改/home/svn/test/conf/svnserve.conf檔案,讓使用者和策略配置生效.                svnserve.conf內容如下:                        [general]                        anon-access = none                        auth-access = write                        password-db = passwd                        authz-db = authz         7,啟動伺服器                # svnserve -d -r /home/svn         8,測試伺服器                # svn co svn://192.168.1.5/test                按提示先輸入使用者密碼,再輸入svn的使用者名稱、密碼,就可以了。                # cd test                # vim main.c                # svn add main.c                 # svn commit main.c -m "comment"                Adding         main.c                Transmitting file data .                Committed revision 2.  ( 測試提交成功 )  三,配置SVN伺服器的HTTP支援(可以用瀏覽器看代碼) 

       詳細配置請參考 http://www.blogjava.net/jasmine214--love/archive/2010/09/26/332989.html       1,修改httpd.conf,添加關於SVN伺服器的內容                修改/etc/httpd/conf/httpd.conf。         2,重啟HTTPD伺服器                # service httpd restart         3,用瀏覽器訪問http://192.168.1.5/test  四,可能出現的問題 

1. 如果外網不能正常訪問,可能還需要作連接埠映射,對外網開放3690連接埠。    檢查連接埠是否開啟,可以用命令: telnet xxx.xxx.xxx.xxx 3690 2. 在windows下checkout的時候,如果出現類似以下的錯誤:

原因是linux下有同名但大小寫不同的檔案。一種解決辦法是盡量避免這種情況,改成不同的名稱。


其它:

linux下安裝配置svn服務
CentOS6.0 下使用yum命令安裝和配置SVN版本庫

轉自:http://my.oschina.net/junn/blog/164041

CentOS下使用yum安裝配置和使用svn

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.