SVN Startup Mode
First, configure the SVN repository on the server.
Manually create the repository directory:
mkdir /opt/svn
Create the repository using the svn command:
svnadmin create /opt/svn/tutorialpro
Start the service using the svnserve command:
svnserve -d -r directory --listen-port port_number
-
-r: The configuration method determines the repository access method.
-
--listen-port: Specifies the SVN listening port; without this parameter, SVN defaults to listening on port 3690.
Due to the different -r configuration methods, SVN can be started with two different access methods.
Method 1: -r directly specifies the repository (referred to as single-repository svnserve mode):
svnserve -d -r /opt/svn/tutorialpro
In this case, one svnserve can only work for one repository.
The authz configuration file should be written like this for repository permissions:
[groups]
admin=user1
dev=user2
[/]
@admin=rw
user2=r
Use a URL like this: svn://192.168.0.1/ to access the tutorialpro repository.
Method 2: Specify the parent directory of the repositories (referred to as multi-repository svnserve mode):
svnserve -d -r /opt/svn
In this case, one svnserve can work for multiple repositories.
The authz configuration file should be written like this for repository permissions:
[groups]
admin=user1
dev=user2
[tutorialpro:/]
@admin=rw
user2=r
[tutorialpro01:/]
@admin=rw
user2=r
If you use [/], it represents the root directory of all repositories; similarly, [/src] represents the src directory under the root directory of all repositories.
Use a URL like this: svn://192.168.0.1/tutorialpro to access the tutorialpro repository.