Build SVN + Apache server under centos

Source: Internet
Author: User
  1. Install software package

# yum install httpd
# yum install mod_dav_svn
# yum install subversion

2. Verify Installation

 # httpd -version

Result:

Go to/etc/httpd/modules/and check whether mod_dav_svn.so and mod_authz_svn.so are included. If yes, mod_dav_svn is successfully installed.

# svnserve --version

Result:

SVN is successfully installed.

3. Create a repository

 # mkdir /var/www/svn # cd /var/www/svn # svnadmin create repo1

4. Configuration

The/var/www/SVN directory contains a repo1 folder.

Modify owner:

 # chown -R apache:apache repo1

Copy/var/www/SVN/repo1/conf to/var/www/SVN and create a passwd file

# Cp/var/www/SVN/repo1/CONF/authz/var/www/SVN/authz # cd/var/www/SVN # vi passwd: WQ save and quit

Generate an account:

 # htpasswd /var/www/svn/passwd user1

Enter the password to generate the user1 account

Permission management settings:

 # vi /var/www/svn/authz

Add a group under [groups,

[/] Is equivalent to the/var/www/SVN Directory, which grants permissions to the user group.

[Repo1:/] indicates the repo1 library.

[Repo1:/Desgin] is the Desgin directory under repo1

[groups]admin=user1proj1_developer=user2,user3proj2_develoer=user2,user4proj1_desgin=user5,user6[/]@admin=rw[repo1:/]@proj1_developer=rw[repo1:/desgin]@proj1_desgin=rw[repo2:/]@proj2_developer=rw

Associate SVN with Apache:

 # vi /etc/httpd/conf.d/subversion.conf

Add:

<Location /repos>   DAV svn   SVNParentPath /var/www/svn#   # Limit write permission to list of valid users.#   <LimitExcept GET PROPFIND OPTIONS REPORT>#      # Require SSL connection for password protection.#      # SSLRequireSSL#      AuthType Basic      AuthName "Authorization SVN"      AuthzSVNAccessFile /var/www/svn/authz      AuthUserFile /var/www/svn/passwd      Require valid-user#   </LimitExcept></Location>

Restart httpd

 # service httpd restart


5. Test through a browser

Enter http: // ip or website/repos/repo1 in the browser

The Enter Password dialog box appears. Enter the created user name and password to log on.

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.