使用web方式訪問svn

來源:互聯網
上載者:User

標籤:svn apache

前提:要安裝完apache和svn服務端

svn服務端安裝記錄

http://alwaysyunwei.blog.51cto.com/3224143/1372377

apache可以用yum安裝


在整合apache和svn時需要在Apache中添加svn模組

[[email protected]_47_128_centos html]# yum install mod_dav_svn mod_auth_mysql  [[email protected]_47_128_centos modules]# ls /etc/httpd/modules |grep svnmod_authz_svn.somod_dav_svn.so

這樣就可以可以添加svn模組


修改apache設定檔

vim /etc/httpd/conf/httpd.conf
LoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so<Location /home>  DAV svn  SVNPath /var/www/html/svna/home</Location>

PS:svn的項目路徑為

/var/www/html/svna/其中home為項目版本庫內容

配置完重啟httpd


測試訪問

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/45/CA/wKiom1PrSCjjq4phAADeZoBEiTg837.jpg" title="3.png" alt="wKiom1PrSCjjq4phAADeZoBEiTg837.jpg" />


正常訪問

現在你的版本庫任何人都可以訪問,並且有完全的寫操作許可權。也就是說任何人都可以匿名讀取,修改,提交,以及刪除版本庫中的內容。顯然大部分場合這是不符合需求的。那麼如何進行使用權限設定呢,Apache 提供了基本的使用權限設定:

[[email protected]_47_128_centos svna]# whereis htpasswd htpasswd: /usr/bin/htpasswd /usr/share/man/man1/htpasswd.1.gz[[email protected]_47_128_centos svna]# htpasswd -c /etc/svnpwd/svnpwdfile svnpwduser01htpasswd: cannot create file /etc/svnpwd/svnpwdfile[[email protected]_47_128_centos svna]# mkdir /etc/svnpwd[[email protected]_47_128_centos svna]# htpasswd -c /etc/svnpwd/svnpwdfile svnpwduser01New password: Re-type new password: Adding password for user svnpwduser01[[email protected]_47_128_centos svna]#


繼續修改httpd設定檔,在剛才的修改處添加以下內容

AuthType BasicAuthName "svn repos"AuthUserFile /etc/svnpwd/svnpwdfileRequire valid-user

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/45/CC/wKioL1PrSdiDcyz6AACumq49vYo325.jpg" title="2.png" alt="wKioL1PrSdiDcyz6AACumq49vYo325.jpg" />

測試訪問

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/45/CA/wKiom1PrSQaQvUXwAAFD9dBrpY4803.jpg" title="4.png" alt="wKiom1PrSQaQvUXwAAFD9dBrpY4803.jpg" />


這樣就添加了訪問限制


參考資料

http://www.ibm.com/developerworks/cn/java/j-lo-apache-subversion/

http://blog.csdn.net/wangjingfei/article/details/5580295

小廣告

http://shop62632578.taobao.com/


本文出自 “always_yunwei” 部落格,請務必保留此出處http://alwaysyunwei.blog.51cto.com/3224143/1539619

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.