Monday, June 20, 2011

SVN installation with Apache


1. First of all, install apache/httpd
* yum install httpd
2. Make sure you apache is running. You can also type ‘http://localhost’ at your browser and apache test page should appear if your apache is running
* /etc/init.d/httpd status
3. Make it start by default on startup
* chkconfig httpd on
4. Edit the apache configuration to suit your need. If not sure, leave the default setting as it is
* vi /etc/httpd/conf/httpd.conf
5. Install subversion and mod_dav_svn for apache
* yum install mod_dav_svn subversion
6. Go to subversion.conf in /etc/httpd/conf.d/. Edit as below
* cd /etc/httpd/conf.d/
* vi subversion.conf
1. This is the most basic configuration where anyone will have unrestricted access to the repos. Location is the name that will be used in the browser address bar. In this example it will be ‘http://localhost/svn/repos
2. This is a configuration with username and password for the client
DAV svn
SVNListParentPath on
SVNParentPath /usr/local/svn/
AuthType Basic
AuthName “Subversion repositories”
AuthUserFile “/etc/httpd/conf.d/svnuserconf”
Require valid-user
1.
* htpasswd -cm /etc/httpd/conf.d/svnuserconf admin — This command is not needed for the first configuration. To create the first user with password
* htpasswd -m /etc/httpd/conf.d/svnuserconf pawan — use this command to add another user
2. Configure your repository
* mkdir /usr/local/svn — create folder svn
* cd /usr/local/svn — change diectory to the newly created svn directory
* svnadmin create repos — create svn repository named repos
* chown apache.apache -R repos — change ownership of ‘repos’ to apache
* /etc/init.d/httpd restart — restart apache
* If you are running different apache change port no from conf file.
3. Open you browser and type ‘http://localhost/svn/repos’. You can see that a page with ‘Revision 0:/’ will appear. Congratulation, you just completed the setup for svn server