Setup of SVN server under Linux

Source: Internet
Author: User

Online tutorial is really disgusting, not too old, is a problem, just reference an article also has a problem. I recorded it, after the convenience of use, and now one side reinstall again, while recording. The author's own test, today is May 29 night.

Linux uses Centos6.2,yum install Subversion, which installs the SVN server. This action is root user rights.

1. Build the SVN repository directory.

Mkdir-p/OPT/SVNDATA/REPOS1

2. Build the Repository

Svnadmin CREATE/OPT/SVNDATA/REPOS1

3. Modify the configuration file

(1) Server main file svnserve.conf (said must shelf write)

Vi/opt/svndata/repos1/conf/svnserve.conf

[General]
Anon-access = None
auth-access = Write
Password-db =/opt/svndata/repos1/conf/passwd
Authz-db =/opt/svndata/repos1/conf/authz
Realm = Repos1

(2) User password

vi/opt/svndata/repos1/conf/passwd

[Users]
Wang = Hello
King = Hello

(3) Permissions

Vi/opt/svndata/repos1/conf/authz

[Groups]
admin = Wang
[/]
@admin = RW #可读写的意思
[repos1:/]
King = RW

4. Create a user to start SVN:


Useradd SVN
passwd SVN


Follow the prompts to set a password for the user svn
Allow user svn access to repository:

Chown-r Svn:svn/opt/svndata

5. Start SVN

Svnserve-d–-listen-port 3690-r/opt/svndata

If the cant bind server socket prompt appears, the port is occupied. Use the following command:

Ps-e|grep Svnserve

Kill the ID that appears, and then start with the command above.

6. Verify the Startup status

Use the command:

Ps-ef|grep Svnserve

The following prompt appears, indicating that it has been started

Root 6941 1 0 15:07? 00:00:00 Svnserve-d–listen-port 3690-r/opt/svndata

7. Testing the server

Command: SVN co SVN://127.0.0.1/REPOS1
Authentication Realm: <svn://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Password for ' root ':
Authentication Realm: <svn://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Username:server_group

The first time to enter the previous settings of the account and password, as well as the Linux user password, the general content such as above, this is the copy of the other place. Finally appeared Checked out revision. The instructions are OK.

Also pay attention to the Linux firewall, the port does not pass, the client is not accessible.

# Vi/etc/sysconfig/iptables

Add the following line to refer to the existing 22 port of SSH that is already open

-A input-m state--state new-m tcp-p TCP--dport 3690-j ACCEPT

At this point, all OK, online tutorial too pit Dad, get a few hours. is also the first time to configure this, I hope this can give some people like me, bring some help. It's late at night.

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.