First, installationInstall 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 the change of the default option for anonymous users.
Anon-access = Read
Replace "read" with "write" for a repository this anyone can commit to, or set it to "none" to disable all anonymous acces S.
Now edit the FILE/PATH/TO/REPOS/REPO1/CONF/PASSWD
[Users]harry = foopasswordsally = Barpassword
The above defines users Harry and Sally, with passwords Foopassword and Barpassword.
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 the 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/wri Te access to the repository files)
Optionally add a --listen-port
if you want a different ports, or other options.
By default, the service runs as root. If you want to the change, add a drop-in:
/etc/systemd/system/svnserve.service.d/50-custom.conf
[Service] User=svn
Now start the svnserve.service daemon.
Ii. precautions (Tai hang)
1. If this error message appears, "Svnserve: Cannot bind server socket: Address is already in use"
Then get rid of the svnserve process first.
The specific approach is
$ Ps-aux | grep svnserve
# view process, Svnserve pid is 16663
$ kill-9 16663 #干掉svnserve
Run $ systemctl Start again Svnserve but the process is not found when using the Ps-aux lookup process. The last way is to kill the daemon xinetd and then pull the process back up Svnserve 2, option expected
- Svn:E200002:error while parsing config file:/home/..../svnserve.conf
- Svn:E200002:line 19:option expected
This is because when you modify svnserve.conf, when you open the note, there are spaces in front of the configuration and should be shelf written.
You can change it later.
3, Ping does not pass
First see if there is a cable.
Reference: https://wiki.archlinux.org/index.php/Subversionhttp://blog.csdn.net/zxnlmj/article/details/40621279http:// www.mamicode.com/info-detail-1100667.htmlhttp://blog.csdn.net/duguduchong/article/details/8819028
Arch Build SVN server