There are many articles on the Internet for reference. Installing Svn in Ubuntu is indeed simple.
1. Installation
Sudo apt-Get install Subversion
2. Create a repository
Sudo mkdir/var/SVN
Sudo svnadmin create/var/SVN
Sudo chmod-r a + w/var/SVN/DB # this is very important. Otherwise, permission issues may occur.
3. modify the configuration file (the location of the configuration file varies with the location of the Repository)
Sudo VI/var/SVN/CONF/svnserve. conf
# Remove # Before [general]
[General]
# Anonymous access permission, which can be read, write, or none. The default value is read.
Anon-access = none
# Authenticate the user's permissions, which can be read, write, or none. The default value is write.
Auth-access = write
# Remove the path of the password database #
Password-DB = passwd
Note: All rows must have the top level; otherwise, an error is returned. Suggestion: to prevent unnecessary errors, we recommend that you overwrite the original content of the file with the content above.
4. Change the password file passwd
Sudo VI/var/SVN/CONF/passwd
[Users]
Svnuser = Password
5. Start the service
Svnserve-d-r/var/SVN
Svnserve -- Help
Usage: svnserve [-d |-I |-T |-x] [Options]
Valid options:
-D [-- daemon]: daemon mode
-I [-- inetd]: inetd Mode
-T [-- tunnel]: tunnel mode
-X [-- listen-once]: Listen-once mode (useful for debugging)
-R [-- root] Arg: Root of directory to serve
-R [-- Read-Only]: force read only, overriding repository Config File
-- Config-file Arg: Read configuration from file ARG
-- Listen-port Arg: Listen Port
[Mode: daemon, listen-Once]
-- Listen-host Arg: Listen hostname or IP address
[Mode: daemon, listen-Once]
-T [-- threads]: Use threads instead of fork [mode: Daemon]
-- Foreground: Run in foreground (useful for debugging)
[Mode: Daemon]
-- Log-file Arg: svnserve Log File
-- PID-file Arg: Write server process ID to file ARG
[Mode: daemon, listen-Once]
-- Tunnel-user Arg: Tunnel username (default is current UID's name)
[Mode: Tunnel]
-H [-- help]: display this help
-- Version: show program version information
OK. You can test it!
Others
1. Disable SVN:
Killall svnserve
2. Multiple IP addresses
Svnserve-d-r/var/SVN -- listen-Host IP
3. The default SVN port is 3690.
4. Set startup
Sudo VI/etc/init. d/svnd. Sh
The content is as follows:
#! /Bin/bash
# Svnserve startup
Svnserve-d-r/var/SVN
Run the script and set it to self-start.
Update-rc.d svnd. Sh defaults