还剩4页未读,继续阅读
文本内容:
的库实时同步至的库中Ulindow SVNLinux SVN热备份Svnadmin hotcopy将源库安全的备份到备份库为源库路径及库名#svnadmin hotcopypath/to/repo path/to/backup-clean-logs#path/to/repo为备份库路径及库名path/to/backup删除不使用的日志-clean-logs Berkeleydb备份Svnsync本文中设备笔记本库Window Lenovoy400ip:
10.
16.
122.49d:/Repositories/MyRepositoryOl虚拟机库VMware Centos
6.7ip
192.
168.
193.100/repo/svn/svn-mirror本文做备份采用的提供的命令,这种方式备份其实就是做镜像,备份服SVN Serversvnsync务器上安装即可提供服务SVN ServerSubVersion svn因为使用的是不同服务器间的同步,所以,靠网络传输时候,如果数据量巨大,对网络的要求高需准备工作windows更改服务器上的同步库配置文件1window进入安装时配置的的仓库目录新建SVN ServerD:\Repositories\MyRepository01\hooks并编辑,加入post-commit.batsvnsync sync--non-interactive--username adminl--password123456注参数-为非交互模式-non-interactive和为能通过认证的用户名和密码username passwordsvn为服务器的
192.
168.
193.100Linux ip(打开注册表)2win+r-regedit(位)
1.for32-bit system32[HKEY_LOCAL_MACHINE\SOFTWARE\VisualSVN\VisualSVN Server]添加“CreateGnuTLSCompatibleCertif icate”=dword:00000001(位)
2.for64-bit system64[HKEY_L0CAL_MACHINE\S0FTlAlARE\Wow6432Node\VisualSVN\VisualSVN Server]添加C reateGnuTLSCompatibleCertificate=dword:00000001主丘表编辑器文件F编辑E查看V收藏夹A帮助HRealtekSemiconductor Corp.名称艇RegisteredApplications回默认数值未设置SoftEther ProjectREG_SZCreateGnuTLSCompatibleCertificatef,REG_SZ dword:00000001,…[SogouComponents亚InstallDir REG_SZ C:\ProgramFiles\VisualSVr:••…[Sogoulnput亚|License REG_SZSSH CommunicationsSecurity型]RepositoriesRoot REG_SZ D:\Repositories\,・[TBSec州RepositoriesURLPrefix REG_SZ/svn TencentabjServerNameREG_SZ》.・[ThinPrint西ServerPort REG_SZ80Thunder Network型]SSLServerPort REG_SZ443TortoiseOverlaysTortoiseSVN UseServerBindingsREG_SZ0UCBrowserPID abjUseSSLREG_SZ0VisualSVN W]UseWind owsAuth REG_SZ0VisualSVN RepositoryConfigurator^]VdfsAdminSD REG_SZ O:BAG:BAD:A;;FA;;;BAA;;FVisualSVN Server^]VdfsReplicationPartnersSID REG_SZ S-1-5-21-1268542917-128-》VMware,Inc.-QVolatile•Wow6432NodeL”L xiguaISYSTEML—■-LHKEY_USERSHKEY_CURRENT_CONFIGi4-W*n\UVCV K^ArUIMCXCrtCTlA/AOCXlAr^lArC^OOKI^c-上打开选window VisualSVNServer Manager择操作如下图Action-Properties VisualSVNServerPropertiesAuthentication Logging Security WebInterfaceNetworkLicensing StorageCertificateServer name:Server port:80去揖耳;幺无二□Use secureconnectionhttps:/Repositories URLhttp://yao-pc/svn/Customize...Server Binding@All IPaddressesO TheseIPaddresses:确定取消应用AVisualSVN ServerProperties确定取消应用A jChangeServer CertificateAuthenticationLoggingSecurityWeb InterfaceCertificateLicensingStorage NetworkActionSelectwhat youwant todo withthe servercertificate.CertificateInformationIssuedto:yao-pcIssuedby:yao-pcValidfrom2016/5/25to2026/5/23@Creaftwaexsr^elf-signedcertificateNew certificatewill besigned bythis computerand willnot beautomatically triView...Changecertificate...dients.Userswill havetomanuallyaccept theservercertificate.OPreparecertificaterequest»Thecertificateisnotusedbecausethesecureconnectionhttps://isnotenabled.Certificaterequestcan besenttoacertificationauthoritytoobtaina signedOCompletecertificaterequestUsethisoptiontoimportcertificatereceivedfromcertificationauthorityinresyourcertificaterequest.OImportsignedcertificatewiththeprivate keyUsethisoptiontoimport andinstallexisting certificate^iMtfrthe^corresponding上一步B下一^N Learnmoreabout servercertificates直至创建结束self-signed certificate注如果没有上述的准备的话在上执行下面的linux svnsync init候,会报file:////usr/backuprepohttp://yao-pc/svn/MyRepository01/SSL handshakefailed:SSL错误的错,因为在生成鉴权数Key usageviolation incertificate hasbeen detectedvirtual svn据的时候使用了一个插件,而这个插件是支持的,但是不支持OpenSSL GrwTls服务器端操作创建用户和用户组重要Linux1,Linux此用户是使用协议访问库的认证用户http svn#groupadd admin#useradd adminl-g admin#passwd adminl服务器中安装2,linux SubVersion命令#yum installsubversion#为了协议访问库,默认只能#yum installmod_dav_svn httphttp://ip/repo svn svn://ip/repo形式创建版本库随意取名3,svn-mirror#创建存放库的根目录#mkdir-p/repo/svnsvn#svnadmin create/repo/svn/svn-mirror将授权给用户及其组4/repo adminl配置备份的钩子#chown-R adminl:admin/repo5,SVNLinux pre-revprop-change hook#cd/repo/svn/svn-mirror/hooks#cp pre-revprop-change.tmpl pre-revprop-change#chmod+x pre-revprop-change#vim pre-revprop-change清空并添加如下脚本#!/bin/shUSER=$3”if[”$USER”=adminl”];then exit0;fiecho Onlythe adminluser maychange revisionproperties2exit1配置备份的(可选,但建议配上)6,SVN start-commit hook#cp start-commit.tmpl start-commit#chmod+x start-commit#vim start-commit清空并添加如下脚本#!/bin/shUSER=$2”if[”$USER”=adminl];then exit0;fiecho Onlythe adminluser maychange revisionproperties2exit1注建议步骤可以先忽略,待至第二部分配置的访问结束后再初始化和同步以7,8,9svn http及启动初始化备份7,SVN#svnsync init同步版本库8,#svnsync syncfile:////repo/svn/svn-mirror启动9,svn server为根目录即创建版本仓库的目录#svnserve-d-r/repo/svn#/usr svnsvn-mirror参数可以指定端口默认--listen-port36913690配置的访问svn http编辑1httpd.conf#vim/etc/httpd/conf/httpd.conf#去掉前面的#号ServerName localhost:80#将用户名更改为为了下文启动时User adminladminl roothttpd候用运行adminl#将组名更改为Group adminadmin编辑配置文件2subversion.conf#vim/etc/httpd/conf.d/subversion.conf增加Location/svn-mirrorDAV svn#前文创建的版本库SVNPath/repo/svn/svn-mirror/Location添加用户认证3在上一步中浏览器访问时候任何人都可以匿名访问,并且拥有写入,读取,删除权限,这不安全,下面配置用户写入时需认证#mkdir-p/etc/svn#htpasswd-c/etc/svn/svnusers.conf adminlNewpassword:Re-type newpassword:Adding passwordfor useradminl修改上文步骤中配置的文件42subversion.confLocation/reposDAV svn#库路径SVNPath/repo/svn/svn-mirror#对库的写权限需要用户认证,访问读取时不受限制的#对所有请求都认证可以去掉LimitExcept GETPROPFIND OPTIONSREPORT标签LimitExcept#使用用户名和密码认证AuthType Basic#认证对话框中提示信息AuthName AuthorizationRealm#认证用户的文件路径AuthllserFile/etc/svn/svnusers.conf#只有认证正确才能访问库svnRequire valid-user/LimitExcept/Location开启服务5httpd用户启动#apachectl start#root浏览器访问http://
192.
168.
193.100/svn-mirror注为中酉己置的svn-mirror subversion.conf Location/svn-mirror更改酉己置6/home/adminl/.subvers ion/servers#vim/home/adminl/.subversion/servers#将前面的#号放开,并改为,为了取消在同步时候需要互动(手动填写提示信息)yesstore-plaintext-passwords=yes(初始化库上执行)7svn Linux#su-adminl同步库#svnsyncinit--username adminl--password1234568svn#svnsync sync--username adminl--password123456测试新建任意文件提交至库中,检查库中的文件是否已经更新MyRepositoryOl svn-mirror。
个人认证
优秀文档
获得点赞 0