Step 1: install Apache Subversion
Yum install httpdyum install httpd-devel // interface used to develop the Apache module Yum install subversionyum install mod_dav_svn // interface between subversion and Apache (through which Apache can access the version library, the client can also use the HTTP extension protocol WebDAV/DeltaV for access.) Yum install mod_auth_mysql // This item is used for user authentication, according to some information on the Internet, it seems that only user settings are required for mod_auth_mysql. We recommend that you do not install them. You can use htpasswd. I didn't install it here. I still plan to use htpasswd, you may try it next time.
Verify that the svn module (mod_dav_svn) is correctly installed
ls /etc/httpd/modules | grep svn
System prompt:
mod_authz_svn.somod_dav_svn.so
Verify installation:
svn --version
The following shows that the installation is correct.
SVN, version 1.4.2 (r22196) compiled on Aug 10 2009,18: 00: 04 copyright (c) 2000-2006 collabnet. subversion is open source software, see http://subversion.tigris.org/This Product Development DES software developed by collabnet (http://www.Collab.Net /). you can use the following archive access (RA) module: * ra_dav: the module that accesses the archive through the WebDAV (DeltaV) protocol. -Handles 'HTTP 'scheme-handles 'https' scheme * ra_svn: the module that uses the svn network protocol to access the repository. -Handles 'svn 'scheme * ra_local: Specifies the file library module used to access the local disk. -Handles 'file' Scheme
Step 2: Create the svn library and Project
Mkdir/home/SVN // create SVN library svnadmin create/home/SVN/projcet // create a project
Step 3: Add group and member Permissions
Groupadd subversion // create a group named subversion as usermod-G subversion-A Apache directory that owns the repository. // Add yourself and Apache users to the group.
View: More/etc/group | grep Subversion
System prompt: Subversion: X: 500: Apache
Step 4: Modify project Permissions
chgrp -R subversion /home/svn/projectchmod -R 777 /home/svn/project
It is best to configure the corresponding permissions according to your own security requirements. Here is the test environment, so we directly gave 777
Step 5: Configure httpd
Edit httpd. conf
vim /etc/httpd/conf/httpd.conf
Check whether the loadmodule dav_svn_module modules/mod_dav_svn.so line exists. If not, add it to Apache to allow the client to access the svn repository through Apache. Apache needs to load the mod_dav_svn module. If Apache is installed in accordance with the preset directory, the mod_dav_svn module should be installed in the modules subdirectory of the Apache installation location (the default path is/etc/httpd. At the same time, in the Apache configuration file httpd. conf (default path: ETC/httpd/CONF/) has loaded this module using the loadmodule command (if not, manually add) note that this command must appear before other subversion commands. Also load the mod_authz_svn.so Module
For example:
LoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so
Generally, apache2 has loaded these two modules normally.
Start httpd
/etc/init.d/httpd start
Open the browser to check whether the Apache page is displayed. (Note that if the firewall is enabled, open port 80)
Step 6: Configure SVN
Edit subversion. conf
vim /etc/httpd/conf.d/subversion.conf
Change the Code as follows (Li Hong is the modified Code ):
LoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so<Location /svn>DAV svnSVNParentPath /home/svn## # Limit write permission to list of valid users.# <LimitExcept GET PROPFIND OPTIONS REPORT># # Require SSL connection for password protection.# # SSLRequireSSL#AuthType BasicAuthName "Authorization Realm"AuthUserFile /home/svn/passwdRequire valid-user# </LimitExcept></Location>
Step 7: create a user
Htpasswd-C/home/SVN/passwd test // The first time you add the user to use the parameter "-c", then add the user. htpasswd/home/SVN/passwd test is not required.
System prompt:
New Password: // enter the new password re-type new password: // confirm the password adding password for user test
Restart Apache