安装httpd

yum install httpd

查看httpd是否安装成功

httpd --version

安装svnserver

yum install subversion

查看svnserver是否安装成功

subversion --version

安装mod_dav_svn模块

yum install mod_dav_svn

安装成功后会有mod_dav_svn.so和mod_authz_svn.so两个文件

find / -name mdo_dav_svn.so

find / -name mod_authz_svn.so

创建SVN库

mkdir /var/www/svn

svndamin create /var/www/svn/project

配置权限

chown -R apache:apcahe /var/www/svn/project/

chmod 755 -R /var/www/svn/

创建用户passwd]\

touch /var/www/svn/passwd

htpasswd /var/www/svn/passwd admin

htpasswd /var/www/svn/passwd li

创建权限文件authz

cp /var/www/svn/project/conf/authz /var/www/svn/authz

vi /var/www/svn/authz

#添加下面内容

[/]

admin = rw

li = r

配置httpd

touch /etc/httpd/conf.d/subversion.conf

vi /etc/httpd/conf.d/subversion.conf

<Location /svn>

     Dav svn

    SVNParentPath /var/www/svn

    AuthYype Basic

    AuthName "Authorization SVN"

    AuthzSVNAccessFile /var/www/svn/authz

    AuthUserFile /var/www/svn/passwd

    Require vaild-user

<Location>

启动httpd

systemctl start httpd.service