您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 销售管理 > 在OpenSUSE上搭建基于Web的SVN服务器
SVNWebserveroverOpenSUSE在OpenSUSE系统上搭建SVNWeb服务器版本信息OS:OpenSUSE-11.1kernel2.6.27.21-0.1-paeSVNServer:subversion-1.6.15WebServer:httpd-2.2.17Perl:perl-v5.10.0builtfori586-linux-thread-multi搭建过程准备WebServer参见在openSUSE系统上搭建Apache2服务器准备SVNServer安装。参见在openSUSE系统上搭建SVN服务器为SVN创建系统用户组/用户ian@pub-laptop-ian:~sudo/usr/sbin/groupadd-rsvnian@pub-laptop-ian:~sudo/usr/sbin/useradd-r-gsvn-d/srv/svn-s/bin/falsesvn创建存放SVN库的目录ian@pub-laptop-ian:~sudomkdir/home/SVN创建存放SVN库testian@pub-laptop-ian:~sudomkdir/home/SVN/testian@pub-laptop-ian:~sudosvnadmincreate/home/SVN/testian@pub-laptop-ian:~sudochown集成SVN至Web服务Apache配置在/usr/local/apache2/conf/http.conf文件结尾,追加如下内容#Configurationforasubversionrepository#see/usr/share/doc/packages/subversionforthefulldocumentation#IfModulemod_dav_svn.cLocation/repos/testDAVsvnSVNPath/home/SVN/test#Limitwritepermissiontolistofvalidusers.LimitExceptGETPROPFINDOPTIONSREPORT#RequireSSLconnectionforpasswordprotection.#SSLRequireSSLAuthTypeBasicAuthNameWriteaccessrequiresapasswordAuthUserFile/srv/svn/user_access/test_passwdfileRequirevalid-user/LimitExcept/Location/IfModule注意:更改配置之后,需要重启Apache。设置SVN访问权限ian@pub-laptop-ian:~sudomkdir/srv/svnian@pub-laptop-ian:~sudomkdir/srv/svn/user_accessian@pub-laptop-ian:~sudotouch/srv/svn/user_access/test_passwdfileian@pub-laptop-ian:~sudochownroot:@pub-laptop-ian:~sudochmod640/srv/svn/user_access/test_passwdfileian@pub-laptop-ian:~sudo/usr/local/apache2/bin/htpasswd/srv/svn/user_access/test_passwdfileian基本测试在如下环境的下,进行了浏览(无需授权)和提交(需要授权):svnoveropenSUSE-11.1TortoiseSVNoverWin32在如下环境的下,进行了浏览(无需授权):IEoverWin32Chrome-8.0.552.224overopenSUSE-11.1Firefox/3.0.8GTB7.1overopenSUSE-11.1高级访问控制参考关闭匿名浏览在http.conf中,去除LimitExcept项。最终结果如下:IfModulemod_dav_svn.cLocation/repos/testDAVsvnSVNPath/home/SVN/testAuthTypeBasicAuthNameSVNRepositoryfortestAuthUserFile/srv/svn/user_access/test_passwdfileRequirevalid-user/Location/IfModule按目录授权配置定义授权控制描述于文件/home/SVN/test/conf/authz。具体内容如下:[aliases][groups]g_admin=iang_all=xfy,jyz,ian[/]@g_admin=rw[/trunk]@g_all=r[/share]@g_all=rw[/private]ian=r[/private/rpp]ian=rwxfy=rjyz=r[/private/mbb]ian=rwjyz=rw[/private/wtt]xfy=rw[/private/uii]xfy=rw在http.conf中,使用AuthzSVNAccessFile指定/home/SVN/test/conf/authz为授权控制文件。最终结果如下:IfModulemod_dav_svn.cLocation/repos/testDAVsvnSVNPath/home/SVN/testAuthTypeBasicAuthNameSVNRepositoryfortestAuthUserFile/srv/svn/user_access/test_passwdfileAuthzSVNAccessFile/home/SVN/test/conf/authz#PerlAuthenHandlerIpAuthRequirevalid-user/Location/IfModule测试拥有管理员身份的ian,可以读取整个库。(写未测试)ian@Suse-hww:~svn--usernameianco:Awebsvn-test/shareAwebsvn-test/trunkAwebsvn-test/trunk/test.cAwebsvn-test/trunk/new_from_win32.txtAwebsvn-test/privateAwebsvn-test/private/uiiAwebsvn-test/private/uii/uii_by_ian.txtAwebsvn-test/private/mbbAwebsvn-test/private/rppAwebsvn-test/private/wttAwebsvn-test/private/wtt/from_xfy.txtCheckedoutrevision6.对根目录没有任何权限的jzy,不能读取整个库。ian@Suse-hww:~rm-rfwebsvn-test/ian@Suse-hww:~svn--usernamejyzco::svn:Serversentunexpectedreturnvalue(403Forbidden)inresponsetoOPTIONSrequestfor'对/trunk具有只读权限、对/share具有读写权限的jzy,可以读取这2个目录。ian@Suse-hww:~mkdirwebsvn-testian@Suse-hww:~svn--usernamejyzco::Awebsvn-test/trunk/test.cAwebsvn-test/trunk/new_from_win32.txtCheckedoutrevision6.ian@Suse-hww:~svn--usernamejyzco对/private没有任何权限的jzy,不能读取该目录。ian@Suse-hww:~svn--usernamejyzco:Serversentunexpectedreturnvalue(403Forbidden)inresponsetoOPTIONSrequestfor'对/private/rpp具有只读权限、对/private/rpp具有读写权限的jzy,可以读取这2个目录。ian@Suse-hww:~mkdirwebsvn-test/privateian@Suse-hww:~svn--usernamejyzco@Suse-hww:~svn--usernamejyzco对/private/wtt、/private/uii没有任何权限的jzy,不能读取这2个目录。ian@Suse-hww:~svn--usernamejyzco:Serversentunexpectedreturnvalue(403Forbidden)inresponsetoOPTIONSrequestfor'@Suse-hww:~svn--usernamejyzco:Serversentunexpectedreturnvalue(403Forbidden)inresponsetoOPTIONSrequestfor'对/private/mbb具有读写权限的jzy,可以写入该目录。ian@Suse-hww:~cattextfromjyzwebsvn-test/private/mbb/from_jyz.txtcat:textfromj
本文标题:在OpenSUSE上搭建基于Web的SVN服务器
链接地址:https://www.777doc.com/doc-2600835 .html