Installation instructions
System Environment: CentOS-6.2
Installation Method: yuminstall (source code installation may cause version compatibility issues)
Install software: the system automatically downloads SVN Software
Linuxsvn Server Configuration
Check the installed version
# Check whether earlier versions of SVN are installed
[Root @ localhost/] # rpm-qasubversion
# If the old version is stored, uninstall the old version SVN
[Root @ localhostmodules] # yumremovesubversion
Install SVN
[Root @ localhostmodules] # yuminstallsubversion
Verify Installation
Check the installed SVN version information.
[Root @ localhostmodules] # svnserve -- version
Svnserve, version 1.6.11 (r934serve)
Compiled on Jun232012, 00:44:03
Copyright (C) 2000-2009CollabNet.
Subversion is open-source software. For more information, see http://subversion.tigris.org/site.
This product contains software developed by CollabNet (http://www.Collab.Net.
The backend (FS) module of the library is available in the following versions:
* Fs_base: the module can only operate BDB version libraries.
* Fs_fs: This module works with the text file (FSFS) version library.
CyrusSASL authentication is available.
Code Library Creation
After installing the SVN software, you need to create a SVN library.
[Root @ localhostmodules] # mkdir-p/opt/svn/# create the SVN root directory
[Root @ localhostmodules] # svnadmincreate/opt/svn/repo # create a repo Test Library
After executing the preceding command, the repo Test Library is automatically created. Check that the/opt/svn/repofolder contains files such as conf,db,format,hooks,locks,readme.txt, indicating that a SVN library has been created.
Configure the code library
Go to the conf folder generated above and configure it.
[Root @ localhostmodules] # cd/opt/svn/repo/conf
Passwd Configuration
[Root @ localhostpassword] # cd/opt/svn/repo/conf
[Root @ adminconf] # vimpasswd
Modify passwd to the following:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
Hello = 123
Aaa = 123
Www = 1, 123
Username = Password
In this way, the hello user and 123 password are created.
All the preceding statements must be written in the top-level format, and spaces cannot be left on the left side. Otherwise, an error occurs.
Permission control authz Configuration
[Root @ adminconf] # vimauthz
The purpose is to set which directories can be accessed by users and append the following content to the authz file:
[Groups] # Group
Admin = hello, www # create an admin group and add users to the group
[/] # Root directory permission settings (that is, the "svn" folder)
Aaa = rw # aaa has the read and write permissions on all versions of svn.
[Repo:/] # repo:/, indicating to set permissions for all resources in the repo version Library
@ Admin = rw # users in the admin group have read and write permissions on the repo version library.
[Repo2:/occi], indicating to set permissions for the occi project in version library repo2
[Repo2:/occi/aaa], indicating that the permission owner can be a user group, user, or * For the aaa directory of the occi project in version 2. Add @, * Indicates all users. The permission can be w, r, wr, or null. If it is null, no permission is granted.
All the preceding statements must be written in the top-level format, and spaces cannot be left on the left side. Otherwise, an error occurs.
Service svnserve. conf configuration
[Root @ adminconf] # vimsvnserve. conf
Append the following content:
[General]
# Anonymous access permission, which can be read, write, or none. The default value is read.
Anon-access = none
# Grant write permission to authorized users
Auth-access = write
# Password Database path
Password-db = passwd
# Access control file
Authz-db = authz
# Authentication namespace. The subversion is displayed in the authentication prompt and serves as the key word cached by the credential
Realm =/opt/svn/repo
All the preceding statements must be written in the top-level format, and spaces cannot be left on the left side. Otherwise, an error occurs.
Configure the firewall port (or directly close the firewall)
[Root @ localhostconf] # vim/etc/sysconfig/iptables
Add the following content:
-AINPUT-mstate -- stateNEW-mtcp-ptcp -- dport3690-jACCEPT
Save and restart the Firewall
[Root @ localhostconf] # serviceiptablesrestart
Start SVN
Svnserve-d-r/opt/svn/# specify the SVN root directory
View SVN Process
Ps-ef | grepsvnserve
Import files using import
Svnimport/mnt/file: // opt/svn/repo/-m "comment"
Add/mnt/hgfs
The submitted version is 1.
Check SVN Port
[Root @ localhostconf] # netstat-ln | grep3690
Tcp000.0.0.0: 255.00.0.0.0: * LISTEN
Stop restarting SVN
[Root @ localhostpassword] # killallsvnserve // stop
[Root @ localhostpassword] # svnserve-d-r/opt/svn/repo // start
If svn is already running, you can run it on another port.
Svnserve-d-r/opt/svn/-- listen-port3391
Start server and test:
1. Enable the SVN service and specify the SVN root directory:
[Root @ youxia201test] # svnserve-d-r/opt/svn/
Use checkout to export files
Note that/opt/svn is the root directory of the repository and should not overlap with the [svntest:/] Directory. An error will be prompted if the overlap occurs.
[Root @ localhostconf] # svncheckoutsvn: // 127.0.0.1/repo # local test, which must be written in error 127.0.0.1
Certification fields: <svn: // 127.0.0.1: 3690>/opt/svn/repo
"Root" Password: Press ENTER
Certification fields: <svn: // 127.0.0.1: 3690>/opt/svn/repo
User name: hello
"Hello" password:
-----------------------------------------------------------------------
Note! Your password, for the authentication domain:
<Svn: // 127.0.0.1: 3690>/opt/svn/repo
Only files on disks can be stored in plain text! If possible, consider configuring your system to make Subversion
You can save the encrypted password. See the documentation for details.
You can set the option "store-plaintext-passwords" to "yes" or "no" in "/root/. subversion/servers ",
To avoid this warning again.
-----------------------------------------------------------------------
Save Unencrypted Password (yes/no )? Yes
Obtain version 1.
Do not prompt yes/on every input.
Edit vim/root/. subversion/servers to find the downstream and remove # change on to yes. The above Green Section has prompted
Store-plaintext-passwords = no
Bytes ---------------------------------------------------------------------------------------------------------------------
At this point, the SVN server configuration is complete.
Linuxsvn client Configuration
Check the installed version
# Check whether earlier versions of SVN are installed
[Root @ localhost/] # rpm-qasubversion
# If the old version is stored, uninstall the old version SVN
[Root @ localhostmodules] # yumremovesubversion
Install SVN
[Root @ localhostmodules] # yuminstallsubversion
Verify Installation
Check the installed SVN version information.
[Root @ localhostmodules] # svnserve -- version
Svnserve, version 1.6.11 (r934serve)
Compiled on Jun232012, 00:44:03
Copyright (C) 2000-2009CollabNet.
Subversion is open-source software. For more information, see http://subversion.tigris.org/site.
This product contains software developed by CollabNet (http://www.Collab.Net.
The backend (FS) module of the library is available in the following versions:
* Fs_base: the module can only operate BDB version libraries.
* Fs_fs: This module works with the text file (FSFS) version library.
CyrusSASL authentication is available.
SVN Client File Download
[Root @ localhost ~] # Mkdir/svn
[Root @ localhost ~] # Cd/svn/# store the files extracted from the svn service in this directory
[Root @ localhostsvn] # svncheckoutsvn: // 192.168.233.203/repo # svn server address
Enter the user name and password: hello/123
Note: You can use a user name and password for access:
Svnco -- usernamehello -- password123svn: // 192.168.233.203/repo
SVN version library update
Svnup/svn/repo
Upload files to the server
[Root @ localhost] # touch/svn/repo/test. php # all actions must be completed in the repo version library.
[Root @ localhost] # svnadd/svn/repo/test. php # upload the test. php file to the svn server.
Delete files on the server
[Root @ localhost] # svnrm/svn/repo/test. php -- force
View version Library Content
[Root @ localhost ~] # Svnlist/svn/repo/
Bytes ------------------------------------------------------------------------------------------------------------------------
At this point, the SVN client configuration is complete.
Create a version Library:
Terminal input: svnadmincreate [path]
This path can be a relative path. For example, if you enter svnadmincreatemyproject in the home/user/svn/directory, the version library will be created in the home/user/svn/directory, create a folder named myproject, which is the version library file.
Import files to the version Library:
Terminal input: svnimport [Source Path] [target version library path]-m [log information]
The source path can be a relative path. During the import, all files and folders under the source path will be recursively imported. The path of the target version library must be an absolute directory (I tried it anyway ), for example, the version library directory is home/user/svn/myproject /. Write file: // home/user/svn/myproject/
For example, import the current directory to the version library myproject:
Svnimport. file: // home/user/svn/myproject-m "Import file"
Export from the version Library:
After the import, the original file is not included in version management. If you want to obtain a file under version control, you need to export it from the version library.
Terminal input: svnco [version library path]
For example, export the files in the myproject Library to the current directory: svncofile: ///home/user/svn/myproject.
Complete!