Linux SVN (YUM) installation, svnyum

Source: Internet
Author: User
Tags svn client collabnet

Linux SVN (YUM) installation, svnyum

Installation instructions

System Environment: CentOS
Installation Method: yum install (source code installation may cause version compatibility issues)
Install software: the system automatically downloads SVN Software

 

Linux svnServer Configuration

Check the installed version

# Check whether earlier versions of SVN are installed
[Root @ localhost/] # rpm-qa subversion

# If the old version is stored, uninstall the old version SVN
[Root @ localhost modules] # yum remove subversion

InstallSVN

[Root @ localhost modules] # yum install subversion

Verify Installation

Check the installed SVN version information.
[Root @ localhost 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.
[Root @ localhost modules] # mkdir-p/opt/svn/# create the SVN root directory
[Root @ localhost modules] # svnadmin create/opt/svn/repo # create a repo Test Library
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.
[Root @ localhost modules] # cd/opt/svn/repo/conf

User PasswordPasswdConfiguration

[Root @ localhost password] # cd/opt/svn/repo/conf
[Root @ admin conf] # vim passwd
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 ControlAuthzConfiguration

[Root @ admin conf] # vim authz
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.

ServiceSvnserve. confConfiguration

[Root @ admin 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/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 protective wall)

[Root @ localhost conf] # vim/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
[Root @ localhost conf] # service iptables restart

StartSVN

Svnserve-d-r/opt/svn/# specify the SVN root directory

ViewSVNProcess

Ps-ef | grep svnserve

UseImportImport File

Svn import/mnt/file: // opt/svn/repo/-m "comment"

Add/mnt/hgfs

The submitted version is 1.

DetectionSVNPort

[Root @ localhost conf] # netstat-ln | grep 3690
Tcp 0 0 0.0.0.0: 3690 0.0.0.0: * LISTEN

Stop restartingSVN

[Root @ localhost password] # killall svnserve // stop
[Root @ localhost 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

 

Start server and test:

1. Enable the SVN service and specify the SVN root directory:

[Root @ youxia201 test] # svnserve-d-r/opt/svn/

UseCheckoutExport 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 @ localhost conf] # svn checkoutsvn: // 127.0.0.1/repo # local test. The error 127.0.0.1 must be written.

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.

 

Linux svnClient Configuration

Check the installed version

# Check whether earlier versions of SVN are installed
[Root @ localhost/] # rpm-qa subversion

# If the old version is stored, uninstall the old version SVN
[Root @ localhost modules] # yum remove subversion

InstallSVN

[Root @ localhost modules] # yum install subversion

Verify Installation

Check the installed SVN version information.
[Root @ localhost 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.

SVNDownload files from the client

[Root @ localhost ~] # Mkdir/svn

[Root @ localhost ~] # Cd/svn/# store the files extracted from the svn service in this directory

[Root @ localhost svn] # svn checkoutsvn: // 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:

Svn co -- username hello -- password 123svn: // 192.168.233.203/repo

 

SVNVersion library update

Svn up/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] # svn add/svn/repo/test. php # upload the test. php file to the svn server.

Delete files on the server

[Root @ localhost] # svn rm/svn/repo/test. php -- force

View version Library Content

[Root @ localhost ~] # Svn list/svn/repo/

 

Bytes ------------------------------------------------------------------------------------------------------------------------

At this point, the SVN client configuration is complete.

 

 

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]
For example, export the files in the myproject Library to the current directory: svn co file: ///home/user/svn/myproject.

 

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.