1. Install SVN under Ubuntu 1. Installation Package $ sudoapt-getinstallsubversion2. Add svn management user and subversion group $ sudoaddusertang
I. Install SVN in Ubuntu
1. Installation Package
- $ Sudo apt-get install subversion
-
- 2.Add svn users and subversion groups
- $ Sudo adduser tang
- $ Sudo addgroup subversion
- $ Sudo addgroup tang subversion
-
- 3.Create a project directory
- $ Sudo mkdir/home/svn
- $ Cd/home/svn
- $ Sudo mkdir project
- $ Sudo chown-R root: subversion project
- $ Sudo chmod-R g + rws project
Or
$ sudo mkdir /home/svn
$ sudo chown www-data:www-data -R /home/svn/
$ sudo chmod 770 -R /home/svn/
4. create a SVN file Repository $ sudo svnadmin create/home/svn/project5. access method and project import: $ svn co file: // home/svn/project or $ svn co file: // localhost/home/svn/project
* Note:
If you are not sure about the host name, you must use three slashes (//). If you specify the Host Name, you must use two slashes (//).
//--
The following command is used to import a project to the SVN File Repository:
$ Svn import-m "New import"/home/svn/projectfile: // home/svnuser/src/project
Be sure to indicate the import information
6. access permission settings
Modify the/home/svn/project directory:
Svnserve. conf, passwd, and authz files. spaces are not allowed at the front end of the row.
Edit the svnserve. conf file and uncomment the following two lines.
- Password-db = password
- Authz-db = authz
-
- // Additional instructions
- # [General]
- Anon-access = read
- Auth-access = write
- Password-db = passwd
Here, anon-access and auth-access are respectively anonymous and permission granted to authorized users. By default, anonymous users are granted read-only permissions.
You only need to change read to none to achieve the purpose of user access.
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
Here we have set up three users, mirze, test1, and test2, all of which are 123456 passwords.
Among them, mirze and test1 belong to the admin group and have the read and write permissions. test2 belongs to the test group and only has the read permission.
7. Start the SVN Service
Svnserve-d-r/home/svn
Description:
-D indicates that svnserver runs in "daemon" process mode
-R specifies the root location of the file system (the root directory of the version Library), so that the client can access the version library without entering the full path.
For example, svn: // 192.168.12.118/fitness
8. Stop the SVN service.
Killall svnserve
The SVN installation is complete.
LAN access method:
Example: svn checkout svn: // 192.168.1.104/tang -- username mirze -- password 123456/var/www/fitness