preface

Recently bought a new server, ready to start some personal open source projects. With a server, of course, a wave of SVN. Easy to upload and download their own information. Therefore, record how to set up the SVN for direct use in the future.

The installation

Use yum source to install, very convenient.

yum install subversion
Copy the code

Configure SVN

Create a warehouse

We will create a repository named SVN in /home. All the code will be stored in this repository. After the repository is successfully created, several more folders will be placed under SVN.

[root@localhost /]# cd /home
[root@localhost home]# mkdir svn
[root@localhost home]# svnadmin create /home/svn
[root@localhost home]# ls svn
conf  db  format  hooks  locks  README.txt
Copy the code

Let’s pay special attention here to the conf folder, which holds the configuration files.

[root@localhost home]# cd svn/conf
[root@localhost conf]# ls
authz  passwd  svnserve.conf
Copy the code

In the command, authz is the permission control file. Passwd is the account password file. Svnserve. conf is the SVN service configuration file

Configure the passwd

[root@localhost conf]# vi passwd 
[users]
jichi=123456
Copy the code

In the example above we created a user named Jichi.

Configuration authz

[root@localhost conf]# vi authz 
[/]
jichi=rw
*=
Copy the code

Jichi has read and write permissions on all files in /home/svn/. Other users do not have any permissions. The last line *= is very important and cannot be omitted.

Using user groups

[root@localhost conf]# vi authz
[groups]
group1 = jichi
group2 = jichi1
[/]
@group1 = rw
@group2 = r
* =
Copy the code

Two groups are created. Users in group 1 can read and write, and users in group 2 can read only.

Configuration svnserve. Conf

[root@localhost conf]# vi SVNserve. conf Open the following 5 comments anon-access = read # Anonymous user readable auth-access = write # authorized user writable password-db = Passwd # authz-db = authz # realm = /home/svnCopy the code

Remember to change the last line of realm to your SVN directory

Start and Stop

[root@localhost conf]# svnServe d-r /home/ SVN (start) [root@localhost conf]#killall SVNServe (stop)Copy the code

In the preceding commands, -d indicates the daemon process, and -r indicates the background process. Stopping can also be done by killing the process:

[root@localhost conf]# ps -ef|grep svnserve
root      4908     1  0 21:32 ?        00:00:00 svnserve -d -r /home/svn
root      4949  4822  0 22:05 pts/0    00:00:00 grep svnserve
[root@localhost conf]# kill -9 4908
Copy the code

Client connection

SVN :// You can use TortoiseSVN as TortoiseSVN :// you can use TortoiseSVN as TortoiseSVN :// you can use TortoiseSVN as TortoiseSVN :// you can use TortoiseSVN as TortoiseSVN :// The default port is 3690. If you change the port, be sure to include the port number.

Yum installation path

# RPM - qa | grep subversion subversion - 1.6.11-15. El6_7. X86_64 # RPM - ql subversion - 1.6.11-15. El6_7. X86_64... / usr/share/doc/subversion - 1.6.11 / usr/share/doc/subversion - 1.6.11 / BUGS/usr/share/doc/subversion - 1.6.11 / CHANGESCopy the code

RPM -qa Command to query all installed RPM packages, run the grep command together. RPM -qi Describes how to query a specific package. RPM -ql lists the RPM files of a specific package.

/usr/bin Some executable files /usr/lib64 Dynamic function libraries used by some programs /usr/share/doc Some basic software manuals and help documents /usr/share/man Some man page filesCopy the code