First, install the package:
sudo apt-get install subversion
Second, choose the location of the SVN service files and configuration files. I placed the SVN directory under the/srv.
Cd/srv
sudo mkdir svn
My SVN repository is called TONE_SRC.
Cd/srv/svn
sudo mkdir tone_src
Iii. creating a repository of repositories
sudo svnadmin create/srv/svn/tone_src
After execution tone_src The following file structure:
[Email protected]:/srv/svn/tone_src$ ls-l
Total Dosage 24
Drwxr-xr-x 2 root root 4096 January 10:52 conf
Drwxr-sr-x 6 root root 4096 January 14:52 db
-r--r--r--1 root root 2 January 10:50 format
Drwxr-xr-x 2 root root 4096 January 10:50 hooks
Drwxr-xr-x 2 root root 4096 January 10:50 locks
-rw-r--r--1 root root 246 January 10:50 README.txt
Iv. Configuring SVN files:
Need to modify the three files in the Conf directory, authz;passwd;svnserve.conf
1. Edit svnserve.conf (vi svnserve.conf )
PS: here must pay attention to the format of the problem, each line can not be left blank, the equal sign around each side has a space, it is best not to comment on this line of code directly.
2. Edit Authz The Administrator group is the Admin group, the user for the tone Admin Group has RW (read and Write permission) everyone has R (Reading permission)
[Groups]
admin= tone
[/]
@admin =RW
*=r
Here the name of the group is not necessarily called Admin your Administrator group name can be called any name, and other such as the Admin group and other users, you can make admin=tone,tone1,tone2 similar to the wording
3. Compile passwd file to set user password
[Users]
# Harry = Harryssecret
# sally = Sallyssecret
tone=12345
The password for tone is 12345 and the password is clear text.
Five, open your SVN server.
sudo svnserve-d-r/erv/svn/
-D daemon Mode is started
-R Develop SVN version Coogan directory This makes it easy for clients to access the repository without entering the full path.
Example: SVN://127.0.0.1/TONE_SRC
It is worth noting that I started with sudo here because the previous SVN directory and the TONE_SRC directory I created under sudo. The permissions of the directory are root
This is possible if I start in the following way, but there is a problem when the client segment submits the file because the Svnserve service does not have write permission to the SVN repository directory at this time.
Svnserve-d-r/erv/svn/
Ps:
I. Linux commands that may be used during the installation
1. First look at the port
Netstat-anp
2. Find the port you want to close
NETSTAT-ANP | grep 9312
TCP 0 0 0.0.0.0:9312 0.0.0.0:* LISTEN 11902/searchd
3. close the process that occupies the port
Kill-9 11902
Second, pay attention to the network
Use the company's network of students must pay attention to, the company outside the network may be blocked SVN, so when the newspaper Error:can ' t connect to host ': Because the target machine actively refused to connect this error, really can not find other reasons, may wish to change the network try.
Build SVN standalone server under Ubuntu 14.04