I'd like to install a Subversion server on my Ubuntu machine.
What packages to I need? How do I create a repository and set a new user?
I'd like to install a Subversion server on my Ubuntu machine.
What packages to I need? How do I create a repository and set a new user?
There are many configurations for svn, here a some short instructions to get a basic svn repository available over http.
apt-get install subversion apache2 libapache2-svn
mkdir -p /var/svn/repos/
cd /var/svn/repos/
svnadmin create --fs-type fsfs <your-repository>
mkdir -p /tmp/myproject/trunk /tmp/myproject/tags /tmp/myproject/branches
svn import /tmp/myproject file:///var/svn/repos/<your-repository> -m "initial import"
cd /etc/apache2/sites-available
touch subversion.conf
vim subversion.conf
Now edit the empty file with this configuration:
a2enmod dav_svn
a2enmod authz_svn
a2ensite subversion.conf
/etc/init.d/apache2 restart
htpasswd -c /var/svn/.htpasswd user
touch /var/svn/authz
vim /var/svn/authz
Let's try to checkout the the repo over http:
svn checkout http://your-server/svn/your-repository
You will need the
subversion
package.This package contains the client, tools to crate a Subversion repository and the server.
Start reading the manual. I am currently doing the same.
Once you have set up a repository with
svnadmin create /path/to/repo
, you can usesvnserve --root /path/to/repo
to make the repository available atsvn://yourhost/
. Open TCP port 3690 if necessary.It's possible to use SVN over HTTP, but I have not read that part yet :o
Subversion
Subversion is an open source version control system.
you can follow this guide from help.ubuntu.com :
version control system
Here is a blog post from WANdisco on how to install Tortoise SVN 1.7 and make your first repository change.
To install subversion, open a terminal and run the following command:
We’re going to create the subversion repository in /svn, although you should choose a location that has a good amount of space.
Change the owner of this repository to Apache user.
Create basic subversion repository for later use (for Production/QA/Testing/Stating../etc..)
Import those directory into our repository
Next we’ll need to edit the configuration file for the subversion webdav module. You can use a different editor if you’d like.
The Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://www.server.com/svn
The DAV line needs to be uncommented to enable the dav module
The SVNPath line should be set to the same place your created the repository with the svnadmin command.
The next section will let you turn on authentication. This is just basic authentication, so don’t consider it extremely secure. The password file will be located where the AuthUserFile setting sets it to… probably best to leave it at the default.
To create a user on the repository use, the following command:
Note that you should only use the -c option the FIRST time that you create a user. After that you will only want to use the -m option, which specifies MD5 encryption of the password, but doesn’t recreate the file.
Example:
Restart apache by running the following command:
Thanks: http://www.howtogeek.com/howto/ubuntu/install-subversion-with-web-access-on-ubuntu/