SVN server installation and configuration under ubuntu

SVN server installation and configuration under
ubuntu 1. SVN installation
1. Installation package
$ sudo apt-get install subversion

2. Add svn management user and subversion group
$ sudo adduser svnuser
$ sudo addgroup subversion
$ sudo addgroup svnuser subversion

3. Create project directory
$ sudo mkdir /home/svn
$ cd /home/svn
$ sudo mkdir fitness
$ sudo chown -R root:subversion fitness
$ sudo chmod -R g+rws fitness

4. Create SVN file repository
$ sudo svnadmin create /home/svn/fitness

5 .Access and project import:
$ svn co file:///home/svn/fitness
or
$ svn co file://localhost/home/svn/fitness
* Note:
If you are not sure about the host name, you must use three slashes (///), whereas if you specified the name of the host, you must use two slashes (//).
//--
The following command is used to import the project into the SVN file repository:
$ svn import -m "New import" /home/svn/fitness file:///home/svnuser/src/fitness
Be sure to specify the import information

//-- ------------------------//
6. Access permission settings
Modify the /home/svn/fitness directory:
svnserve.conf, passwd, authz file, no spaces are allowed at the top of the line
//--
edit the svnserve.conf file, uncomment the following two lines
password-db = password
authz-db = authz

//Additional instructions
# [general]
anon-access = read
auth- access = write
password-db = passwd
where anon-access and auth-access are the permissions of anonymous and privileged users respectively. The default is to give anonymous users read-only permissions, but if you want to

deny access to anonymous users, just change read to If it becomes none, it will achieve the goal.

//--
Edit /home/svnuser/etc/passwd as follows:
[users]
mirze = 123456
test1 = 123456
test2 = 123456
//--
Edit /home/svnuser/etc/authz as follows
[groups]
admin = mirze, test1
test = test2
[/]
@admin=rw
*=r
Three users mirze, test1 are set here , The passwords of test2 are all 123456.
mirze and test1 belong to the admin group and have read and write permissions. Test2 belongs to the test group and only has read permissions

. 7. Start the SVN service
svnserve -d -r /home/svn
Description:
-d means svnserver Run -r in "daemon" process mode to
specify the root location of the file system (root directory of the repository), so that the client can access the repository without entering the full path. For
example : svn://192.168.12.118/fitness

At this time SVN The installation is complete.
LAN access method:
For example: svn checkout svn://192.168.12.118/fitness --username mirze --password 123456 /var/www/fitness

Guess you like

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