qwera
qwera

Reputation: 185

Subversion (svn) integration with Apache?

I am running a website on my server with Apache, and I have also setup SVN with Apache.

The problem arises when I make changes in httpd.conf to setup SVN and restart Apache. It starts to serve files as SVN, but it stops my website. Then every user can see my source code.

I want to make my server as development server and production server. How can I run Apache for SVN and host my website?

Upvotes: 2

Views: 1427

Answers (1)

khemikal
khemikal

Reputation: 53

First install dav svn:

apt-get install libapache2-svn

root@example:/var# mkdir svn
root@example:/var# cd svn
root@example:/var/svn# svnadmin create repo

a2enmod dav_svn

Change permissions for Apache:

chown -R root.www-data /var/svn
chmod -R g+rw /var/svn

Add the repository to a virtual host

<Location /svn/myrepo>
  DAV svn
  SVNPath /var/svn/repo

  AuthType Basic
  AuthName "My Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd

  Require valid-user
</Location>

htpasswd2 /etc/apache2/dav_svn.passw user

Upvotes: 3

Related Questions