Apache and SVN Integration

You can access the SVN repository through the HTTP protocol after you have integrated the SVN server with Apache. The following steps were done in Ubuntu Lucid (Ubuntu 10.04 LTS).

1. Install the Apache2, Subversion and libapache2-svn.

  • sudo apt-get install apache2 subversion libapache2-svn


 

2. Create a folder for the SVN root . In this example, SVN root is /home/svn.

  • sudo mkdir /home/svn


 

3. Create the svn group and add www-data to it.

  • sudo addgroup svn
  • sudo adduser www-data svn

 

4. Also add the svn user to the group. After that, log out and log in again for making the change effective.

  • sudo adduser <svn user> svn

 

5. Modify the owner and file permission

  • sudo chown -R root:svn /home/svn
  • sudo chmod -R g+rws /home/svn

 

5. Normally, the dav_svn Apache module will be enabled automatically after installing the libapache2-svn. You could find it in the /etc/apache2/mods-enabled folder. Enable it if it is not yet done.

  • sudo a2enmod dav_svn

 

6. Append the following lines in /etc/apache2/mods-enabled/dav_svn.conf.

<Location /svn>
  DAV svn
  SVNParentPath /home/svn
  SVNListParentPath on
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd
  Require valid-user
</Location>

 

7. Create the /etc/apache2/dav_svn.passwd.

  • sudo htpasswd -c /etc/apache2/dav_svn.passwd <svn user>

 

8. Restart Apache.

  • sudo /etc/init.d/apache2 restart

 

9. Our repository is now ready. Let’s create a new project.

  • sudo svnadmin create –fs-type fsfs /home/svn/HelloWorld
  • sudo chown -R www-data:svn /home/svn/HelloWorld
  • sudo chmod -R g+rws /home/svn/HelloWorld

 

10. Your SVN repository is ready. Try it with any SVN client.
 

Done =)

Reference: Geek Taco – Using Ubuntu 10.04 LTS server for Subversion

About these ads

2 thoughts on “Apache and SVN Integration

  1. Pingback: SVN Migration | Eureka!

  2. Pingback: TortoiseSVN – SVN+SSH protocal with SSL key authentication | Eureka!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s