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

成都創(chuàng)新互聯(lián)技術(shù)團(tuán)隊(duì)10年來致力于為客戶提供網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計(jì)、成都品牌網(wǎng)站建設(shè)、網(wǎng)絡(luò)營銷推廣、搜索引擎SEO優(yōu)化等服務(wù)。經(jīng)過多年發(fā)展,公司擁有經(jīng)驗(yàn)豐富的技術(shù)團(tuán)隊(duì),先后服務(wù)、推廣了成百上千網(wǎng)站,包括各類中小企業(yè)、企事單位、高校等機(jī)構(gòu)單位。
# 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)建并進(jìn)入到儲(chǔ)存版本庫的目錄
# mkdir /data/svn-repository
# cd /data/svn-repository五、創(chuàng)建一個(gè)版本庫(項(xiàng)目) test為版本庫的名稱
# svnadmin create test六、顯示版本庫目錄的文件列表
# ls test|
名稱 |
類型 |
說明 |
|---|---|---|
|
conf |
目錄 |
配置文件目錄 |
|
conf/authz |
文件 |
負(fù)責(zé)賬號(hào)權(quán)限的管理,控制賬號(hào)是否讀寫權(quán)限 |
|
conf/passwd |
文件 |
負(fù)責(zé)賬號(hào)和密碼的用戶名單管理 |
|
conf/svnserve.conf |
文件 |
版本庫配置文件 |
|
db |
目錄 |
版本數(shù)據(jù)存儲(chǔ)目錄 |
|
hooks |
目錄 |
版本庫鉤子腳本文件目錄 |
|
locks |
目錄 |
db鎖文件和db_logs鎖文件的目錄,用來追蹤存取文件庫的客戶端 |
|
format |
文件 |
存儲(chǔ)一個(gè)整數(shù)的文件,此整數(shù)代表庫層次結(jié)構(gòu)版本 |
|
README.txt |
文件 |
說明文件 |
七、設(shè)置全局配置 默認(rèn)情況下,都是使用版本庫目錄下conf目錄的配置,一兩個(gè)項(xiàng)目還沒問他,但是項(xiàng)目一多,管理就很麻煩了。 先把配置目錄復(fù)制出來,作為全局配置
# 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九、設(shè)置版本庫用戶的權(quán)限 打開authz文件
# vi conf/authz給jwj用戶賦予test版本庫根目錄的讀寫權(quán)限
### 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當(dāng)然,還有更多權(quán)限的寫法
十、設(shè)置svn服務(wù)開機(jī)自啟
#vi /etc/init.d/svn然后輸入以下內(nèi)容
#!/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í)行權(quán)限
# chmod +x /etc/init.d/svn開啟開機(jī)自啟動(dòng)
# chkconfig svn on十一、啟動(dòng)svn
# service svn start網(wǎng)頁題目:Linux服務(wù)器搭建SVN服務(wù)器
地址分享:http://www.dlmjj.cn/article/dhosihp.html


咨詢
建站咨詢
