Tag Archives: Subversion

SVN Server on Ubuntu with https access

To install SVN server, run this command at the command prompt:

sudo apt-get install subversion apache2 libapache2-svn

Verify the installed version of Subversion software:

svn --version

Read more of this post

Advertisements

Access Control in SVN with authz_svn

In this post I will show you, how to control access in SVN using builtin moudle called authz_svn.It allows you to control the access in such a way that who can access the repository and what they can do on the repository (read or read-write), it even allows you to make groups and define access permission for groups. Above than that, you don’t need to change the underlay structure of your svn server.

Note: If you want to install the SVN Server then, please refer this post:

These are the same usernames that we created in previous tutorial, using this command:

sudo htpasswd -m /etc/apache2/dav_svn.passwd arbab

For this post, we will use these repositories :

cd /svn
ls -l

Read more of this post

SVN Server on CentOS 6 with Web Access

Before installing the SVN Server,disabled the SELinux:

sudo nano /etc/selinux/config

Make SELINUX=disabled:

Restart the Server!

To install SVN server, run this command at the command prompt:

sudo yum install httpd mod_dav_svn subversion

Make the Apache service to run automatically at boot time:

sudo chkconfig httpd on

Edit the subversion.conf file:

sudo nano /etc/httpd/conf.d/subversion.conf

Delete all the data and make it simple like this :

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
 
<Location /svn>
 DAV svn
 SVNParentPath /svn
 AuthType Basic
 AuthName "Subversion repositories"
 AuthUserFile /svnauth/auth
 Require valid-user
</Location>

Now, we create a separate directory where we will keep the authentication file:

sudo mkdir /svnauth
sudo chown -R apache.apache /svnauth/
sudo htpasswd -cm /svnauth/auth arbab

We only need to use the -c option for the FIRST TIME, when you create a user, after that you will only use the -m option.

After that, we make the directory where we want to keep the svn repositories and also create testrepo inside:

Make sure we set the permissions of the /svn directory to apache with the following command:

Restart the apache service:

sudo service httpd restart

Configure the iptables rule in order to allow access to the svn server:

sudo iptables -I INPUT 4 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
sudo service iptables save

Now if we go to http://server-ip/svn/testrepo using web browser,it will ask for username and password:

Once we enter the correct username and password, we should see that the repository is enabled!

Now, we have a working subversion server!

Hope this will help you!

Please Remember me in your prayers!

SVN Server on Ubuntu 12.04 LTS with Web Access

To install SVN server, run this command at the command prompt:

sudo apt-get install subversion libapache2-svn apache2

Make the directory where you want to keep the svn repositories and edit the dav_svn.conf file:

sudo mkdir /svn
sudo nano /etc/apache2/mods-enabled/dav_svn.conf

Delete all the data and make it simple like this 🙂

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

To create a svn user , use the following command:

sudo htpasswd -cm /etc/apache2/dav_svn.passwd arbab

We only need to use the –c option for the FIRST TIME, when you create a user, after that you will only use the -m option.

Move to the folder, where you want to keep your repositories and create your first repository:

cd /svn
sudo svnadmin create test_repo

Make sure you set the permissions of the /svn directory to apache with the following command:

sudo chown -R www-data:www-data /svn

Restart the apache2 service:

sudo /etc/init.d/apache2 restart

On Windows machine, Right-Click  and select the SVN Checkout, inside the directory where we want to store the working copy (In my case, it’s on desktop).

Enter the repository’s URL and click OK, it will be prompted for a login and password.  Enter the login information and click OK.

We shall receive a screen that looks like this:

Create some test file inside the checkout repository, Right-Click and Select the SVN Commit:

Enter the comments that describe the purpose of this commit:

It will be prompted for a login and password.  Enter the login information and click OK.

The result of the commit will appear in a dialog window.

Congrats! now we have a working SVN server on Ubuntu 12.04 🙂

Hope this will help you!

Please Remember me in your prayers!

%d bloggers like this: