Server installation setup-subversion-1.7.7 installation path: D: \ Subversion
Create the svn directory in the D: \ root directory as the SVN version library directory.
Next, create a project Bobo directory under the D: \ SVN \ directory. Then, right-click the Directory and choose tortoisesvn-> Create a version library here and click "OK" (Note: Do not create a directory structure-reason: I am not familiar with SVN, after testing, if a directory structure is created, three more directories will be created in the project file synchronized to the client: branches, tags, and trunk. Currently, I have not mastered this function. Therefore, to keep the synchronized content clean, do not create a directory structure here .)
Next, enable the server:
Error enabling method:
Svnserve-D-r d: \ SVN \ Bobo
Correct enabling method:
Svnserve-D-r d: \ SVN
As authentication fails, you cannot solve the problem by finding related content online for a long time. Experience has finally solved the problem:
Svnserve. conf content Configuration:
[Plain]
View plaincopy
- [General]
- Anon-access = read
- Auth-access = write
- Password-DB = passwd
- # Authz-DB = authz
- Realm = my first Repository
Note that I have commented # authz-DB = zuthz. If the comment is removed, the authentication fails.
If other files are not moved, you can browse the version library at SVN: // server IP Address/Bobo.
However, it was found that there was no account password, which was not safe.
Content configuration of svnserve. conf Source: SVN authentication failed
Solution:
Passwd file content:
[Plain]
View plaincopy
- [Users]
- # Harry = harryssecret
- # Sally = sallyssecret
- Admin = Admin
- Test = test
The format is: account = password. One user is a line.
Next, in the content of svnserver. conf:
Change anon-access = read to Anon-access = none.
Summary:
I. Configuration
[Plain]
View plaincopy
- [General]
- Anon-access = none # Make unauthorized users inaccessible. If the value is read, the unauthorized users are readable. This is why access is allowed without entering the account password.
- Auth-access = write # grant the authorized user the write permission
- Password-DB = passwd # specify the password file path
- # Authz-DB = authz # access control file
- Realm = my first Repository
Ii. Instructions
Start the service and run svnserve-d-r SVN service root directory
The svnserve command is used to start the svn service.-D indicates that the command runs in daemon mode and SVN automatically listens on port 3690. 3690 is the default port. You can use "-- listen-Port =" or "-- listen-host =" to specify other ports. The-r option is used to specify the root directory of the svn service, so that you can use the relative path for access without providing the complete path.
Run the following command to check out SVN checkout SVN: // 127.0.0.1/Dir. The IP address needs to be adjusted according to the actual situation. DIR is the version library path. If it is specified at startup, it can be omitted.
The version library information is in the version library folder. to delete a version library, you only need to delete the folder where the version library is located. In addition, work copies are only self-maintained folders, which can be deleted directly in windows without affecting others. Do not use the DELETE command of the version library. Otherwise, the content in the version library will be deleted.
Iii. As I mentioned above, if you remove the # number before authz-DB = zuthz, the authentication will inevitably fail. I want to correct it here. The ignorant are fearless. Passes tests and passes Certification
1. Remove the # number before the above authz-DB = authz.
2. Modify the authz File
[Plain]
View plaincopy
- [Aliases]
- # Joe =/C = xz/ST = dessert/L = snake city/o = snake oil, Ltd./ou = Research Institute/CN = Joe average
- [Groups]
- Harry_and_sally = admin, Sally # Here I use grouping. Because it is a team, there are many people
- # Harry_sally_and_joe = Harry, Sally, & Joe
- # [/Foo/bar]
- # Harry = RW
- # & Joe = r
- # * =
- [Bobo:/] # authorize the Bobo Repository
- @ Harry_and_sally = RW # R indicates reading W indicates writing
- # * = R # * wildcard, indicating all people. If the # sign is removed, it indicates that anyone can access it (read-only access, not writable). Note: after testing, remove, verification is still required.
If you do not use the group method, the configuration is as follows:
[Plain]
View plaincopy
- [Aliases]
- # Joe =/C = xz/ST = dessert/L = snake city/o = snake oil, Ltd./ou = Research Institute/CN = Joe average
- [Groups]
- # Harry_and_sally = zm2714, Sally
- # Harry_sally_and_joe = Harry, Sally, & Joe
- [Bobo:/]
- Admin = RW
- # & Joe = r
- # * = R
- # [Bobo:/]
- # @ Harry_and_sally = RW
- # * = R
Registration Service
Subversion server started as a service
The Subversion server supports Windows and Linux.
In Linux, run the following command to start the service:
Svnserve-d-r/svnroot
-D indicates -- daemon, that is, the command execution window is closed and the Service continues to exist. -R indicates -- root, that is, the root directory of the specified database.
In Windows, you can use the same command, but the service disappears after the CMD window is closed. The solution to this problem was to use SVN Windows Service wrapper to package it as a service before version 1.4. After svn1.4, it can be directly supported to start on the server. The method is to use the service controltool that comes with Windows XP and 2000, and the execution file is SC .exe.
Note: To use the "SC" command, you must install Windows 2000/2003 Resource Kit (Resource Kit). Otherwise, the command is invalid.
Enter the following command in the CMD window:
[Plain]
View plaincopy
- SC create svnservice binpath = "D:/program files/subversion/bin/svnserve.exe -- service-R D:/mysvn" displayname = "svnservice" depend = TCPIP start = auto
Binpath specifies the svnserve path and command. Note that the parameters are -- service, not -- daemon.-D,-I,-T, and other parameters cannot be used.
Start = auto indicates that the service is automatically started. Note: there must be no space on the left of the equal sign, and a space on the right.
Displayname = "svnservice" indicates the name of the service to be registered.
After execution, the system returns
[SC] createservice success
Indicates that the service is successfully created.
Start the service command:
[Plain]
View plaincopy
- Net start svnservice
Stop Service command:
[Plain]
View plaincopy
- Net stop svnservice
Delete service command:
[Plain]
View plaincopy
- SC Delete svnservice