Tips for installing Subversion on Fedora Core OS 4

This week our company VCG leased a dedicate server that will run Fedora Core OS 4. We already have 4 dedicated Windows Servers for company tasks but there are some applications that require the use of a Unix/Linux server.

One of the tools we needed was Subversion (as far as I know you can’t run the subversion repositories on a Windows server).

I’ve compiled a few tips that should help with installing subversion on Fedora Core OS 4.

By default Apache server 2.0 should be installed. However one of the modules that may be missing is the mod_dav_svn module. mod_dav_svn module allows subversion to be used remotely through the webDAV protocol.

Install the mod_dav_svn Module

The easiest way to install the module was to use the yum tool.

yum install mod_dav_svn

Install Subversion

Next, install subversion by using the yum tool. (yum is our friend!)
yum install subversion

Now that you have subversion installed, the Apache server needs to be configured to use subversion remotely.

Configure Apache configuration file

With subversion installed and the required apache modules added, changes to the apache configuration file is required. The apache server’s configuration file is httpd.conf. It can be found at /etc/httpd/conf . (Some servers it maybe in a different location) The root user is required to edit the file. Fedora prohibits one from logging on the server remotely as the root user. However, after connecting the the server, the root user can be implemented.

Use the su - root command. You’ll need the root password of the server.

Since emacs was not install on the server, I used the always reliable vi editor to edit the httpd.conf file.

With your editor of choice, find the the load modules section and add the following:

LoadModule dav_svn_module modules/mod_dav_svn.so

Now let’s add the location section in the file to tell apache know where to find the subversion repositories
Add the following in httpd.conf file:

DAV svn SVNParentPath /home/username/svn/repo
AuthType Basic
AuthName “Subversion repository”
AuthUserFile /etc/svn-auth-file
Require valid-user

The SVNParentPath command allows for several repositories. All repositories need to be created under the repo folder in order for webDAV protocol to communicate with the repositories.

The AuthType Basic will require that the users to authenticate using basic authentication. The authentication is checked against a new file that we will create. (more on that in a sec.)

Create Auth User File to authenicate Subversion users

The next step is to create an authorization file for subversion. The passwords in this file needs to be encrypted. Use the htpasswd command.

htpasswd -cm /etc/svn-auth-file niels

htpassd creates a new file called svn-auth-file in the /etc folder. The -c option creates the file, -m uses MD5 encryption of the password. Once your run this command (Replace my name with yours),
it will ask you for password and a confirmation of the password.
To add another user, remove the -c option or it will recreate the file again and erase the previous user(s).

htpasswd -m /etc/svn-auth-file freddy

Creating the Subversion Repository

Creating the repository is really easy. I have the first repository in /home/[username]/svn/repo/test. Replace [username] of the one your going to use. The svn , repo and test folders will not be there, so create them using the mkdir command

Once the folders have been created, run the following command:

svnadmin create /home/[username]/svn/repo/test

If all is good, the required files for the subversion repository will be added to the test folder. (Remember to replace [username] with the name you are using.)

Setting repository permissions

One of the problems I had was the permissions to the svn repositories were not correct. Use the chown command

chown -R apache.apache /home/username/svn
This command will change the owner and group recursively to the apache user.

Now if all is good you’ll be able to browse the repository you created and be able to import a project succesfully to your new repository.
http://[nameofyourserver.com]/svn/test

The server should ask you for your credentials. Enter what you added to the svn-auth-file. Once entered, you should see the subversion root page with nothing in it. Use your subversion tool of choice to import a project.

That’s it. It you have any questions, please let a comment and I’ll see if I can help out.

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment