centos6.8使用apache搭建svn服務

來源:互聯網
上載者:User

標籤: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服務

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.