Linux下安装SVN服务端的方法步骤
一、yum安装
yuminstallsubversion
二、配置
1、创建仓库
我们在/home下建立一个名为svn的仓库(repository),以后所有代码都放在这个下面,创建成功后在svn下面多了几个文件夹。
[root@localhost/]#cd/home [root@localhosthome]#mkdirsvn [root@localhosthome]#svnadmincreate/home/svn [root@localhosthome]#lssvn confdbformathookslocksREADME.txt
conf文件夹,是存放配置文件的
[root@localhosthome]#cdsvn/conf [root@localhostconf]#ls authzpasswdsvnserve.conf
- authz是权限控制文件
- passwd是帐号密码文件
- svnserve.conf是SVN服务配置文件
2、配置passwd文件
[root@localhostconf]#vimpasswd ###Thisfileisanexamplepasswordfileforsvnserve. ###Itsformatissimilartothatofsvnserve.conf.Asshowninthe ###examplebelowitcontainsonesectionlabelled[users]. ###Thenameandpasswordforeachuserfollow,oneaccountperline. [users] #harry=harryssecret #sally=sallyssecret user1=123456 user2=123456
3、配置authz
[root@localhostconf]#vimauthz ###Thisfileisanexampleauthorizationfileforsvnserve. ###Itsformatisidenticaltothatofmod_authz_svnauthorization ###files. ###Asshownbeloweachsectiondefinesauthorizationsforthepathand ###(optional)repositoryspecifiedbythesectionname. ###Theauthorizationsfollow.Anauthorizationlinecanreferto: ###-asingleuser, ###-agroupofusersdefinedinaspecial[groups]section, ###-analiasdefinedinaspecial[aliases]section, ###-allauthenticatedusers,usingthe'$authenticated'token, ###-onlyanonymoususers,usingthe'$anonymous'token, ###-anyone,usingthe'*'wildcard. ### ###Amatchcanbeinvertedbyprefixingtherulewith'~'.Rulescan ###grantread('r')access,read-write('rw')access,ornoaccess ###(''). [aliases] #joe=/C=XZ/ST=Dessert/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 *= ~
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
最后一行的realm记得改成你的svn目录
打开注释时切记前面不要留有空格
三、启动与停止
[root@localhostconf]#svnserve-d-r/home/svn(启动) [root@localhostconf]#killallsvnserve(停止)
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。