1、yum安装下列的一些包:
[root@Hui ~]# yum install apr apr-util httpd httpd-devel subversion mod_dav_svn
[root@Hui ~]# mkdir -p /code/svndata
[root@Hui ~]# svnadmin create /code/svndata/svn
[root@Hui ~]# htpasswd -cm /code/svndata/svn/passwd admin [root@Hui ~]# htpasswd -m /code/svndata/svn/passwd hui
</pre><p><pre name="code" class="plain">[root@Hui ~]# vi /code/svndata/svn/conf/authz [groups] # harry_and_sally = harry,sally administrator = admin,john [/] @administrator = rw * =
正常安全以上软件后,会在/etc/httpd/modules目录下生成mod_dav_svn.so、mod_authz_svn.so两个模块
6、配置apache的httpd.conf
[root@Hui ~]# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak打开apache的conf/httpd.conf
[root@Hui ~]# vi /etc/httpd/conf/httpd.conf添加以下内容:
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so <Location /svn> DAV svn SVNPath /code/svndata/svn AuthzSVNAccessFile /code/svndata/svn/conf/authz AuthType Basic AuthName "Welcome to SVN" AuthUserFile /code/svndata/svn/passwd Require valid-user </Location>设置权限
[root@Hui ~]# chown -R apache:apache /code/svndata/svn/ [root@Hui ~]# chmod -R 755 /code/svndata/svn/
[root@Hui ~]# vi /etc/selinux/config 修改SELINUX=disabled 保存(不重启Linux服务器关闭SeLinux的方法 # setenforce 0 )
8、关闭防火墙:
[root@Hui ~]# /etc/init.d/iptables stop
[root@Hui ~]# service httpd start