Difference between revisions of "Tutorials and How-tos/Install Subversion with Apache"

From BubbaWiki
Jump to navigation Jump to search
(Created page with 'How to install Subversion (SVN) with Apache on your Bubba server Log in to your Bubba server using SSH (On Windows use PuTTY and on Mac & Linux open a terminal and write s...')
 
Line 1: Line 1:
How to install Subversion (SVN) with Apache on your Bubba server
= How to install Subversion (SVN) with Apache on your Bubba server =


Using Apache instead of svnserve give you some benefits like being able to see your repo in your browser.<br>


== Basic set-up ==


Log in to your Bubba server using SSH (On Windows use PuTTY and on Mac &amp; Linux open a terminal and write ssh).
Most people have their Bubba server connected on a private network and don't need much security protocols, so I'll start with an easy set up.<br>


Gain root access (Linux talk for admin rights) with default password excito.<br>su
<br>


Change directory to /<br>cd /<br> <br>First we need to install the actual SVN software from the repository.<br>We will use the default repository and install the version available there 1.5.1
Log in to your Bubba server using SSH (On Windows use PuTTY and on Mac &amp; Linux open a terminal and write ssh). Gain root access (Linux talk for admin rights) with default password excito.<br>su


apt-get install subversion<br>apt-get install libapache2-svn
Change directory to /<br>cd /


mkdir /var/svn<br>chown -R www-data:www-data /var/svn
First we need to install the actual SVN software from the repository.<br>We will use the default repository and install the version available there 1.5.1


nano /etc/apache2/mods-available/dav_svn.conf<br>cat /etc/apache2/mods-available/dav_svn.conf<br> <br>/etc/init.d/apache2 restart<br>first user<br>htpasswd -cm /etc/apache2/dav_svn.passwd user1<br>next user<br>htpasswd -m /etc/apache2/dav_svn.passwd user2
apt-get install subversion<br>apt-get install libapache2-svn


svnadmin create /var/svn/test<br>chown -R www-data:www-data /var/svn/test
mkdir /var/svn<br>chown -R www-data:www-data /var/svn  


<br># dav_svn.conf - Example Subversion/Apache configuration<br>#<br># For details and further options see the Apache user manual and<br># the Subversion book.<br>#<br># NOTE: for a setup with multiple vhosts, you will want to do this<br># configuration in /etc/apache2/sites-available/*, not here.
nano /etc/apache2/mods-available/dav_svn.conf<br>cat /etc/apache2/mods-available/dav_svn.conf<br> <br>/etc/init.d/apache2 restart<br>first user<br>htpasswd -cm /etc/apache2/dav_svn.passwd user1<br>next user<br>htpasswd -m /etc/apache2/dav_svn.passwd user2


# &lt;Location URL&gt; ... &lt;/Location&gt;<br># URL controls how the repository appears to the outside world.<br># In this example clients access the repository as http://hostname/svn/<br># Note, a literal /svn should NOT exist in your document root.<br>&lt;Location /svn&gt;
svnadmin create /var/svn/test<br>chown -R www-data:www-data /var/svn/test
 
# Uncomment this to enable the repository<br> DAV svn
 
# Set this to the path to your repository<br> #SVNPath /var/lib/svn<br> # Alternatively, use SVNParentPath if you have multiple repositories under<br> # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).<br> # You need either SVNPath and SVNParentPath, but not both.<br> SVNParentPath /var/svn<br> SVNListParentPath on<br> # Access control is done at 3 levels: (1) Apache authentication, via<br> # any of several methods. A "Basic Auth" section is commented out<br> # below. (2) Apache &lt;Limit&gt; and &lt;LimitExcept&gt;, also commented out<br> # below. (3) mod_authz_svn is a svn-specific authorization module<br> # which offers fine-grained read/write access control for paths<br> # within a repository. (The first two layers are coarse-grained; you<br> # can only enable/disable access to an entire repository.) Note that<br> # mod_authz_svn is noticeably slower than the other two layers, so if<br> # you don't need the fine-grained control, don't configure it.
 
# Basic Authentication is repository-wide. It is not secure unless<br> # you are using https. See the 'htpasswd' command to create and<br> # manage the password file - and the documentation for the<br> # 'auth_basic' and 'authn_file' modules, which you will need for this<br> # (enable them with 'a2enmod').<br> AuthType Basic<br> AuthName "Subversion Repository"<br> AuthUserFile /etc/apache2/dav_svn.passwd
 
# To enable authorization via mod_authz_svn<br> #AuthzSVNAccessFile /etc/apache2/dav_svn.authz
 
# The following three lines allow anonymous read, but make<br> # committers authenticate themselves. It requires the 'authz_user'<br> # module (enable it with 'a2enmod').<br> #&lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;<br> Require valid-user<br> #&lt;/LimitExcept&gt;
 
&lt;/Location&gt;

Revision as of 17:50, 28 October 2010

How to install Subversion (SVN) with Apache on your Bubba server

Using Apache instead of svnserve give you some benefits like being able to see your repo in your browser.

Basic set-up

Most people have their Bubba server connected on a private network and don't need much security protocols, so I'll start with an easy set up.


Log in to your Bubba server using SSH (On Windows use PuTTY and on Mac & Linux open a terminal and write ssh). Gain root access (Linux talk for admin rights) with default password excito.
su

Change directory to /
cd /

First we need to install the actual SVN software from the repository.
We will use the default repository and install the version available there 1.5.1

apt-get install subversion
apt-get install libapache2-svn

mkdir /var/svn
chown -R www-data:www-data /var/svn

nano /etc/apache2/mods-available/dav_svn.conf
cat /etc/apache2/mods-available/dav_svn.conf

/etc/init.d/apache2 restart
first user
htpasswd -cm /etc/apache2/dav_svn.passwd user1
next user
htpasswd -m /etc/apache2/dav_svn.passwd user2

svnadmin create /var/svn/test
chown -R www-data:www-data /var/svn/test