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.