Server environment:
The script is as follows:
#!/bin/Bashyum Install wget-YMV/etc/etc/yum.repos.d/*. Repo/tmpwget-o/etc/yum.repos.d/centos-base.repoHttp://mirrors.aliyun.com/repo/Centos-6.repoWget-o/etc/yum.repos.d/epel.repoHttp://mirrors.aliyun.com/repo/epel-6.repoYum clean allchkconfig iptables off/etc/init.d/iptables stopsed-i '/selinux/s/enforcing/disabled/'/etc/selinux/ Configsetenforce 0sed-i ' #UseDNS yes/usedns no/g '/etc/ssh/sshd_configecho ' ntpdate ntp1.aliyun.com '
Ntpdate Ntp1.aliyun.comecho '*/5* * * * */usr/sbin/ntpdate ntp1.aliyun.com'>>/var/spool/cron/rootchmod -/var/spool/cron/Rootyum Install httpd httpd-devel Subversion MOD_DAV_SVN Ntpdate-Yecho"Start creating directories and configuration Files"mkdir-p/etc/subversion && cd/etc/subversion && Touch svn-authz.conf svn-Userecho"To start creating a version library"mkdir-p/home/svndata && chown-r apache.apache/home/svndata && svnadmin Create/home/svndata/department_ Server && chown-r apache.apache/home/svndata/Department_serverecho"Start configuration file"Cat<<eof >/etc/subversion/svn-Authz.conf[groups]admin=Liuhuihuangmygirl=wangchenyan[/]liuhuihuang=RW* =R EOFif[$?-eq0];then Echo"Configure Success"Fiecho"start backing up the subversion.conf configuration file and emptying the configuration file"CP/etc/httpd/conf.d/subversion.conf/etc/httpd/conf.d/subversion.conf.bak &&true>/etc/httpd/conf.d/Subversion.confecho"start writing a new configuration file"Cat<<eof >/etc/httpd/conf.d/subversion.conf<Location/svn>DAV svn svnlistparentpath on Svnparentpath/home/svndata authtype Basic authname"Welcome to Xl-svn Server"Authzsvnaccessfile/etc/subversion/svn-authz.conf AuthUserFile/etc/subversion/svn-User Require Valid-User</Location>EOFif[$?-eq0];then Echo"Configure Success"Fiecho"write config file to http.conf"Echo"LoadModule dav_svn_module modules/mod_dav_svn.so">>/etc/httpd/conf/Httpd.confecho"LoadModule authz_svn_module modules/mod_authz_svn.so">>/etc/httpd/conf/httpd.confsed-I.'s/#ServerName www.example.com:80/ServerName localhost:80/g'/etc/httpd/conf/httpd.conf Echo"start the httpd service"/etc/init.d/httpd Startif[$?-eq0];then Echo"SVN service Setup is complete, please visit Http:ip/svn/department_server"fi
Tip: The repository path is/home/svndata, and the Permissions profile path is/ETC/HTTPD/CONF.D for the/etc/subversion/svn_authz.conf,subversion configuration file.
centos6.8 using Apache to build SVN services