Linux SVN Build (YUM) installation

Source: Internet
Author: User
Tags svn svn client collabnet

Http://www.centoscn.com/CentosServer/ftp/2014/0202/2409.html
Linux SVN Build (YUM) installation

Installation Instructions
System Environment: CentOS-6.2
Installation method: Yum Install (source installation is prone to version compatibility issues)
Install software: The system automatically downloads SVN software
One, Linux SVN server configuration
Check for installed versions
#检查是否安装了低版本的SVN
[[email protected]/] #rpm-QA Subversion
#如果存储旧版本, uninstall the old version of SVN
[[email protected] modules] #yum Remove Subversion
Install SVN
[[email protected] modules] #yum install Subversion
Verifying the installation
Verify that the SVN version information is installed
[Email protected] modules]# Svnserve--version
Svnserve, Version 1.6.11 (r934486)
Compiled in June 23 2012,00:44:03
Copyright (C) 2000-2009 CollabNet.
Subversion is an open source software, see the http://subversion.tigris.org/site.
This product contains software developed by CollabNet (http://www.Collab.Net/).

The following repository back-end (FS) modules are available:
* Fs_base: The module can only operate the BDB repository.
* FS_FS: The module works with a text file (FSFS) repository.

Cyrus SASL certification is available.
Code base Creation
SVN repository is also required after the installation
[[email protected] modules] #mkdir-P/opt/svn/#创建SVN根目录
[[email protected] modules] #svnadmin Create/opt/svn/repo #创建repo测试库
After executing the above command, automatically establish the Repo test library, View/opt/svn/repo folder discovery contains Conf, db,format,hooks, locks, README.txt and other files, stating that an SVN repository has been established.
Configuring the Code base
Go to the folder created above conf, configure
[[email protected] modules] #cd/opt/svn/repo/conf
User Password passwd configuration
[[email protected] password] #cd/opt/svn/repo/conf
[[email protected] conf] #vim passwd
Modify passwd to the following:
[Users]
# Harry = Harryssecret
# sally = Sallyssecret
Hello = 123
AAA = 123
www = 123
User name = password
So we set up a hello user, 123 password
All of the above statements must be shelf written, the left cannot be blank, or an error will occur.
Permissions Control Authz Configuration
[[email protected] conf] #vim Authz
The goal is to set which users can access which directories, append the following to the Authz file:
[Groups] #组
admin = hello,www #创建一个admin组, adding users to the group
[/] #根目录权限设置 (This is the "SVN" folder)
AAA = RW #aaa对svn下的所有版本库有读写权限
[repo:/] #repo:/, set permissions on all resources under the repo repository
@admin = RW #admin组的用户对repo版本库有读写权限
[Repo2:/occi], which means setting permissions on Occi items in the repository Repo2
[REPO2:/OCCI/AAA], which indicates that the AAA directory of the OCCI project in version 2 is set to the permissions permission principal can be a user group, a user, or a *, the user group is preceded by a @,* representing all users. Permissions can be W, R, WR, and NULL, and NULL indicates no permissions.
All of the above statements must be shelf written, the left cannot be blank, or an error will occur.
Service svnserve.conf Configuration
[[email protected] conf] #vim svnserve.conf
Append the following content:
[General]
#匿名访问的权限, can be read,write,none, default is read
Anon-access = None
#使授权用户有写权限
auth-access = Write
#密码数据库的路径
Password-db = passwd
#访问控制文件
Authz-db = Authz
#认证命名空间, Subversion is displayed in the authentication prompt and is used as a keyword in the credential cache
Realm =/opt/svn/repo
All of the above statements must be shelf written, the left cannot be blank, or an error will occur.
Configuring firewall ports (or directly shutting down the fence)
[[email protected] conf] #vim/etc/sysconfig/iptables
Add the following content:
-A input-m state--state new-m tcp-p TCP--dport 3690-j ACCEPT
Restart firewall after saving
[[email protected] conf] #service iptables restart
Start SVN
Svnserve-d-r/opt/svn/#指定SVN根目录
View SVN process
Ps-ef|grep Svnserve
Import files using Import
Export Svn_editor=vim
Source/etc/bashrc
SVN import/mnt/file:///opt/svn/repo/-M "comment"
Increase/mnt/hgfs
The version after submission is 1.
Detecting SVN ports
[[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 you already have SVN running, you can run it on a different port.
svnserve-d-r/opt/svn/--listen-port 3391

Start the server and test:
1, start the SVN service, and specify the SVN root directory:
[Email protected] test]# svnserve-d-r/opt/svn/
Export files using Checkout
In particular, it is important to note that/OPT/SVN is the repository's root directory and does not overlap the [svntest:/] directory. If overlap is a prompt error
[[Email protected] conf]# svn checkout Svn://127.0.0.1/repo #本机测试, must write wrong 127.0.0.1
Certification field: <svn://127.0.0.1:3690>/opt/svn/repo
Password for "root": Direct enter
Certification field: <svn://127.0.0.1:3690>/opt/svn/repo
User name: Hello
Password for "Hello":
-----------------------------------------------------------------------
Attention! Your password, for the authentication domain:
<svn://127.0.0.1:3690>/opt/svn/repo
Can only be saved in plain text on disk! If possible, consider configuring your system so that Subversion
You can save the encrypted password. Please refer to the documentation for more information.
You can do this by setting the option "Store-plaintext-passwords" to "yes" or "no" in "/root/.subversion/servers".
To prevent this warning from appearing again.
-----------------------------------------------------------------------
Save unencrypted password (yes/no)? Yes
Remove version 1.
Do not let it prompt yes/on every time the input method
Edit Vim/root/.subversion/servers Find the following line remove # # will change on to Yes, the green section above has been prompted
Store-plaintext-passwords = No
--------------------------------------------------------------------------------------------------------------- ------
At this, the SVN server is configured to complete the
Second, Linux SVN client Configuration
Check for installed versions
#检查是否安装了低版本的SVN
[[email protected]/] #rpm-QA Subversion
#如果存储旧版本, uninstall the old version of SVN
[[email protected] modules] #yum Remove Subversion
Install SVN
[[email protected] modules] #yum install Subversion
Verifying the installation
Verify that the SVN version information is installed
[Email protected] modules]# Svnserve--version
Svnserve, Version 1.6.11 (r934486)
Compiled in June 23 2012,00:44:03
Copyright (C) 2000-2009 CollabNet.
Subversion is an open source software, see the http://subversion.tigris.org/site.
This product contains software developed by CollabNet (http://www.Collab.Net/).
The following repository back-end (FS) modules are available:
* Fs_base: The module can only operate the BDB repository.
* FS_FS: The module works with a text file (FSFS) repository.

Cyrus SASL certification is available.
SVN client Download file
[Email protected] ~]# MKDIR/SVN
[Email protected] ~]# cd/svn/#将svn服务上提取的文件放在此目录下
[Email protected] svn]# svn checkout Svn://192.168.233.203/repo #svn服务器地址
Enter user name password: hello/123
Note: You can use Access with a user name and password:
SVN co--username Hello--password 123svn://192.168.233.203/repo
SVN repository Update
SVN Up/svn/repo
Uploading files to the server
[Email protected]]# touch/svn/repo/test.php #所有的动作必须在repo版本库中完成
[[Email protected]]# svn add/svn/repo/test.php #上传test. php file to SVN server
Delete files on the server
[[Email protected]]# SVN rm/svn/repo/test.php--force
View Repository Content
[[Email protected] ~]# SVN list/svn/repo/
--------------------------------------------------------------------------------------------------------------- ---------
At this, the SVN client is configured to complete the

Iii. Summary of key steps
<1>
To create a repository:
Terminal input: svnadmin create [path]
The path can be a relative path, for example, currently in the home/user/svn/directory, enter svnadmin create MyProject, the repository will be created in the home/user/svn/directory, a new folder named MyProject, This is the repository file.
<2> import files into the repository:
Terminal input: SVN import [Source path] [target repository path]-m [Log information]
The source path can be a relative path, and the import will recursively import all the files and folders under the source path, and the target repository path requires an absolute directory (anyway I'm experimenting with this), such as the repository's directory: home/user/svn/myproject/. It should be written like this: file:///home/user/svn/myproject/
For example, import the current directory into the repository MyProject:
SVN import. File:///home/user/svn/myproject-m "Import File"
<3>
Export from repository:
After importing the original file is not included in version management, if you want to get version-controlled files, you need to export from the repository
Terminal input: SVN co [repository Path]
For example, export files from the MyProject library to the current directory: SVN co file:///home/user/svn/myproject.

Linux SVN Build (YUM) installation

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.