1. 安裝Apache
svn://120.24.159.162/repos
[plain] view plaincopyprint?
- [root@developbase ~]# yum install httpd
2. 安裝SVN
[plain] view plaincopyprint?
- [root@developbase ~]# yum install mod_dav_svn subversion
安裝SVN軟件包
[root@localhost ~]# yum install subversion
#確認是否已安裝svn模塊
[root@localhost ~]# cd /etc/httpd/modules;ls|grep svn
mod_authz_svn.so
mod_dav_svn.so
如果沒有需要安裝mod_dav_svn
#yum -y install mod_dav_svn
#創建版本庫
[root@localhost ~]#mkdir -p /opt/svn/repos
[root@localhost ~]# svnadmin create /opt/svn/repos
#配置Subversion
#設置用戶名與密碼zhangsan,123456
[root@localhost ~]# vim /opt/svn/repos/conf/passwd
[users]
zhangsan = 123456
#配置權限控制
root@localhost ~]# vim /opt/svn/repos/conf/authz
[groups]
[/]
zhangsan=rw
#服務配置
[root@localhost ~]# vim /opt/svn/repos/conf/svnserve.conf
[general]
auth-access = write ### The password-db option controls the location of the password
#啓動SVN
[root@localhost ~]# svnserve -d -r /opt/svn/repos
#檢測3690端口是否被佔用
[root@localhost ~]# netstat -ln |grep 3690
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN
#查看SVN進程
[root@localhost ~]# ps -ef|grep svn|grep -v grep
#關閉SVN進程
[root@localhost ~]# killall svnserve
[root@localhost ~]# yum install subversion
#確認是否已安裝svn模塊
[root@localhost ~]# cd /etc/httpd/modules;ls|grep svn
mod_authz_svn.so
mod_dav_svn.so
如果沒有需要安裝mod_dav_svn
#yum -y install mod_dav_svn
#創建版本庫
[root@localhost ~]#mkdir -p /opt/svn/repos
[root@localhost ~]# svnadmin create /opt/svn/repos
#配置Subversion
#設置用戶名與密碼zhangsan,123456
[root@localhost ~]# vim /opt/svn/repos/conf/passwd
[users]
zhangsan = 123456
#配置權限控制
root@localhost ~]# vim /opt/svn/repos/conf/authz
[groups]
[/]
zhangsan=rw
#服務配置
[root@localhost ~]# vim /opt/svn/repos/conf/svnserve.conf
[general]
auth-access = write ### The password-db option controls the location of the password
#啓動SVN
[root@localhost ~]# svnserve -d -r /opt/svn/repos
#檢測3690端口是否被佔用
[root@localhost ~]# netstat -ln |grep 3690
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN
#查看SVN進程
[root@localhost ~]# ps -ef|grep svn|grep -v grep
#關閉SVN進程
[root@localhost ~]# killall svnserve
至此就可以在客戶機使用 svn://ip/test 來連接Subversion 服務器了,如果連接不上有可能是服務器防火牆將3690端口攔截了,開放器即可。
此外,如果需要將一個 svn 服務器中的版本庫移植到另外一臺svn服務器上,可以直接將原版本庫中 db 文件夾中的內容全部複製到新 svn 服務器相應版本庫目錄下即可,還要注意兩個 svn 服務器所運行的 svn 版本,不同版本可能會出現不兼容情況。