Vengatc techology logs

Installing SVN on Fedora

Posted in linux, sourcecontrol by vengatc on August 22, 2008

Step1 : Created a fedora virutal machine clone.

Links :
1) http://sysdigg.blogspot.com/2008/02/install-subversion-on-fedora-8-linux.html
2) http://www.botsko.net/blog/2007/05/17/installing-subversion-on-fedora-core/
3) http://www.ferdychristant.com/blog/articles/DOMM-6NFJ6J
4)http://www.botsko.net/blog/2007/05/17/installing-subversion-on-fedora-core/

I’ve been using subversion a lot recently – from using repositories with client development companies to installing it for clients – it seems to be the SVN month.

Here’s how I installed subversion on a machine with Fedora Core 4. For anyone learning or using Subversion, I highly recommend that you read the book.

You may already have subversion installed, if not, just run this:

# yum install subversion
# yum install mod_dav_svn

Then you’ll need to setup at least one repository. I’m going to need multiple repositories that I can use for different clients so I have a bit of extra admin work ahead of me. You can setup as many repositories as you need, but no matter what you’ll need at least one. Here create the folders…

# mkdir /svn
# mkdir /svn/repos
# mkdir /svn/users
# mkdir /svn/permissions

We need to give these folders the proper permissions

# chown -R apache.apache /svn

Then we need to tell subversion to make our first repository.

# svnadmin create /svn/repos/myproject

First, I need to setup a config file for svnserve.

# vi /svn/repos/conf/svnserve.conf

Then, look for variations of the following code and edit it as necessary. By default any anonymous user can access the code so to disable that you must include anon-access = none, just commenting the value out will not prevent anonymous access.

anon-access = none
password-db = passwdfile
realm = My SVN Repository
auth-access = write

The password-db is just a path to a file containing usernames and passwords. You’ll create this file especially for SVN. I create each file inside of the repository conf directory. So, save your changes and then we’ll create said user file.

# vi passwdfile

Enter in something like:

[users]
username = password

Anyway, you’ll need to start the svn server.

# svnserve -d –listen-port=3690

One side note – svnserve just runs and doesn’t have a way to stop besides killing the process. If you make changes to the svnserve.conf or user file you’ll need to restart svnserve.

# killall svnserve

Then, go ahead and test (best to do so on a different machine).

# svn co –username=myusername svn://mydomain/svn/repos/myproject

The system should then ask you for your password. Go ahead and run some tests.

Now, let’s setup apache.

Create a new apache include file that will hold our configurations (You may already have this is subversion was already installed).

# vi /etc/httpd/conf.d/subversion.conf

Now, this file will need to contain something like this to serve the repository through apache:

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

DAV svn
SVNPath /svn/repos
AuthType Basic
AuthName “Subversion Repository”
AuthUserFile /svn/users/svnpass
Require valid-user
AuthzSVNAccessFile /svn/permissions/svnauthz.conf

Now, this essentially tells apache to load the mods needed for svn. We need to create some files so that this config will work properly. The first is our htpasswd file which I named “/svn/users/svnpass”.

# htpasswd -cb /svn/users/svnpass username password

Next we need to create the svnauth file.

# vi /svn/permissions/svnauthz.conf

Inside we’ll place a list of users who have access to files:

[/]

username = rw

The “rw” states that this user has read/write access to the root repository /.

Restart your web server and you should be done.

service httpd reload
or you can use:
/usr/sbin/apachectl restart – this option outputs better error messages in case you’ve made some syntax mistakes.

Go to your repository and you should see subversion displaying the repo info.

http://yoursite.com/svn/repos/

About these ads

11 Responses

Subscribe to comments with RSS.

  1. Sergey said, on December 6, 2008 at 11:35 am

    Thanks! your notes were very helpful and I have successfully installed SVN on my server.

  2. Sarvesh said, on May 29, 2010 at 10:22 am

    Hi I got this error

    while accessing my site

    Not Found

    The requested URL /svn/repos was not found on this server.
    Apache/2.2.10 (Fedora) Server at example.com Port 80

  3. Houssem said, on September 15, 2010 at 9:37 am

    Hellon thx for this tutorial really helpfull, but i’ve found some errors (may be we have not the same Subversion version)

    Starting httpd: Syntax error on line 4 of /etc/httpd/conf.d/subversion.conf:
    DAV not allowed here

    to correct it, we need to surround the directives with Tag :

    LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so

    DAV svn
    SVNPath /svn/repos
    AuthType Basic
    AuthName “Subversion Repository”
    AuthUserFile /svn/users/svnpass
    Require valid-user
    AuthzSVNAccessFile /svn/permissions/svnauthz.conf

    Thank you again :)

  4. iamjuvy said, on October 6, 2010 at 4:10 am

    Hi,

    I followed your steps and I was able to checkout codes on my svn but I encountered error on my apache server.

    Can you help me debug my apache? I have followed your steps but when I open url: http://202.172.34.148/svn/repos/ . I encountered this error: “Not Found The requested URL /svn/repos/ was not found on this server.” What could have been the cause of this?

    Thanks for the help. and thanks for these notes.

  5. BRANKKO said, on February 11, 2011 at 11:17 am

    Try this:

    DAV svn
    SVNPath /svn/repos

    # Limit write permission to list of valid users.

    # Require SSL connection for password protection.
    # SSLRequireSSL

    AuthType Basic
    AuthName “Subversion Repository”
    AuthUserFile /svn/users/svnpass
    Require valid-user
    AuthzSVNAccessFile /svn/permissions/svnauthz.conf

  6. BRANKKO said, on February 11, 2011 at 11:18 am

    Try this:

    <Location /repos>
    DAV svn
    SVNPath /svn/repos

    # Limit write permission to list of valid users.
    <LimitExcept GET PROPFIND OPTIONS REPORT>
    # Require SSL connection for password protection.
    # SSLRequireSSL

    AuthType Basic
    AuthName “Subversion Repository”
    AuthUserFile /svn/users/svnpass
    Require valid-user
    AuthzSVNAccessFile /svn/permissions/svnauthz.conf
    </LimitExcept>
    </Location>

  7. Svn + php Web page said, on July 16, 2011 at 6:56 am

    [...] print_r($status); echo "</pre>"; ?> i have followed the following http://vengatctech.wordpress.com/200…svn-on-fedora/ and also googled enough but its not working in php web page Can somebody help [...]

  8. adil said, on March 22, 2013 at 7:25 pm

    The requested URL /svn/repos was not found on this server.
    Apache/2.2.10 (Fedora) Server at example.com Port 80

    i found this error what ca i doo

  9. e cigarette said, on April 19, 2013 at 1:35 am

    Great beat ! I wish to apprentice while you amend your web site,
    how can i subscribe for a blog web site? The account aided me a acceptable deal.
    I had been tiny bit acquainted of this your broadcast offered bright clear idea

  10. youtube.com said, on April 27, 2013 at 10:45 am

    Hi, yes this post is really fastidious and I have learned lot of
    things from it about blogging. thanks.

  11. Katherina said, on April 30, 2013 at 8:08 am

    You actually make it seem so easy together with your presentation however I to find this matter to be actually one thing which
    I think I might never understand. It kind of feels too complicated and very broad for me.
    I am looking forward in your next put up, I will attempt to get the
    grasp of it!


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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: