码迷,mamicode.com
首页 > 其他好文 > 详细

arch搭建SVN服务器

时间:2016-06-23 12:29:36      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

 

一、安装

Install the package

Install subversion from the official repositories.

Create a repository

Create your repository

mkdir /path/to/repos/
svnadmin create /path/to/repos/repo1

Your initial repository is empty, if you want to import files into it, use the following command.

svn import ~/code/project1 file:///path/to/repos/repo1 --message ‘Initial repository layout‘

Set access policies

Edit the file /path/to/repos/repo1/conf/svnserve.conf and uncomment or add the line under [general]

password-db = passwd

You might also want to change the default option for anonymous users.

anon-access = read

Replace "read" with "write" for a repository that anyone can commit to, or set it to "none" to disable all anonymous access.

Now edit the file /path/to/repos/repo1/conf/passwd

[users]
harry = foopassword
sally = barpassword

The above defines users harry and sally, with passwords foopassword and barpassword, change it as you like

Start the server daemon

Before you start the server, edit the configuration file:

/etc/conf.d/svnserve
SVNSERVE_ARGS="--root=/path/to/repos"

The --root=/path/to/repos option set the root of repository tree. If you have multiple repositories use --root=/path-to/reposparent. Then access independent repositories by passing in repository name in the URL: svn://host/repo1. make sure that the user has read/write access to the repository files)

Optionally add a --listen-port if you want a different port, or other options.

By default, the service runs as root. If you want to change that, add a drop-in:

/etc/systemd/system/svnserve.service.d/50-custom.conf
[Service]
User=svn

Now start the svnserve.service daemon.

 

二、注意事项(大坑)

1、如果出现,这样的错误信息,“svnserve: 不能绑定服务器套接字: 地址已经被使用”
那先把svnserve进程干掉。
具体做法是
$ ps -aux | grep svnserve
 #查看进程,svnserve的pid为16663
 $ kill -9 16663 #干掉svnserve
 再次运行$ systemctl start svnserve 
 
 但是利用ps -aux查找进程时,没有找到进程。
 最后的方式是,kill掉守护进程xinetd,然后重新拉起进程svnserve
  
   2、报Option expected
  1. svn: E200002: error while parsing config file :/ home/..../svnserve.conf  
  2.   
  3. svn: E200002: line 19: Option expected 

  这是因为修改svnserve.conf时,打开注释时,配置的前面有空格,应该顶格写。

  修改后即可。

   3、ping不通

  先看看有没有插网线。

 
参考:
https://wiki.archlinux.org/index.php/Subversion
http://blog.csdn.net/zxnlmj/article/details/40621279
http://www.mamicode.com/info-detail-1100667.html
http://blog.csdn.net/duguduchong/article/details/8819028

 

arch搭建SVN服务器

标签:

原文地址:http://www.cnblogs.com/tshua/p/5610230.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!