How to Install Subversion 1.6.16 on CentOS 5.5 Server

Subversion, an open-source version control system, is a crucial tool for managing files and tracking changes over time. It allows users to recover older versions of data and examine the history of data changes.

This guide will walk you through the process of installing Subversion 1.6.16 on a CentOS 5.5 server.

Before proceeding, ensure you have Apache Httpd Web Server installed on your Linux system. If you haven’t, you can follow this guide on our website to install Apache.

Step 1: Download Subversion 1.6.16

The first step is to download the necessary Subversion 1.6.16 packages. You can do this by using the wget command to download the packages from the official repository. Here are the commands you need to run:

wget http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.16-1.i386.rpm
wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.16-1.i386.rpm
wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.16-1.i386.rpm
wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.16-1.i386.rpm
wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.16-1.i386.rpm
wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.16-1.i386.rpm

After running these commands, you should have the following RPM packages in your directory:

mod_dav_svn-1.6.16-1.i386.rpm
subversion-1.6.16-1.i386.rpm
subversion-devel-1.6.16-1.i386.rpm
subversion-perl-1.6.16-1.i386.rpm
subversion-python-1.6.16-1.i386.rpm
subversion-tools-1.6.16-1.i386.rpm

Example:

[root@server data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.16-1.i386.rpm
--2011-03-29 20:20:22--  http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.16-1.i386.rpm
Resolving opensource.wandisco.com... 212.7.198.163
Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 77152 (75K) [application/x-redhat-package-manager]
Saving to: `mod_dav_svn-1.6.16-1.i386.rpm'

100%[===========================================>] 77,152      47.1K/s   in 1.6s

2011-03-29 20:20:25 (47.1 KB/s) - `mod_dav_svn-1.6.16-1.i386.rpm' saved [77152/77152]

[root@server data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.16-1.i386.rpm
--2011-03-29 20:22:31--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.16-1.i386.rpm
Resolving opensource.wandisco.com... 212.7.198.163
Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2191952 (2.1M) [application/x-redhat-package-manager]
Saving to: `subversion-1.6.16-1.i386.rpm'

100%[===========================================>] 2,191,952   53.4K/s   in 51s

2011-03-29 20:23:25 (41.9 KB/s) - `subversion-1.6.16-1.i386.rpm' saved [2191952/2191952]

[root@server data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.16-1.i386.rpm
--2011-03-29 20:26:47--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.16-1.i386.rpm
Resolving opensource.wandisco.com... 212.7.198.163
Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3407709 (3.2M) [application/x-redhat-package-manager]
Saving to: `subversion-devel-1.6.16-1.i386.rpm'

100%[===========================================>] 3,407,709   53.6K/s   in 62s

2011-03-29 20:27:51 (53.9 KB/s) - `subversion-devel-1.6.16-1.i386.rpm' saved [3407709/3407709]

[root@server data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.16-1.i386.rpm
--2011-03-29 20:28:05--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.16-1.i386.rpm
Resolving opensource.wandisco.com... 212.7.198.163
Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1103833 (1.1M) [application/x-redhat-package-manager]
Saving to: `subversion-perl-1.6.16-1.i386.rpm'

100%[===========================================>] 1,103,833   66.8K/s   in 21s

2011-03-29 20:28:28 (52.3 KB/s) - `subversion-perl-1.6.16-1.i386.rpm' saved [1103833/1103833]

[root@server data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.16-1.i386.rpm
--2011-03-29 20:28:36--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.16-1.i386.rpm
Resolving opensource.wandisco.com... 212.7.198.163
Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1286789 (1.2M) [application/x-redhat-package-manager]
Saving to: `subversion-python-1.6.16-1.i386.rpm'

100%[===========================================>] 1,286,789   30.2K/s   in 42s

2011-03-29 20:29:20 (30.1 KB/s) - `subversion-python-1.6.16-1.i386.rpm' saved [1286789/1286789]

[root@server data]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.16-1.i386.rpm
--2011-03-29 20:30:09--  http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.16-1.i386.rpm
Resolving opensource.wandisco.com... 212.7.198.163
Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 390211 (381K) [application/x-redhat-package-manager]
Saving to: `subversion-tools-1.6.16-1.i386.rpm'

100%[===========================================>] 390,211     54.9K/s   in 7.2s

2011-03-29 20:30:19 (53.1 KB/s) - `subversion-tools-1.6.16-1.i386.rpm' saved [390211/390211]

[root@server data]# ls
mod_dav_svn-1.6.16-1.i386.rpm       subversion-perl-1.6.16-1.i386.rpm
subversion-1.6.16-1.i386.rpm        subversion-python-1.6.16-1.i386.rpm
subversion-devel-1.6.16-1.i386.rpm  subversion-tools-1.6.16-1.i386.rpm

Step 2: Install the RPM Packages

Once you have downloaded the necessary packages, you can install them using the rpm command. Here is the command you need to run:

rpm -Uvh --nosignature mod_dav_svn-1.6.16-1.i386.rpm subversion-1.6.16-1.i386.rpm subversion-devel-1.6.16-1.i386.rpm subversion-perl-1.6.16-1.i386.rpm subversion-python-1.6.16-1.i386.rpm subversion-tools-1.6.16-1.i386.rpm

This command will install all the downloaded packages on your system.

[root@server data]# rpm -Uvh --nosignature mod_dav_svn-1.6.16-1.i386.rpm subversion-1.6.16-1.i386.rpm subversion-devel-1.6.16-1.i386.rpm subversion-perl-1.6.16-1.i386.rpm subversion-python-1.6.16-1.i386.rpm subversion-tools-1.6.16-1.i386.rpm
Preparing...                ########################################### [100%]
1:subversion             ########################################### [ 17%]
2:subversion-perl        ########################################### [ 33%]
3:mod_dav_svn            ########################################### [ 50%]
4:subversion-devel       ########################################### [ 67%]
5:subversion-python      ########################################### [ 83%]
6:subversion-tools       ########################################### [100%]
[root@server data]#

Step 3: Setting Up Directories

After installing the packages, you need to set up the necessary directories for Subversion. You can do this by running the following commands:

mkdir /svn
mkdir /svn/repos
mkdir /svn/users
mkdir /svn/permissions
chown -R apache:apache /svn

These commands will create the directories and set the ownership to the Apache user.

See also  How to Install php on CentOS 6.2

Step 4:Configure the Apache Server

Next, you need to configure your Apache server. You can do this by setting the DocumentRoot to /svn/repos, and the ServerName to svn.local. You also need to specify the ErrorLog and CustomLog for your server. Here’s an example of how your configuration might look:

DocumentRoot /svn/repos
ServerName svn.local
ErrorLog logs/svn.local-error_log
CustomLog logs/svn.local-access_log common

Step 5: Create and Configure subversion.conf

Now, you need to create and configure the subversion.conf file. This file is necessary for the Subversion Apache server. You can create and edit this file using the vi command:

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

In this file, you need to load the necessary modules and set up the location directive. Here’s an example of how your subversion.conf file might look:

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

<Location /svn/repos>
DAV svn
SVNParentPath /svn/repos
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /svn/users/passwords
AuthzSVNAccessFile /svn/permissions/svnaccess
Require valid-user
</Location>

Step 6: Create Your First Repository

With the server configured, you can now create your first repository using the svnadmin command. Here’s how you can do it:

svnadmin create /svn/repos/testsvn
chown -R apache:apache /svn/repos/testsvn

This will create a repository named testsvn and set its ownership to the Apache user.

See also  How to Install and Configure ViewVC for Subversion on CentOS

Step 7: Create Users to Access the Repository

Next, you need to create users who can access the repository. You can do this using the htpasswd command. Here’s how you can create two users, user1 and user2:

htpasswd -c /svn/users/passwords user1
htpasswd -m /svn/users/passwords user2

This will prompt you to enter and confirm a password for each user.

Step 8: Create svnaccess File

Now, you need to create an svnaccess file to control access to the repository. You can do this using the vi command:

vi /svn/permissions/svnaccess

In this file, you can define groups and specify their access rights. Here’s an example:

[groups]
testgroup = user1, user2

[testsvn:/]
@testgroup = rw

This will create a group named testgroup with user1 and user2 as members. The group has read and write access to the testsvn repository.

Step 9: Test Your Subversion Server

Finally, you can test your Subversion server by accessing your repository from a web browser. You can do this by navigating to http://your_server_ip/svn/repos/testsvn/. If everything is set up correctly, you should see the testsvn – Revision 0: / page.

testsvn - Revision 0: /
--------------------------------------------------------------------------------
Powered by Subversion version 1.6.16 (r1073529).

Commands Mentioned

  • wget – used to download files from the internet
  • rpm -Uvh –nosignature – used to install RPM packages
  • mkdir – used to create directories
  • chown – used to change the ownership of files/directories
  • vi – a text editor used to create and edit files
  • svnadmin create – used to create a new Subversion repository
  • htpasswd – used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users
See also  How to Fix “Repository moved permanently to… please relocate” Error In Subversion

Conclusion

In conclusion, setting up Subversion on a CentOS 5.5 server involves several steps, including downloading and installing the necessary packages, setting up directories, configuring the Apache server, creating and configuring the subversion.conf file, creating a repository, creating users, and creating an svnaccess file. Once all these steps are completed, you can test your Subversion server by accessing your repository from a web browser.

Remember, Subversion is a powerful tool for managing files and tracking changes over time. It’s an essential tool for any webmaster or website administrator.

FAQ

  1. What is Subversion?

    Subversion is an open-source version control system. It manages files and tracks changes made to them over time. This allows users to recover older versions of data and examine the history of data changes.

  2. What is the purpose of the svnadmin create command?

    The svnadmin create command is used to create a new Subversion repository. This repository is where all your version-controlled files will be stored.

  3. What is the htpasswd command used for?

    The htpasswd command is used to create and update the flat-files used to store usernames and passwords for basic authentication of HTTP users. This is necessary for controlling access to your Subversion repositories.

  4. What is the purpose of the svnaccess file?

    The svnaccess file is used to control access to the Subversion repositories. It allows you to define groups of users and specify their access rights to the repositories.

  5. How can I test my Subversion server?

    Youcan test your Subversion server by accessing your repository from a web browser. Simply navigate to `http://your_server_ip/svn/repos/your_repository_name/`. If everything is set up correctly, you should see the repository page.

Comments

3 Comments

  • Avatar Girl With Dragon Tattoo Movie says:

    I am satisfied that I discovered your web site on Google. This post has precisely the proper data that I have been searching for. Thank you.

  • Avatar Wouter Goossens says:

    How can I do step 4 Configure httpd Apache server as below:?

  • Avatar mhstar says:

    [root@server ~]# vi /etc/httpd/conf/httpd.conf


    ServerAdmin admin@svn.local
    DocumentRoot /svn/repos
    ServerName svn.local
    ErrorLog logs/svn.local-error_log
    CustomLog logs/svn.local-access_log common

Leave a Reply

Your email address will not be published. Required fields are marked *