centos6.x svn搭建

yuminstallsubversion-y

[root@centos01~]#mkdir-p/application/svndata#数据存储目录
[root@centos01~]#mkdir-p/application/svnpasswd#用户密码目录
[root@centos01~]#svnserve-d-r/application/svndata/
[root@centos01~]#ps-ef|grepsvn
root60411008:39?00:00:00svnserve-d-r/application/svndata/
root60435612008:39pts/000:00:00grepsvn
[root@centos01~]#netstat-lntup|grep3690
tcp000.0.0.0:36900.0.0.0:*LISTEN6041/svnserve
[root@centos01~]#
#########################################
#创建版本库
[root@centos01~]#svnadmincreate/application/svndata/daima
[root@centos01~]#tee/application/svndata/daima/
tee:/application/svndata/daima/:Isadirectory
^C
[root@centos01~]#tree/application/svndata/daima/
/application/svndata/daima/
├──conf
│├──authz
│├──passwd
│└──svnserve.conf
├──db
│├──current
│├──format
│├──fsfs.conf
│├──fs-type
│├──min-unpacked-rev
│├──rep-cache.db
│├──revprops
││└──0
││└──0
│├──revs
││└──0
││└──0
│├──transactions
│├──txn-current
│├──txn-current-lock
│├──txn-protorevs
│├──uuid
│└──write-lock
├──format
├──hooks
│├──post-commit.tmpl
│├──post-lock.tmpl
│├──post-revprop-change.tmpl
│├──post-unlock.tmpl
│├──pre-commit.tmpl
│├──pre-lock.tmpl
│├──pre-revprop-change.tmpl
│├──pre-unlock.tmpl
│└──start-commit.tmpl
├──locks
│├──db.lock
│└──db-logs.lock
└──README.txt

10directories,28files
#修改配置文件
[root@centos01~]#cd/application/svndata/daima/conf/
[root@centos01conf]#ls
authzpasswdsvnserve.conf
[root@centos01conf]#catsvnserve.conf
###Thisfilecontrolstheconfigurationofthesvnservedaemon,ifyou
###useittoallowaccesstothisrepository.(Ifyouonlyallow
###accessthroughhttp:and/orfile:URLs,thenthisfileis
###irrelevant.)

###Visithttp://subversion.tigris.org/formoreinformation.

[general]
###Theseoptionscontrolaccesstotherepositoryforunauthenticated
###andauthenticatedusers.Validvaluesare"write","read",###and"none".Thesamplesettingsbelowarethedefaults.
anon-access=none
auth-access=write
###Thepassword-dboptioncontrolsthelocationofthepassword
###databasefile.Unlessyouspecifyapathstartingwitha/,###thefile'slocationisrelativetothedirectorycontaining
###thisconfigurationfile.
###IfSASLisenabled(seebelow),thisfilewillNOTbeused.
###Uncommentthelinebelowtousethedefaultpasswordfile.
password-db=/application/svnpasswd/passwd
###Theauthz-dboptioncontrolsthelocationoftheauthorization
###rulesforpath-basedaccesscontrol.Unlessyouspecifyapath
###startingwitha/,thefile'slocationisrelativetothethe
###directorycontainingthisfile.Ifyoudon'tspecifyan
###authz-db,nopath-basedaccesscontrolisdone.
###Uncommentthelinebelowtousethedefaultauthorizationfile.
authz-db=/application/svnpasswd/authz
###Thisoptionspecifiestheauthenticationrealmoftherepository.
###Iftworepositorieshavethesameauthenticationrealm,theyshould
###havethesamepassworddatabase,andviceversa.Thedefaultrealm
###isrepository'suuid.
#realm=MyFirstRepository

[sasl]
###ThisoptionspecifieswhetheryouwanttousetheCyrusSASL
###libraryforauthentication.Defaultisfalse.
###ThissectionwillbeignoredifsvnserveisnotbuiltwithCyrus
###SASLsupport;tocheck,run'svnserve--version'andlookforaline
###reading'CyrusSASLauthenticationisavailable.'
#use-sasl=true
###Theseoptionsspecifythedesiredstrengthofthesecuritylayer
###thatyouwantSASLtoprovide.0meansnoencryption,1means
###integrity-checkingonly,valueslargerthan1arecorrelated
###totheeffectivekeylengthforencryption(e.g.128means128-bit
###encryption).Thevaluesbelowarethedefaults.
#min-encryption=0
#max-encryption=256

[root@centos01conf]#diffsvnserve.confsvnserve.conf.bak
12,13c12,13
<anon-access=none
<auth-access=write
---
>#anon-access=read
>#auth-access=write
20c20
<password-db=/application/svnpasswd/passwd
---
>#password-db=passwd
27c27
<authz-db=/application/svnpasswd/authz
---
>#authz-db=authz
#拷贝认证文件模板
[root@centos01conf]#pwd
/application/svndata/daima/conf
[root@centos01conf]#ls
authzpasswdsvnserve.confsvnserve.conf.bak
[root@centos01conf]#cppasswdauthz/application/svnpasswd/
[root@centos01conf]#

[root@centos01conf]#cd/application/svnpasswd/
[root@centos01svnpasswd]#ll
total8
-rw-r--r--.1rootroot1080Dec2909:00authz
-rw-r--r--.1rootroot309Dec2909:00passwd
[root@centos01svnpasswd]#chmod700*
[root@centos01svnpasswd]#ll
total8
-rwx------.1rootroot1080Dec2909:00authz
-rwx------.1rootroot309Dec2909:00passwd
[root@centos01svnpasswd]#

#创建用户并授权访问指定项目版本库
[root@centos01svnpasswd]#ll
total8
-rwx------.1rootroot1080Dec2909:00authz
-rwx------.1rootroot309Dec2909:00passwd
[root@centos01svnpasswd]#vimpasswd
[root@centos01svnpasswd]#catpasswd
###Thisfileisanexamplepasswordfileforsvnserve.
###Itsformatissimilartothatofsvnserve.conf.Asshowninthe
###examplebelowitcontainsonesectionlabelled[users].
###Thenameandpasswordforeachuserfollow,oneaccountperline.

[users]
#harry=harryssecret
#sally=sallyssecret
admin=admin
yancong=yancong


[root@centos01svnpasswd]#catauthz
###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

[daima:/]
admin=rw
yancong=r

[root@centos01svnpasswd]#ps-ef|grepsvn
root60411008:39?00:00:00svnserve-d-r/application/svndata/
root609556121009:26pts/000:00:00grepsvn
[root@centos01svnpasswd]#kill6041
[root@centos01svnpasswd]#ps-ef|grepsvn
root60975612009:26pts/000:00:00grepsvn
[root@centos01svnpasswd]#ls
authzpasswd
[root@centos01svnpasswd]#svnserve-d-r/application/svndata/
[root@centos01svnpasswd]#ps-ef|grepsvn
root61001009:27?00:00:00svnserve-d-r/application/svndata/
root61025612009:27pts/000:00:00grepsvn
[root@centos01svnpasswd]#

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim&#160;/etc/sysconfig/network-scripts/ifcfg-eth0 B...