linux搭建svn+apache

来源:互联网 发布:注册网络域名诈骗 编辑:程序博客网 时间:2024/05/02 05:04

如果只是搭建通过svn://ip/***访问的svn服务器,则不需要apache,但是这种情况下,账号的密码是明文的。

方法:

1、yum install subversion;

2、mkdir -p /export/repos;

3、svnadmin create /export/repos/test;

4、进入 /export/repos/test/conf下修改三个文件:


passwd文件:
添加一个形如“username=password"的条目就可以了;svnserve.conf文件:
[general]
                        anon-access = none
                        auth-access = write
                        password-db = passwd
                        authz-db = authzauthz文件:
[groups]
admin = me

[au/]
@admin = rw5、svnserve -d -r /export/repos;启动服务

6、svn://ip/test可以访问;


如果要搭建http访问的svn服务器,需要结合apache服务器,要安装httpd,具体过程省略,这种情况下密码是密文的。这时上述的test/conf下的三个文件不再生效,另外,通过svnadmin create创建的目录,必须用chown -R apache:apache 目录名   修改文件夹归属,否则提交或者add都会失败,此时用/etc/svn-access-file 和 /etc/svn-auth-file控制访问权限,用安装的apache/bin/htpasswd命令将明文密码转成密文写到svn-auth-file中。

命令:htpasswd -b /etc/svn-auth-file 账号名 密码

这样密码密文自动写到/etc/svn-auth-file中。


0 0