配置環(huán)境:ubuntu 12.04
步驟:
【1】安裝apache2
#aptitude install apache2
【2】安裝subversion
#aptitude install subversion
#aptitude install libapache2-svn
【3】配置Subversion
#mkdir /svn_data/svn_root
#touch /svn_data/svn_root/passwd
#touch /svn_data/svn_root/authz
#svnadmin create /svn_data/svn_root/demo
#touch /etc/apach2/sites-available/svn
#vim
/etc/apache2/sites-available/svn
#ln -s /etc/apaches/sites-availabe/svn /etc/apache2/sites-enabled/
內(nèi)容如下:<Location /repos>
DAV svn
SVNParentPath /svn_data/svn_root
AuthType Basic
AuthName "myproject subversion repository"
AuthUserFile /svn_data/svn_root/passwd
AuthzSVNAccessFile /svn_data/svn_root/authz
Require valid-user
#SSLRequireSSL
</Location>
配置用戶和授權(quán)
#htpasswd /svn_data/svn_root/passwd xxx 輸入用戶密碼
#vim /svn_data/svn_root/authz 編輯內(nèi)容如下:
[/]
[/demo]
xxx = rw
如果需要SSL,配置如下:
【4】配置SSL
#aptitude install openssl
#aptitude install ssl-cert
#a2enmod ssl
#cd
/etc/apach2/ssl #mkdir ssl #cd ssl
#openssl genrsa -des3 -out my-serve.key 1024
#openssl req -new -key my-serve.key -x509 -out my-server.crt -config /etc/ssl/openssl.cnf -days 3650
#ln -s /etc/apache/site-available/default-ssl /etc/apache/site-enabled/
#vim /etc/apache2/sites-available/svn
去掉 #SSLRequireSSL的注釋
重啟apache
#/etc/init.d/apache2 restart
【5】測試
在瀏覽器輸入 https://localhost/repos/demo能夠訪問,就說明配置正常。
|----------------------------------------------------------------------------------------|
版權(quán)聲明 版權(quán)所有 @zhyiwww
引用請注明來源 http://www.tkk7.com/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2014-06-16 16:36
zhyiwww 閱讀(763)
評論(0) 編輯 收藏 所屬分類:
linux 、
配置管理