Centos builds SVN server record

#Install svn software
[root@iZuf6bpoj0ndooseylgjjdZ local]# yum -y install subversion

#Create a svn root directory
[root@iZuf6bpoj0ndooseylgjjdZ local]# mkdir svnRoot
[root@iZuf6bpoj0ndooseylgjjdZ local]# ls
aegis  bin  etc  games  include  java  lib  lib64  libexec  sbin  share  src  svnRoot


[root@iZuf6bpoj0ndooseylgjjdZ svnRoot]# mkdir code
[root@iZuf6bpoj0ndooseylgjjdZ svnRoot]# ls
code
#Create a code repository, create a repository in the current code directory
[root@iZuf6bpoj0ndooseylgjjdZ svnRoot]# svnadmin create ./code
[root@iZuf6bpoj0ndooseylgjjdZ svnRoot]# ls
code
[root@iZuf6bpoj0ndooseylgjjdZ svnRoot]# cd code
[root@iZuf6bpoj0ndooseylgjjdZ code]# ls
conf  db  format  hooks  locks  README.txt
[root@iZuf6bpoj0ndooseylgjjdZ code]# cd conf
[root@iZuf6bpoj0ndooseylgjjdZ conf]# ls
authz  passwd  svnserve.conf

#Edit the svnserve.conf file to modify the svn service configuration
[root@iZuf6bpoj0ndooseylgjjdZ conf]# vi svnserve.conf

------------------------------------
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
#Specify the name of the warehouse that needs to be certified where code is the name of the warehouse installed above
realm = code

------------------------------------
[root@iZuf6bpoj0ndooseylgjjdZ conf]# ls
authz  passwd  svnserve.conf

#Edit the passwd file and add the username/password of the repository that can be accessed
[root@iZuf6bpoj0ndooseylgjjdZ conf]# vi passwd
------------------------------------
[users]
# harry = harryssecret
# sally = sallyssecret

#Add username and password
liuyl = liuyl
------------------------------------             

[root@iZuf6bpoj0ndooseylgjjdZ conf]# ls
authz  passwd  svnserve.conf

#Edit the authz file to specify the specific operation permissions of the access user
[root@iZuf6bpoj0ndooseylgjjdZ conf]# vi authz

------------------------------
#Specify the root directory access permissions of the code repository
[code:/]
liuyl = rw
------------------------------------


[root@iZuf6bpoj0ndooseylgjjdZ conf]# ls
authz  passwd  svnserve.conf

#When starting the service, you must specify the superior directory of the warehouse: if the name of the warehouse is code, its superior directory is svnRoot
[root@iZuf6bpoj0ndooseylgjjdZ conf]# svnserve -d -r /usr/local/svnRoot/

#Check whether the startup is successful, netstat checks the port number and process number.
[root@iZuf6bpoj0ndooseylgjjdZ conf]# netstat -tunlp | grep svn
tcp        0      0 0.0.0.0:3690                0.0.0.0:*                   LISTEN      1837/svnserve

#local environment test link      
[root@iZuf6bpoj0ndooseylgjjdZ conf]# svn checkout svn://localhost/code
Authentication realm: <svn://localhost:3690> code
Password for 'root':
Authentication realm: <svn://localhost:3690> code
Username: liuyl
Password for 'liuyl':

-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <svn://localhost:3690> code

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no
Checked out revision 0.

     Remark:

1. By default, when a warehouse is re-created, the branch will not be created by default, only through the svn copy command or the client,
  When creating a branch and merging the code after creating the branch, if the following Unreadable path encountered; access denied exception occurs.
  Need to modify the anon-access = read in the above svnserve.conf to anon-access = none
    
2. The error Not authorized to open root of edit operation is also caused by opening the anonymous access permission.
     anon-access=none does the trick.
 
3. The above svnRoot is equivalent to the repository under windows, and multiple svn repositories can be established below,
    After starting the service via svnserve -d -r /usr/local/svnRoot/,
    The following warehouse will load the corresponding access permissions according to the configuration in the conf file below.

4. Register the svn service to boot. Edit the rc.local file vi /etc/rc.d/rc.local
   Add the following:
   /usr/bin/svnserve  -d -r /usr/local/svnRoot/

    

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327084602&siteId=291194637