Install SVN server on CentOS

Source: Internet
Author: User

Install SVN server on CentOS

After one day, I finally placed the SVN server and made a note.

Software Environment

Virtual Machine: WMware Workstation 10, operating system: CentOS6.5.

The system automatically downloads SVN software, so virtual machines are required to be connected to the network.

Installation steps:

1. Check whether earlier versions of SVN are installed.

[Root @ localhost/] # rpm-qa subversion

# Uninstall the old version SVN

[Root @ localhost modules] # yum remove subversion

2. Install SVN

[Root @ localhost modules] # yum install httpd-devel subversion mod_dav_svn mod_auth_mysql

3. confirm that the svn module is installed.

[Root @ localhost/] # cd/etc/httpd/modules

[Root @ localhost modules] # ls | grep svn

Mod_authz_svn.so

Mod_dav_svn.so

4. Check the installed SVN version information.

[Root @ localhost modules] # svnserve -- version

5. Create a code library

After installing the SVN software, you need to create a SVN library.

[Root @ localhost modules] # mkdir-p/opt/svn/repos

[Root @ localhost modules] # svnadmin create/opt/svn/repos

After executing the preceding command, the repositories library is automatically created. Check the/opt/svn/repos folder and find files including conf, db, format, hooks, locks, README.txt, etc, it indicates that a SVN library has been created.

6. Configure the code library

Go to the conf folder generated above and configure it.

[Root @ localhost modules] # cd/opt/svn/repos/conf

7. passwd Configuration

[Root @ localhost password] # cd/opt/svn/repos/conf

[Root @ admin conf] # vi passwd

Modify passwd to the following:

[Users]

# Harry = harryssecret

# Sally = sallyssecret

Zhannng= 123456

8. Permission control authz Configuration

[Root @ admin 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

[/]

Zhannng = rw

Service svnserve. conf configuration

[Root @ admin conf] # vi 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

Configure the firewall port

[Root @ localhost 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

[Root @ localhost conf] # service iptables restart

9. Start SVN

Svnserve-d-r/opt/svn/repositories

View SVN Process

[Root @ localhost conf] # ps-ef | grep svn | grep-v grep

Root 12538 1 0? 00:00:00 svnserve-d-r/opt/svn/repositories

10. Check SVN Port

[Root @ localhost conf] # netstat-ln | grep 3690

Tcp 0 0 0.0.0.0: 3690 0.0.0.0: * LISTEN

11. Stop/restart SVN

[Root @ localhost password] # killall svnserve // stop

[Root @ localhost password] # svnserve-d-r/opt/svn/repositories/start

12. If svn cannot be connected, disable the firewall.

[Root @ localhost password] # service iptables stop # stop, effective immediately

[Root @ localhost password] # chkconfig iptables off # disabled. It takes effect only after a restart.

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.