Operating System: Linux (centos 6)
Software: apache2.2, subversion1.6
Overview
Apache is used to allow the client to communicate with the Subversion server through HTTP.
To achieve this goal, you must use the Subversion plug-in to take over the processing of these requests when the customer accesses the Subversion repository through Apache.
Process
1. install Apache first:
Yum-y install httpd
2. Install subversion again:
Yum-y install subversion mod_dav_svn
Mod_dav_svn is the Subversion plug-in of Apache.
3. Configure Apache
The configuration file is located at/etc/httpd/CONF/httpd. conf.
Of course, you generally do not need to change it.
4. Test Apache
Start Apache:
Service httpd start
Test Apache:
Run the browser locally and enter http: // localhost/
The default page of Apache should be displayed.
5. configure access to subversion through Apache
The Subversion configuration file in Apache is located under/etc/httpd/CONF. d/and is named subversion. conf.
The following part has been commented out, and you can unlock it:
<Location/repos>
Dav SVN
Svnparentpath/var/www/SVN/Repos
Authtype basic
Authname "Subversion repos"
Authuserfile/etc/SVN-auth-Conf
Require valid-user
</Location>
The svnparentpath/var/www/SVN line should be changed:
Svnpath/var/www/SVN/Repos
Otherwise, a permission error will be reported during client access in the future.
/Var/www/SVN/repos indicates that we want to place the svn database, and you can also place it elsewhere.
<Location/repos> indicates that/var/www/SVN/repos is accessed when the URL address is http: // xxxx/repos.
Authuserfile/etc/SVN-auth-conf indicates that the svn account file is/etc/SVN-auth-Conf.
Save the modified file.
6. Create a subversion account
Subversion manages its own account, so the client must use the Subversion account for logon to access it.
Create the first account (the password is required during the process ):
Htpasswd-CM/etc/SVN-auth-conf Mary
Create other accounts (use-M instead of-cm in the parameters ):
Htpasswd-M/etc/SVN-auth-Conf
7. Create a subversion Repository
CD/var/www/SVN
Svnadmin create Repos
Chown-r Apache. Apache Repos
The above Code creates a database in/var/www/SVN/repos, and all projects will be placed in the new folder under repos.
Chown specifies the owner of the repos folder as an Apache user. If this is not done, a permission error is reported because Apache does not have the permission to read or write it.
If SELinux is enabled, you also need:
Chcon-r-t httpd_sys_content_t Repos
8. Access SVN through Apache
Restart Apache:
Service httpd restart
Enter http: // localhost/repos in the browser and you will see:
Repos-Revision 0 :/
--------------------------------------------------------------
Powered by subversion version 1.6.11 (r93411 ).
Yeah!
Successful. The client can access the Subversion service over HTTP!