标签:svn简单部署
检查并安装SVN
rpm -qa subversion
yum install subversion
===================================================================
创建svn数据目录
mkdir -p /application/svndata
mkdir -p /application/svnpasswd
===================================================================
启动SVN
svnserve --help
svnserve -d -r /application/svndata/
===================================================================
检查SVN是否正常启动
ps -ef | grep svn
netstat -lnt |grep 3690
netstat -lntup |grep 3690
lsof -i :3690
===================================================================
创建svn的项目实例(svn版本库)
mkdir /application/svndata/sadoc1
svnadmin help ##查看svnadmin帮助文件 svnadmin help create
tree /application/svndata
svnadmin create /application/svndata/sadoc1 #在上面创建的svn数据目录下,创建项目
ll /application/svndata/
tree /application/svndata/sadoc1/
===================================================================
修改项目配置文件(权限问题)
方法1
cd /application/svndata/sadoc1/conf/
cp svnserve.conf.ori /application/svndata/sadoc1/conf/svnserve.conf
sed -i ‘s/# anon-access = read/anon-access = none/g‘ /application/svndata/sadoc1/conf/svnserve.conf
sed -i ‘s/# auth-access = write/auth-access = write/g‘ /application/svndata/sadoc1/conf/svnserve.conf
sed -i ‘s/# password-db = passwd/password-db = \/application\/svnpasswd\/passwd/g‘ /application/svndata/sadoc1/conf/svnserve.conf
sed -i ‘s/# authz-db = authz/authz-db = \/application\/svnpasswd\/authz/g‘ /application/svndata/sadoc1/conf/svnserve.conf
方法2
[root@centos conf]# vim svnserve.conf
修改的内容如下:
12 anon-access = none
13 auth-access = write
20 password-db = /application/svnpasswd/passwd #这样修改的目的是便于统一管理,以后所有的项目密码都放在这个目录下
27 authz-db = /application/svnpasswd/authz #这样修改的目的是便于统一管理,以后所有的项目认证都放在这个目录下了
===================================================================
检查配置文件修改的内容
egrep -v "#|^$" /application/svndata/sadoc1/conf/svnserve.conf
diff /application/svndata/sadoc1/conf/svnserve.conf /application/svndata/sadoc1/conf/svnserve.conf.ori
===================================================================
创建svn独立密码和认证文件
方法1
cd /application/svnpasswd/
cp /application/svndata/sadoc1/conf/passwd /application/svndata/sadoc1/conf/authz /application/svnpasswd/
echo -e "zhang = lvnian\nlvnian01 = lvnian" >> /application/svnpasswd/passwd
echo -e "[sadoc1:/]\nzhang = rw\nlvnian01 = rw" >>/application/svnpasswd/authz
====================================
方法2
cd /application/svnpasswd/
修改密码文件
[root@centos svnpasswd]# tail -5 /application/svnpasswd/passwd
[users]
# harry = harryssecret
# sally = sallyssecret
zhang = lvnian
lvnian01 = lvnian
[root@centos svnpasswd]#
修改认证文件
[root@centos svnpasswd]# tail -5 /application/svnpasswd/authz
# @harry_and_sally = rw
# * = r
[sadoc1:/]
zhang = rw
lvnian01 = rw
==================================================================
启动
svnserve -d -r /application/svndata/
关闭svn
kill -9 `ps -ef |grep svn|grep -v grep|awk ‘{print $2}‘`
本文出自 “奋斗吧” 博客,请务必保留此出处http://lvnian.blog.51cto.com/7155281/1706083
标签:svn简单部署
原文地址:http://lvnian.blog.51cto.com/7155281/1706083