标签:
Install subversion from the official repositories.
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‘
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
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.conf时,打开注释时,配置的前面有空格,应该顶格写。
修改后即可。
3、ping不通
先看看有没有插网线。
标签:
原文地址:http://www.cnblogs.com/tshua/p/5610230.html