主机知识库
分享服务器知识

怎么在Linux中安装SVN服务端

怎么在Linux操作系统操作系统中安装版本控制服务端?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面本站将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

什么是Linux系统

Linux是一种免费使用和自由传播的类一种多用户的计算机操作系统操作系统,是一个基于可移植性操作系统接口的多用户、多任务、支持多线程和多中央处理器的操作系统,使用Linux操作系统操作系统能运行主要的Unix操作系统操作系统工具软件、应用程序和网络协议。

一、yum 安装

yuminstallsubversion二、配置

1、创建仓库

我们在/home下建立一个名为版本控制的仓库(存储库),以后所有代码都放在这个下面,创建成功后在版本控制下面多了几个文件夹。

[root@localhost/]#cd/home

[root@localhosthome]#mkdirsvn

[root @ localhosthome]# svnadmincreate/home/SVN

[root@localhosthome]#lssvn

confdbfformahooksolcksreadme。txt配置文件夹,是存放配置文件的

[root @ localhosthome]# cdsvn/conf

[root@localhostconf]#ls

authzpasswdsvnserve.confauthz是权限控制文件

修改密码是帐号密码文件

svnserve.conf是版本控制服务配置文件

2、配置passwd 文件

[root@localhostconf]#vimpasswd

# # #此文件是passwordfileforsvserve示例.

# # #它的格式是formatismisilartotofsvserve。糖膏剂如中所示

# # #范例下面包含一个标有[用户]的部分.

# # # nanismaindpasworforeachuserrow,oneaccountperline .

[用户]

#harry=harryssecret

# sally=sallyssecret

user1=123456

用户2=123456怎么在Linux中安装SVN服务端

3、配置authz

[root@localhostconf]#vimauthz

# # #此文件是示例授权文件。

# # # ItformatisidenticalTotafmod _ authz _ svnauthorization

# # #文件。

# # #如幻灯片所示,详细说明和

###(可选)还原由sectionname指定的torys .

# # #授权如下。授权行可以参考:

# # #-作为用户,

# # #-agrupoufsdefinendinaspecial[group]部分,

# # #-analiansdefinedinaspecial[别名]部分,

# # #-所有经过身份验证的用户,使用” $authenticated “令牌,

# # #-仅匿名用户,使用” $匿名”标记,

# # #-任何人,使用’ * ‘通配符。

###

# # # amatchcandebreffixingtheulewith ‘ ~ ‘ .Rulescan

###grantread(‘r ‘)访问,读写(“rw”)访问,或不访问

###(”).

[别名]

#joe=/C=XZ/ST=Dess

ert/L=SnakeCity/O=SnakeOil,Ltd./OU=ResearchInstitute/CN=JoeAverage
[groups]
#harry_and_sally=harry,sally
#harry_sally_and_joe=harry,sally,&joe
#[/foo/bar]
#harry=rw
#&joe=r
#*=
#[repository:/baz/fuz]
#@harry_and_sally=rw
#*=r
[/]
user1=rw
user2=r
*=
~

怎么在Linux中安装SVN服务端

4、配置svnserve.conf

[root@localhostconf]#vimsvnserve.conf
###Thisfilecontrolstheconfigurationofthesvnservedaemon,ifyou
###useittoallowaccesstothisrepository.(Ifyouonlyallow
###accessthroughhttp:and/orfile:URLs,thenthisfileis
###irrelevant.)
###Visithttp://subversion.apache.org/formoreinformation.
[general]
###Theanon-accessandauth-accessoptionscontrolaccesstothe
###repositoryforunauthenticated(a.k.a.anonymous)usersand
###authenticatedusers,respectively.
###Validvaluesare"write","read",and"none".
###Settingthevalueto"none"prohibitsbothreadingandwriting;
###"read"allowsread-onlyaccess,and"write"allowscomplete
###read/writeaccesstotherepository.
###Thesamplesettingsbelowarethedefaultsandspecifythatanonymous
###usershaveread-onlyaccesstotherepository,whileauthenticated
###usershavereadandwriteaccesstotherepository.
anon-access=read
auth-access=write
###Thepassword-dboptioncontrolsthelocationofthepassword
###databasefile.Unlessyouspecifyapathstartingwitha/,
###thefile'slocationisrelativetothedirectorycontaining
###thisconfigurationfile.
###IfSASLisenabled(seebelow),thisfilewillNOTbeused.
###Uncommentthelinebelowtousethedefaultpasswordfile.
password-db=passwd
###Theauthz-dboptioncontrolsthelocationoftheauthorization
###rulesforpath-basedaccesscontrol.Unlessyouspecifyapath
###startingwitha/,thefile'slocationisrelativetothethe
###directorycontainingthisfile.Ifyoudon'tspecifyan
###authz-db,nopath-basedaccesscontrolisdone.
###Uncommentthelinebelowtousethedefaultauthorizationfile.
authz-db=authz
###Thisoptionspecifiestheauthenticationrealmoftherepository.
###Iftworepositorieshavethesameauthenticationrealm,theyshould
###havethesamepassworddatabase,andviceversa.Thedefaultrealm
###isrepository'suuid.
#realm=MyFirstRepository
realm=/home/svn
###Theforce-username-caseoptioncausessvnservetocase-normalize
###usernamesbeforecomparingthemagainsttheauthorizationrulesinthe
###authz-dbfileconfiguredabove.Validvaluesare"upper"(toupper-
###casetheusernames),"lower"(tolowercasetheusernames),and
###"none"(tocompareusernamesas-iswithoutcaseconversion,which
###isthedefaultbehavior).
#force-username-case=none
[sasl]
###ThisoptionspecifieswhetheryouwanttousetheCyrusSASL
###libraryforauthentication.Defaultisfalse.
###ThissectionwillbeignoredifsvnserveisnotbuiltwithCyrus

怎么在Linux中安装SVN服务端

最后一行的realm记得改成你的svn目录打开注释时切记前面不要留有空格

三、启动与停止

[root@localhostconf]#svnserve-d-r/home/svn(启动)
[root@localhostconf]#killallsvnserve(停止)

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注亿速云行业资讯频道,感谢您对亿速云的支持。

(服务器内容来源于IDC同行,若侵权,请联系我们删除)

赞(0)
文章名称:《怎么在Linux中安装SVN服务端》
文章链接:https://www.cmy.cn/host/10660.html
版权声明:茶猫云所有发布的内容,部分为原创文章,转载请注明来源!网络转载文章如有侵权请联系我们解决!
最新优惠:茶猫云VPS服务器