新聞中心
一、檢查是否已安裝

成都創(chuàng)新互聯(lián)技術團隊10年來致力于為客戶提供網(wǎng)站建設、成都網(wǎng)站設計、成都品牌網(wǎng)站建設、網(wǎng)絡營銷推廣、搜索引擎SEO優(yōu)化等服務。經(jīng)過多年發(fā)展,公司擁有經(jīng)驗豐富的技術團隊,先后服務、推廣了成百上千網(wǎng)站,包括各類中小企業(yè)、企事單位、高校等機構單位。
# svnserve --version如果出現(xiàn)下列提示,則代表沒有安裝
-bash: svnserve: command not found如果出現(xiàn)下列提示,則代表已經(jīng)安裝了,直接跳到四步
svnserve, version 1.7.14 (r1542130)
compiled Apr 11 2018, 02:40:28
Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository back-end (FS) modules are available:
* fs_base : Module for working with a Berkeley DB repository.
* fs_fs : Module for working with a plain file (FSFS) repository.
Cyrus SASL authentication is available.二、安裝
# yum install -y subversion三、再次檢查是否已安裝
# svnserve --version四、創(chuàng)建并進入到儲存版本庫的目錄
# mkdir /data/svn-repository
# cd /data/svn-repository五、創(chuàng)建一個版本庫(項目) test為版本庫的名稱
# svnadmin create test六、顯示版本庫目錄的文件列表
# ls test|
名稱 |
類型 |
說明 |
|---|---|---|
|
conf |
目錄 |
配置文件目錄 |
|
conf/authz |
文件 |
負責賬號權限的管理,控制賬號是否讀寫權限 |
|
conf/passwd |
文件 |
負責賬號和密碼的用戶名單管理 |
|
conf/svnserve.conf |
文件 |
版本庫配置文件 |
|
db |
目錄 |
版本數(shù)據(jù)存儲目錄 |
|
hooks |
目錄 |
版本庫鉤子腳本文件目錄 |
|
locks |
目錄 |
db鎖文件和db_logs鎖文件的目錄,用來追蹤存取文件庫的客戶端 |
|
format |
文件 |
存儲一個整數(shù)的文件,此整數(shù)代表庫層次結構版本 |
|
README.txt |
文件 |
說明文件 |
七、設置全局配置 默認情況下,都是使用版本庫目錄下conf目錄的配置,一兩個項目還沒問他,但是項目一多,管理就很麻煩了。 先把配置目錄復制出來,作為全局配置
# cp -R test/conf conf八、新增該版本庫的用戶 打開passwd文件
# vi conf/passwd在文件末新增一行,輸入用戶名jwj和密碼123456
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
# harry = harryssecret
# sally = sallyssecret
jwj = qq2254九、設置版本庫用戶的權限 打開authz文件
# vi conf/authz給jwj用戶賦予test版本庫根目錄的讀寫權限
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
### - a single user,
### - a group of users defined in a special [groups] section,
### - an alias defined in a special [aliases] section,
### - all authenticated users, using the '$authenticated' token,
### - only anonymous users, using the '$anonymous' token,
### - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
# [/foo/bar]
# harry = rw
# &joe = r
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[test:/]
jwj = rw當然,還有更多權限的寫法
十、設置svn服務開機自啟
#vi /etc/init.d/svn然后輸入以下內容
#!/bin/sh
# chkconfig: 2345 85 85
# processname: svn
svn_bin=/bin
svn_port=3690
svn_home=/mnt/svn-repository
svn_config=/mnt/svn-repository/conf/svnserve.conf
if [ ! -f "$svn_bin/svnserve" ]
then
echo "svnserver startup: cannot start"
exit
fi
case "$1" in
start)
echo "Starting svnserve..."
$svn_bin/svnserve -d -r $svn_home --config-file $svn_config --listen-port $svn_port
echo "Successfully!"
;;
stop)
echo "Stoping svnserve..."
killall svnserve
echo "Successfully!"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: svn { start | stop | restart } "
exit 1
;;
esac給文件添加可執(zhí)行權限
# chmod +x /etc/init.d/svn開啟開機自啟動
# chkconfig svn on十一、啟動svn
# service svn start網(wǎng)站欄目:Linux服務器搭建SVN服務器
本文網(wǎng)址:http://fisionsoft.com.cn/article/dhosihp.html


咨詢
建站咨詢
