Create a project SVN repository

1. Create a directory svnrepos to store various SVN repositories (the repository storage path is defined according to your own preferences)

-bash: cd /usr/local/apache/htdocs/

-bash: mkdir svnrepos

 

2. Suppose I want to create an SVN repository for the coinhello project (command svnadmin create)  

-bash: cd /usr/local/apache/htdocs/svnrepos/

-bash: svnadmin create coinhello

 

3. Modify the configuration of the coinhello repository

-bash: cd /usr/local/apache/htdocs/svnrepos/coinhello/conf

-bash: ls

Note: In the conf directory, you can see three files: authz, passwd, and svnserve.conf

 

-bash: vim svnserve.conf

Description: Remove the comments on the four lines of anon-access = read , auth-access = write , password - db = passwd , authz - db = authz . When removing the comments, pay attention to no spaces before these four lines, then save and exit ( :wq)

   If there are spaces in front of these four lines, an error will be reported during the svn checkout operation: /usr/local/apache/htdocs/svnrepos/ coinhello/conf/svnserve.conf: 19: Option expected

 

-bash: vim passwd

Description: Under the [user] field, add a new user name and password, for example: admin = adminpwd, note that there is no space in front of it, then save and exit (:wq)

      If there is a space in front of it, an error will be reported during the svn checkout operation: Authentication failed

 

-bash: vim authz

[ / ]
admin = rw

Description: Add the user's directory control permissions in the repository. Note that there can be no space in front of it, then save and exit (:wq)

      [ / ] ------------ User permissions start from repository root

      admin = rw ------------- Configure the user's read and write permissions

   If there is a space in front of it, an error will be reported during the svn checkout operation: Invalid authz configuration

 

-bash: svnserve  -d -r /usr/local/apache/htdocs/svnrepos/

Note: -d means that the daemon has been opened, -r means to add the SVN repository location

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326047537&siteId=291194637