欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Linux下subversion的安装与配置 博客分类: Linux linuxsubversion配置安装新增版本库新增用户 

程序员文章站 2024-03-18 14:06:34
...

collabnet subversion的下载地址http://pan.baidu.com/s/1c08HIHq

 

1、安装client和server之后,在配置文件中配置subversion的环境变量。

 

安装svn的client和server
#rpm -vih CollabNetSubversion-client-1.4.3-5.i386.rpm
#rpm -vih CollabNetSubversion-server-1.4.3-5.i386.rpm

 

//打开文件etc/profile文件,查看是否已经配置了JDK
export JAVA_HOME=/usr/java/jdk1.5.0_16
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin

//新增svn的环境变量的配置
PATH=/opt/CollabNet_Subversion/bin:$PATH

 提示:检查是否安装某软件的命令为 rpm -q  name

 

然后进入到svn的bin目录下,对版本库和用户信息根据提示一次进行配置

[root@web-server-05 bin]# sudo Configure-CollabNet-Subversion 
CollabNet Subversion Server is a free download of open-source Subversion,
compiled and tested by CollabNet. For more information about CollabNet
Subversion, visit the CollabNet community at http://open.collab.net. 
是否想要对svn服务器进行配置?回答yes or no 下同
Would you like to configure the CollabNet Subversion Server now? [yes] yes
Welcome to CollabNet Subversion Server setup.
You will now be asked some questions to configure CollabNet Subversion.
Defaults are given in square brackets. If a default is okay for you
Just hit [Enter] to continue.
This setup can configure either Apache or svnserve as Subversion
server, for you. Would you like to configure Apache as your
Subversion server now? [yes] yes 是否配置Apache作为svn的服务器?
Continuing with apache Subversion server configuration ...
Specify the base directory for Subversion repositories: [/var/svn/repositories] /home/svn/repositories指定一个目录作为svn的仓库
Searching for existing Subversion repositories ...
No repositories found under /home/svn/repositories
Should I use this path? [yes] yes
Would you like to create a new Subversion repository? [yes] yes
What should be your new Subversion repository name? svnroot
New repository created.
Would you like to initialize the repository with trunk/branches/tags folders? [no] yes
Done.
Would you like to create another Subversion repository? [yes] no
Would you like to give the name and port that the server uses to identify itself? [yes] yes
Registered DNS name or IP address: 10.11.15.5
Server port number: 8018
Allow anonymous read access? [no] no
0 users currently have access to this repository:
Would you like to create a new Subversion account? [yes] yes
Account username 
(To re-create or delete a Subversion account, enter an existing username): dongshan
Account password: 
Retype account password: 
Adding password for user dongshan
Account created
Would you like to create another user account? [yes] no
Stopping CollabNet Subversion: httpd (no pid file) not running[ok  ]
Starting CollabNet Subversion:                             [  OK  ]
  Congratulations! You have successfully configured the CollabNet
  Subversion server.
  You can access your repositories at the following URL:
  http://10.11.15.5:8018/svn/YOUR-REPOS-NAME

 

 

2、subversion的一些基本命令

http://www.subversion.org.cn/svnbook/nightly/svn.ref.html#svn.ref.svn

 

3、创建版本库

svnadmin  create /home/svn/repositories/ENT_MONITOR

如果遇到错误提示:
Can't open file '/svn/svnroot/telnet/db/txn-current-lock': Permission denied 
说明需要额外附加给仓库读写权限
chmod 777 -R /home/svn/repositories/ENT_MONITOR/db/

 

4、创建用户

htpasswd -m /etc/opt/CollabNet_Subversion/conf/svn_auth_file sun

New password:******  
  
Re-type new password:******  

c表示create m表示使用MD5加密密码
此处只是添加了一个用户,还需要更改该用户的访问权限,在目录/etc/opt/CollabNet_Subversion/conf/svn_access_file下新增用户的访问权限
默认为
[/]
sun = rw
表示该sun用户可以访问仓库中的任何项目,rw表示可读写,做一下设置可以改变用户访问权限
[java:/]
sun= rw
表示sun用户只可以访问名为java的项目库。

也可以将两个配置文件宁外生成,然后通过修改/etc/opt/CollabNet_Subversion/conf/httpd.conf文件里面的auth、access路径设置来进行新增用户的生效

 

 5、其他常见错误

Can't open '/svn/svnroot/telnet/db/tempfile.tmp': Permission denied

Can't make directory '/svn/svnroot/telnet/dav/activities.d': Permission denied

这些大部分都是由于权限问题引起,可以试着更改下访问权限

 

参考地址:http://my.oschina.net/yowsah/blog/2148