0712-2888027 189-8648-0214
微信公眾號

孝感風(fēng)信網(wǎng)絡(luò )科技有限公司微信公眾號

當前位置:主頁(yè) > 技術(shù)支持 > Linux > CentOS 6.3環(huán)境下SVN服務(wù)器的安裝與配置

CentOS 6.3環(huán)境下SVN服務(wù)器的安裝與配置

時(shí)間:2024-07-18來(lái)源:風(fēng)信官網(wǎng) 點(diǎn)擊: 712次
Subversion是一個(gè)版本控制系統,相對于的RCS、CVS,采用了分支管理系統,它的設計目標就是取代CVS?;ヂ?lián)網(wǎng)上免費的版本控制服務(wù)多基于Subversion。

Subversion的版本庫可以通過(guò)網(wǎng)絡(luò )訪(fǎng)問(wèn),從而使用戶(hù)可以在不同的電腦上進(jìn)行操作。從某種程度上來(lái)說(shuō),允許用戶(hù)在各自的空間里修改和管理同一組數據可以促進(jìn)團隊協(xié)作。因為修改不再是單線(xiàn)進(jìn)行(單線(xiàn)進(jìn)行也就是必須一個(gè)一個(gè)進(jìn)行),開(kāi)發(fā)進(jìn)度會(huì )進(jìn)展迅速。此外,由于所有的工作都已版本化,也就不必擔心由于錯誤的更改而影響軟件質(zhì)量—如果出現不正確的更改,只要撤銷(xiāo)那一次更改操作即可。某些版本控制系統本身也是軟件配置管理系統(SCM),這種系統經(jīng)過(guò)精巧的設計,專(zhuān)門(mén)用來(lái)管理源代碼樹(shù),并且具備許多與軟件開(kāi)發(fā)有關(guān)的特性——比如對編程語(yǔ)言的支持或者提供程序構建工具。不過(guò)Subversion并不是這樣的系統,它是一個(gè)通用系統,可以管理任何類(lèi)型的文件集。

查看當前環(huán)境是否有安裝SVN服務(wù)

# rpm -qa subversion

使用yum命令進(jìn)行SVN服務(wù)的安裝

yum -y install subversion

創(chuàng )建SVN文件夾

mkdir -p /opt/svn/repos/svn1  

創(chuàng )建SVN版本庫

svnadmin create /opt/svn/repos/svn1

修改SVN配置文件

# vim /opt/svn/repos/svn1/conf/svnserve.conf

### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
anon-access = none
auth-access = write

### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.  If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository

1-1G101114621.png

創(chuàng )建svn用戶(hù)和權限分配

passwd  此文件配置用戶(hù)賬號和密碼

# vim /opt/svn/repos/svn1/conf/passwd

### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
# harry = harryssecret
# sally = sallyssecret

username = userpassword

username為用戶(hù)名 userpassword為用戶(hù)密碼

1-1G101114621-50.png

authz  此文件配置用戶(hù)權限

1-1G101114621-51.png

啟動(dòng)SVN進(jìn)程

svnserve -d -r /opt/svn/repos  #注意目錄,不包含svn1

查看進(jìn)程

netstat –apn | grep svnserve

ps aux | grep svnserve            #查看服務(wù)是否啟動(dòng)

測試SVN服務(wù)器是否正常連接,默認情況下SVN服務(wù)器開(kāi)啟3690

svn://192.168.1.1/svn1

如果CentOS服務(wù)器有開(kāi)啟防火墻和selinux狀態(tài),請進(jìn)行關(guān)閉

將3690端口規則添加到防火墻

# service iptables status                       //查看防火墻狀態(tài)

vi  /etc/sysconfig/iptables

-A INPUT -p tcp -m tcp --dport 3690 -j ACCEPT

# service iptables stop                      //關(guān)閉防火墻
# service iptables start                     //開(kāi)啟防火墻

# vim /etc/selinux/config                   //配置selinux狀態(tài)
熱門(mén)關(guān)鍵詞: CentOS 環(huán)境 SVN服務(wù)器 安裝 配置
欄目列表
推薦內容
熱點(diǎn)內容
展開(kāi)