Linux下SVN服务器的安装与配置(2)

# touch passwd # htpasswd -c /data/passwd admin    //创建用户admin,并为其设置密码 # cat passwd >> /data/svn/project/conf/passwd
# vim /data/svn/project/conf/passwd  //注释admin的明文账户

#admin = admin

3,在apache的配置文件中添加下面这些内容,以便支持SVN服务

# vim /etc/httpd/conf/httpd.conf

 

<Location /project> DAV svn SVNPath /data/svn/project/ AuthType Basic AuthName "svn for project" AuthUserFile /data/svn/project/conf/passwd AuthzSVNAccessFile /data/svn/project/conf/authz Satisfy all Require valid-user </Location>

重启svn、httpd服务
# ps -ef |grep svnserve
# kill -9 3994
# svnserve -d -r /data/svn
# service httpd restart

4,客户端测试

这样用Windows的svn客户端或者浏览器测试

浏览器测试:

Windows客户端测试:

安装TortoiseSVN----->在桌面右击鼠标----->TortoiseSVN----->版本库浏览器(R)----->>账号密码----->确定

注意:输入账号或密码就可以了(密码为http支持的格式非明文)

===========================================================================================================================================================================================================================================
===========================================================================================================================================================================================================================================

四、添加删除版本库

先把httpd停掉,再给passwd添加一个明文用户,设置authz的权限

Linux下SVN服务器的安装与配置

# service httpd stop Stopping httpd: [ OK ] # vim /data/svn/project/conf/passwd : : [users] # harry = harryssecret # sally = sallyssecret #admin = 123456 test = test admin:uyvcrbGbdBPuk : : # vim /data/svn/project/conf/authz : : [groups] [/] admin = rw test = rw * = : : # ps -ef |grep svn root 4032 1 0 15:14 ? 00:00:00 svnserve -d -r /data/svn root 25723 3556 0 16:35 pts/1 00:00:00 grep svn # kill -9 4032 # svnserve -d -r /data/svn # svn ls svn://192.168.5.10/project Authentication realm: <svn://192.168.5.10:3690> d72f34c5-d386-4d19-bc8b-9e5192737eee Password for 'admin': Authentication realm: <svn://192.168.5.10:3690> d72f34c5-d386-4d19-bc8b-9e5192737eee Username: test Password for 'test': ----------------------------------------------------------------------- ATTENTION! Your password for authentication realm: <svn://192.168.5.10:3690> d72f34c5-d386-4d19-bc8b-9e5192737eee can only be stored to disk unencrypted! You are advised to configure your system so that Subversion can store passwords encrypted, if possible. See the documentation for details. You can avoid future appearances of this warning by setting the value of the 'store-plaintext-passwords' option to either 'yes' or 'no' in '/root/.subversion/servers'. ----------------------------------------------------------------------- Store password unencrypted (yes/no)? yes client/ server/ test/ # svn delete svn://192.168.5.10/progect/client -m "delete" svn: No repository found in 'svn://192.168.5.10/progect/client' # svn delete svn://192.168.5.10/project/client -m "delete" Committed revision 2. # svn delete svn://192.168.5.10/project/server -m "delete" Committed revision 3. # svn delete svn://192.168.5.10/project/test -m "delete" Committed revision 4. # svn mkdir -m "UP" svn://192.168.5.10/project/union Committed revision 5. # svn mkdir -m "UP" svn://192.168.5.10/project/wangyi Committed revision 6. # vim /data/svn/project/conf/passwd [users] # harry = harryssecret # sally = sallyssecret #admin = 123456 test = test admin:uyvcrbGbdBPuk # ps -ef |grep svn root 25725 1 0 16:35 ? 00:00:00 svnserve -d -r /data/svn root 25759 3556 0 16:40 pts/1 00:00:00 grep svn # kill -9 25725 # svnserve -d -r /data/svn # service httpd start Starting httpd: [ OK ]

详细步骤,请打开查看

上传文件到svn版本库 file目录下的文件是其它服务器的备份文件 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/a2a287e659b8fb8b961463aebca39b77.html