SVN installation in Linux
1. Install
Make sure subversion is not installed on Linux
find / -name subversion
Copy the code
If it is not installed, it is blank. If it is installed, it can create a new version library
The default port used by the SVN is 3690. In Windows, you can run the tcping.exe command to check whether the server port is accessible. Download.elifulkerson.com//files/tcpi…
Tcping 1.117.23.51 3690Copy the code
If the following information is displayed, the port is open
If the port is not open, use the firewall to open the port and check whether the port is open.
Install the command using yum
yum install subversion
Copy the code
2. Create the warehouse and configure it
2.1 Creating a Warehouse
Create a root directory of the SVN repository in the /home directory. Create a repository such as repository in the next layer of SVN
mkdir -p /home/svn/repository
Copy the code
Create a repository
svnadmin create /home/svn/repository
Copy the code
Entering the warehouse
cd /home/svn/repository
ls
Copy the code
You can see the following under the warehouse
Conf file is used to store configuration files. You can see the following files in this folder
Among them:
Authz: indicates a permission control file
Passwd: indicates the password file
Svnserve. conf: indicates the SVN service configuration file
2.2 Modifying the Configuration File
The next step is to modify these three files
Modify the passwd file to create two users, test1 and test2
vim passwd
Copy the code
Configure the Authz file
vim authz
Copy the code
Add the following at the end of the text
All future project repository code is placed under this
[/] : represents all files in the warehouse
Test1 = rw :test1 can be read and written by users
Test2 = rw :test2 is read-only
*= : Other users have no permission
2.3 Using Groups
Groups can be used to facilitate user and warehouse management
vim authz
Copy the code
group1 = test1
group2 = test2
[/]
@group1 = rw
@group2 = r
*=
Copy the code
Two groups are configured. Users in group 1 can read and write, and users in group 2 can read only
Format description:
Repository directory format: [> < repository: / project/directory] @ < user group name > = < access > < user name > = < permission >Copy the code
2.4 configuration svnserve. Conf
vim svnserve.conf
Copy the code
Open the configuration comment and fill in the repository path
Anon-access = none # Log Message cannot be displayed if the value is read. Message auth-access = write # auth-db = passwd # Which file to use as account file authz-db = authz # which file to use as permission file realm = /home/ SVN # Authentication space name, version library directoryCopy the code
** Note: ** the last line of realm should be changed to SVN directory. Do not open comments with Spaces, otherwise an error may occur
3 start
Start the
svnserve -d -r /home/svn
Copy the code
Grammar:
Svnserve-d -r SVN warehouse directoryCopy the code
Check to see if it is started
lsof -i:3690
Copy the code
If the following information is displayed, the startup is successful
restart
Kill svnserver
killall svnserve
Copy the code
Restart the
svnserve -d -r /home/svn
Copy the code
Viewing the SVN Process
ps -ef|grep svn
Copy the code
Run the kill -9 pid command to kill a process
4 Client connection
The TortoiseSVN tool needs to be installed in TortoiseSVN
SVN :// If you TortoiseSVN :// if you TortoiseSVN :// if you TortoiseSVN ://
The default port is 3690. If you change the port, remember to add the port number.
Enter the user name and password for authentication
After clicking OK, the warehouse is pulled successfully
5 Problems Occur
Question 1: when checkout, tip: URL ‘SVN: / / 39.101.220.235 / svnrepos’ doesn’ t exist
If the SVN path is /home/svn/repository
Commands cannot be used during startup
svnserve -d -r /home/svn/repository
Copy the code
Use the following command
svnserve -d -r /home/svn
Copy the code