To avoid the trouble, first obtain the root permission sudo-sH to install Subversionsudoapt-getinstallsubversion. Create a new storage warehouse svnadmincreate/home/svn before configuring the file, we recommend that you first grant full read and write permissions to the/home/svn folder sudochmod-R777 */* next to file configuration, first/home/svn/conf modify: anon-acce
To avoid trouble, first obtain the root permission
Sudo-sH
Install Subversion
Sudo apt-get install subversion
Create a storage warehouse
Svnadmin create/home/svn
Before configuring files, we recommend that you grant full read and write permissions to the/home/svn folder.
Sudo chmod-R 777 */*
The next step is to configure the file:/home/svn/conf
Modify:
Anon-access = read
Auth-access = write
Password-db = passwd
Anon-access and auth-access specify the anonymous and privileged permissions respectively. By default, anonymous users are granted read-only permissions. If you want to deny anonymous access, you only need to change read to none to achieve the goal. Passwd after password-db is the file path that defines the user name and password. This file is in the same directory as snvserve. conf by default.
Remember, remove the # in front of each of the above sentences and set it to the top level.
Then add
Svnuser = password
Ly = 123456
Then configure authz. The configuration information is as follows:
[Groups]
# Harry_and_sally = harry, sally
# Harry_sally_and_joe = harry, sally, & joe
Group_admin = ly
# [/Foo/bar]
# Harry = rw
# & Joe = r
# * =
[/]
Ly = rw
* =
After the configuration is complete, you can import the version library.
Now I want to import the content under/home/paolo/a22source to the version Library:
Sudo svn import-m "first import"/home/paolo/a22source file: // home/svn
Last shown: The submitted version is 1
Set up the SVN server as follows:
Stop a Subversion server:
Killall svnserve
Start the Subversion server:
Sudo/usr/bin/svnserve-d-r/home/svn/-- listen-host 192.168.6.174
-D Indicates running in the background.-r specifies the root directory of the server. when accessing the server like www.linuxidc.com, you can directly access the server using the svn: // server ip address. If the server has multiple ip addresses, the listen-host parameter is used to specify the ip address of the listener. Generally, this parameter is not required, that is, the default value is localhost.
For multiple code repositories, you can use the-r option to specify the server root directory at startup. However, you need to write the relative path of Each repository relative to the svn root directory during access.
For example, we have two code repositories:/home/repo1 and/home/repo2. We use svnserve-d-r/home -- listen-host 192.168.1.16 to start them, when accessing the client, you can use svn: // 192.168.1.16/repo1 and svn: // 192.168.1.16/repo2 to access two projects respectively.
After that, you can use commands or clients to test whether the server is successfully built. I am using the RapidSVN client. Right-click the bookmarks and choose "check out new Working Copies", URI: svn: // 192.168.6.174, target directory:/home/paolo/a22svn
Reminder:
You can use xinetd to start the svnserve daemon.
Install xinetd first
Sudo apt-get install xinetd
Create a svn file under/etc/xinetd. d/
(Because the directory in/etc/xinetd. d/is read-only, you need to use commands to create and read/write data,
New file:
Sudo touch/etc/xinetd. d/svn
Edit file:
Sudo gedit/etc/xinetd. d/svn
)
The file content is as follows:
Service svn
{
Disable = no
Port = 3690
Socket_type = stream
Protocol = tcp
Wait = no
User = svn
Server =/usr/bin/svnserve
Server_args =-I-r/home/svn
}
Finally, restart xinetd/etc/init. d/xinetd restart