CentOS 6.2 SVN setup (YUM installation)

Source: Internet
Author: User
Tags svn client tortoisesvn collabnet
Installation Instructions

After installing the SVN server, this article is not integrated with Apache. The process is as follows:

System environment: CentOS-6.2
Installation method: yum install (source code installation may cause version compatibility issues)
Install software: the system automatically downloads SVN software

 

Check the installed version

# Check whether earlier versions of SVN are installed
[[Email protected]/] # rpm-qa subversion

# If the old version is stored, uninstall the old version SVN
[[Email protected] modules] # yum remove subversion

Install SVN

[[Email protected] modules] # yum install subversion

Verify installation

Check the installed SVN version information.
[[Email protected] modules] # svnserve -- version

Svnserve, Version 1.6.11 (r934serve)
Compiled on Jun 23,: 44: 03

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, 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.

Cyrus SASL authentication is available.

Code Library creation

After installing the SVN software, you need to create a SVN Library.
[[Email protected] modules] # mkdir-p/opt/svn/repo
[[Email protected] modules] # svnadmin create/opt/svn/repo
After executing the preceding command, the repo test Library is automatically created. Check the/opt/svn/repo folder and find files including conf, db, format, hooks, locks, README.txt, etc, it indicates that a SVN Library has been created.

Configure the code library

Go to the conf folder generated above and configure it.
[[Email protected] modules] # cd/opt/svn/repo/conf

Passwd configuration

[[Email protected] password] # cd/opt/svn/repos/conf
[[Email protected] conf] # vim passwd
Modify passwd to the following:

[Users]
# Harry = harryssecret
# Sally = sallyssecret

Hello = 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

[[Email protected] conf] # vi + authz
The purpose is to set which directories can be accessed by users and append the following content to the authz file:

# Set [/] to indicate all resources under the root directory
[/] Or [repl:/]

Hello = rw

This means that the hello user has read and write permissions on all directories in the repo test Database. Of course, it can also be limited.
If you use it on your own, read and write it directly.

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

[[Email protected] conf] # vim svnserve. 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/repositories

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

[[Email protected] conf] # vi/etc/sysconfig/iptables
Add the following content:
-A input-m state -- state NEW-m tcp-p tcp -- dport 3690-j ACCEPT
Save and restart the firewall
[[Email protected] conf] # service iptables restart

Start SVN

Svnserve-d-r/opt/svn/repo

View SVN process

[[Email protected] conf] # ps-ef | grep svn | grep-v grep
Root 12538 1 0? 00:00:00 svnserve-d-r/opt/svn/repo

Check SVN Port

[[Email protected] conf] # netstat-ln | grep 3690
Tcp 0 0 0.0.0.0: 3690 0.0.0.0: * LISTEN

Stop restarting SVN

[[Email protected] password] # killall svnserve // stop
[[Email protected] password] # 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-port 3391

 

Test

The SVN service has been started. Use the client to test the connection.
Client connection address: svn: // 192.168.15.231
Username/password: hello/123
Test the operations such as creating folders.

Create a version Library:
Terminal input: svnadmin create [path]
This path can be a relative path. For example, enter svnadmin create myproject in the home/user/svn/directory, the version library will be created in the home/user/svn/directory, and a new folder named myproject will be created, which is the version library file.

Import files to the version Library:
Terminal input: svn import [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:
Svn import. 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: svn co [version library path] [export target path]
For example, export the files in the myproject library to the current directory: svn cofile: ///home/user/svn/myproject.

5. Install the svn client on Windows XP: TortoiseSVN (SVN client)

1,: http://tortoisesvn.net/downloads.html

2. After the download is complete, directly install the tool next. After the installation is complete, restart the tool to take effect.

3. Test:

Create a directory named svntest on the desktop, right-click the Directory, select Checkout, and enter the svn server IP address and repository name in the first line.

Enter the user name and password.

For more information about CentOS, see the CentOS topic page http://www.linuxidc.com/topicnews.aspx? Tid = 14

CentOS 6.2 SVN setup (YUM installation)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.