標籤:apache 分享 sub creat load basic chkconfig -128 src
伺服器環境:
指令碼如下:
#!/bin/bashyum install wget -ymv /etc/etc/yum.repos.d/*.repo /tmpwget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repowget -O /etc/yum.repos.d/epel.repo http://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 600 /var/spool/cron/rootyum install httpd httpd-devel subversion mod_dav_svn ntpdate -yecho "開始建立目錄和設定檔"mkdir -p /etc/subversion && cd /etc/subversion && touch svn-authz.conf svn-userecho "開始建立版本庫"mkdir -p /home/svndata && chown -R apache.apache /home/svndata && svnadmin create /home/svndata/Department_Server && chown -R apache.apache /home/svndata/Department_Serverecho "開始設定檔"cat <<EOF >/etc/subversion/svn-authz.conf[groups]admin = liuhuihuangmygirl = wangchenyan[/]liuhuihuang = rw* = r EOFif [ $? -eq 0 ];then echo "configure success"fiecho "開始備份subversion.conf設定檔和清空設定檔"cp /etc/httpd/conf.d/subversion.conf /etc/httpd/conf.d/subversion.conf.bak && true > /etc/httpd/conf.d/subversion.confecho "開始寫入新的設定檔"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 [ $? -eq 0 ];then echo "configure success"fiecho "寫入設定檔至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 "啟動httpd服務"/etc/init.d/httpd startif [ $? -eq 0 ];then echo "svn服務搭建完成,請訪問http:IP/svn/Department_Server"fi
溫馨提示:版本庫路徑為/home/svndata ,許可權設定檔路徑為/etc/subversion/svn_authz.conf,subversion設定檔所在路徑為/etc/httpd/conf.d。
centos6.8使用apache搭建svn服務