CentOS7 Build Svn+http Access

Source: Internet
Author: User
Tags svn svn client centos server

1, prepare to work off SELinux

Check the status below getenforce , and if it is enforcing, close
Temporary shutdown:setenforce 0
Permanently closed: vi /etc/selinux/config change selinux=enforcing to selinux=disabled (this reboot takes effect)

2, install the appropriate software

Install Subversion:yum install subversion
Install Apache:yum install httpd
Apache installs the SVN module:yum iinstall mod_dav_svn

3, create SVN repository

cd /var/svndata(Here I created the Svndata directory under the/var path and entered the Svndata)
svnadmin create repo1(Create warehouse REPO1, warehouse name is random)

4, configure the relevant file configuration Authz file under repo1/conf (authentication rule)

Add the following message: [svndata:/] line break admin = rw (this Admin user is for the later Apache to create)
[repo1:/]NewLine test = rw (This user was first used to test if SVN was deployed successfully)

passwd file (user account information, admin is not configured here, because Admin user's password information Apache will be configured)

Add the following information: test=test (the test is the password for testing)

SVNSERVE.CONF (Primary configuration permission control file)

Cancel the following comment:
anon-access = readAnonymous access permissions, default read
auth-access = writeAuthorized User Rights
password-db = passwdPassword Database location
authz-db = authzAccess Control files

5, configure the wall to open 3690 port (SVN service), restart the firewall (ignore this step to turn off the firewall)

firewall-cmd --permanent --zone=public --add-port=3690/tcp
systemctl restart firewalld.service

6. Test if SVN is installed successfully

Start SVN:svnserve -d -r /var/svndata
Here I installed the client tortoisesvn, direct checkout, Address bar input svn://ip/repo1 (this IP for your CentOS server IP), account password for the previous set of test

7, modify Apache httpd.conf configuration file, apache default installation When this profile is under/etc/httpd/conf/path

Find ' LoadModule ' and add a message under it


LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
<Location /svndata>
DAV svn
SVNPath /var/svndata/repo1
AuthType Basic
AuthName "Subversion repos"
AuthUserFile /etc/httpd/svn.htpasswd
AuthzSVNAccessFile /var/svndata/repo1/conf/authz
Require valid-user
</Location>

The relevant configuration explains DAV SVN that uses the MOD_DAV_SVN module SVNPATH/VAR/SVNDATA/REPO1 to represent your warehouse address, Note Because I have only one warehouse, so with Svnpath instead of svnparentpathsvn.htpasswd. File is an HTTP access configured account password information 8, create svn.htpasswd file

htpasswd -cm /etc/httpd/svn.htpasswd admin(then enter the admin password, password casually, note that the admin account of SVN access prior to configuration)

9, let Apache users have read and write access to SVN

First of all my svndata users and user groups are root, so I added Apache to the root user group
usermod -a -G root apache
Then add a write permission to the user group
chmod -R g+w /var/svndata/

10, Launch Apache

Open the firewall to Apache (I am here Apache port default is 80)
firewall-cmd --permanent --zone=public --add-port=80/tcp
systemctl restart firewalld.service
To start Apache:systemctl start httpd

11, in the SVN client address bar input Http://ip/svndata (account password is configured for the 8th step) to this, svn+http installation completed if in doubt, welcome to communicate

CentOS7 Build Svn+http Access

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.