標籤:http io ar os sp 檔案 on art bs
yum -y install subversion #安裝SVN
svnserve -- version #查看svn版本資訊確定是否安裝
yum -y install httpd #安裝Apache
yum -y install mod_dav_svn #安裝Apache的SVN支援
mkdir -p /var/www/svn #建立SVN目錄
svnadmin create /var/www/svn/repos #建立repos版本庫
htpasswd -c /etc/httpd/conf.d/passwd.dav_svn admin #建立使用者密碼檔案並添加使用者
vi /etc/httpd/conf.d/authz.dav_svn #編輯使用者權限配置
[groups] #許可權分組 manager=admin
[/] #根目錄
@manager=rw #manager組有讀寫權限
[repos:/]
#repos庫 *=r #所有人都有讀取許可權
vi /etc/httpd/conf.d/subversion.conf #編輯Apache的SVN配置
<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/httpd/conf.d/passwd.dav_svn
AuthzSVNAccessFile /etc/httpd/conf.d/authz.dav_svn
Require valid-user
</Location>
ServerName localhost:80 #取消注釋,否則Apache啟動有警告
chown -R apache.apache /var/www/svn/repos #配置Apache對版本庫的存取權限
iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT #防火牆開啟80連接埠
/etc/init.d/iptables save #拷貝防火牆規則儲存
chcon -R -t httpd_sys_content_t /var/www/svn/repos #添加Apache對版本庫目錄的selinux安全性原則
chkconfig httpd on #系統啟動時Apache自動運行
service httpd start #啟動Apache
CentOS 6.5 Apache+SVN配置