How to Install and Configure Subversion 1.8 on CentOS 6.5

Subversion is a open source version control system that will manages files and will keep the changes made to the files. With Subversion, it can help you to recovers the older files and directories and also to examine the history of your files and directories how they are changed all over time. This post will discuss how you can install and configure Subversion 1.8 on CentOS 6.5

1. Prepare WANdisco repo :

[root@centos6-05 ~]# wget opensource.wandisco.com/RPM-GPG-KEY-WANdisco -O /tmp/RPM-GPG-KEY-WANdisco
[root@centos6-05 ~]# wget opensource.wandisco.com/RPM-GPG-KEY-WANdisco -O /tmp/RPM-GPG-KEY-WANdisco
--2014-03-11 23:29:59--  http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
Resolving opensource.wandisco.com... 54.248.108.17
Connecting to opensource.wandisco.com|54.248.108.17|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1759 (1.7K) [application/octet-stream]
Saving to: â/tmp/RPM-GPG-KEY-WANdiscoâ

100%[==========================================================>] 1,759       --.-K/s   in 0.003s

2014-03-11 23:30:00 (665 KB/s) - â/tmp/RPM-GPG-KEY-WANdiscoâ

2. Import RPM-GPG-KEY-WANdisco. Once imported, it safe to delete :

[root@centos6-05 ~]# rpm --import /tmp/RPM-GPG-KEY-WANdisco
[root@centos6-05 ~]# rm -rf /tmp/RPM-GPG-KEY-WANdisco

You can get more subversion file from the followings :
http://opensource.wandisco.com/rhel/6/svn-1.8/RPMS/x86_64/

3. Configure WANdisco repo file :

[root@centos6-05 ~]# vi /etc/yum.repos.d/WANdisco-1.8.repo
[WANdisco]
name=WANdisco SVN Repo 1.8
enabled=1
baseurl=http://opensource.wandisco.com/rhel/6/svn-1.8/RPMS/
gpgcheck=1

4. Install subversion using yum install :

[root@centos6-05 ~]# yum install subversion mod_dav_svn -y

Full installation screen :

[root@centos6-05 ~]# yum install subversion mod_dav_svn -y
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/metalink                                                                | 5.2 kB     00:00
 * Webmin: download.webmin.com
 * base: centos.ipserverone.com
 * epel: epel.mirror.net.in
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
WANdisco                                                                     |  951 B     00:00
WANdisco/primary                                                             |  65 kB     00:00
WANdisco                                                                                    309/309
Webmin                                                                       |  951 B     00:00
Webmin/primary                                                               |  21 kB     00:00
Webmin                                                                                      168/168
base                                                                         | 3.7 kB     00:00
base/primary_db                                                              | 4.4 MB     00:45
epel                                                                         | 4.2 kB     00:00
epel/primary_db                                                              | 6.0 MB     01:51
extras                                                                       | 3.4 kB     00:00
extras/primary_db                                                            |  19 kB     00:00
updates                                                                      | 3.4 kB     00:00
updates/primary_db                                                           | 2.1 MB     00:18
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mod_dav_svn.x86_64 0:1.8.8-1 will be installed
---> Package subversion.x86_64 0:1.8.8-1 will be installed
--> Processing Dependency: libserf-1.so.1()(64bit) for package: subversion-1.8.8-1.x86_64
--> Running transaction check
---> Package serf.x86_64 0:1.3.2-2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                   Arch                 Version                Repository              Size
====================================================================================================
Installing:
 mod_dav_svn               x86_64               1.8.8-1                WANdisco                77 k
 subversion                x86_64               1.8.8-1                WANdisco               2.2 M
Installing for dependencies:
 serf                      x86_64               1.3.2-2                WANdisco                43 k

Transaction Summary
====================================================================================================
Install       3 Package(s)

Total download size: 2.3 M
Installed size: 7.8 M
Downloading Packages:
(1/3): mod_dav_svn-1.8.8-1.x86_64.rpm                                        |  77 kB     00:00
(2/3): serf-1.3.2-2.x86_64.rpm                                               |  43 kB     00:00
(3/3): subversion-1.8.8-1.x86_64.rpm                                         | 2.2 MB     00:19
----------------------------------------------------------------------------------------------------
Total                                                               112 kB/s | 2.3 MB     00:20
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : serf-1.3.2-2.x86_64                                                              1/3
  Installing : subversion-1.8.8-1.x86_64                                                        2/3
  Installing : mod_dav_svn-1.8.8-1.x86_64                                                       3/3
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]
  Verifying  : mod_dav_svn-1.8.8-1.x86_64                                                       1/3
  Verifying  : subversion-1.8.8-1.x86_64                                                        2/3
  Verifying  : serf-1.3.2-2.x86_64                                                              3/3

Installed:
  mod_dav_svn.x86_64 0:1.8.8-1                      subversion.x86_64 0:1.8.8-1

Dependency Installed:
  serf.x86_64 0:1.3.2-2

Complete!

5. Setting up SVN directories :

[root@centos6-05 ~]# mkdir /svn
[root@centos6-05 ~]# mkdir /svn/repos
[root@centos6-05 ~]# mkdir /svn/users
[root@centos6-05 ~]# mkdir /svn/permissions
[root@centos6-05 ~]# chown -R apache:apache /svn

6. Configure httpd Apache server as below :

[root@centos6-05 ~]# vim /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
    ServerAdmin webmaster@svn.ehowstuff.local
    DocumentRoot /svn/repos
    ServerName svn.ehowstuff.local
    ErrorLog logs/svn.ehowstuff.local-error_log
    CustomLog logs/svn.ehowstuff.local-access_log common
</VirtualHost>

7. Do a backup of origial subversion file :

[root@centos6-05 ~]# mv /etc/httpd/conf.d/subversion.conf /etc/httpd/conf.d/subversion.conf.bak

8. Create and Configure subversion.conf :

[root@centos6-05 ~]# vi /etc/httpd/conf.d/subversion.conf
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>

9. Create first repository using svnadmin command :

[root@centos6-05 ~]# svnadmin create /svn/repos/testrepo
[root@centos6-05 ~]# chown -R apache:apache /svn/repos/testrepo

10. Create htpasswd user to access the testrepo repository :

[root@centos6-05 ~]# htpasswd -c /svn/users/passwords svnuser1
New password:
Re-type new password:
Adding password for user svnuser1

11. Create svnaccess file to access the testrepo repository :

[root@centos6-05 ~]# vi /svn/permissions/svnaccess

Add the following :

[testrepo:/]
svnuser1 = rw

12. Restart httpd :

[root@centos6-05 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

13. Test your subversion server from browser :

http://svn.ehowstuff.local/svn/repos/testrepo/

How to Install Subversion on CentOS 6.3

This post will cover the quick steps to install Subversion 1.6 on linux CentOS 6.3 server. Apache Subversion (often abbreviated SVN) is a open source software versioning and revision control system. Some people called it source code control(SCC) software and source code management(SCM) software. By using subversion, developer will able to keep tracks the changes of their code, who is authoring the file, compare the source code and etc.

[root@centos63 ~]# yum install subversion mod_dav_svn -y

Example :

[root@centos63 ~]# yum install subversion mod_dav_svn -y
Loaded plugins: fastestmirror, presto, priorities
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mod_dav_svn.i686 0:1.6.11-7.el6 will be installed
---> Package subversion.i686 0:1.6.11-7.el6 will be installed
--> Processing Dependency: perl(URI) >= 1.17 for package: subversion-1.6.11-7.el6.i686
--> Processing Dependency: libneon.so.27 for package: subversion-1.6.11-7.el6.i686
--> Running transaction check
---> Package neon.i686 0:0.29.3-2.el6 will be installed
--> Processing Dependency: libproxy.so.0 for package: neon-0.29.3-2.el6.i686
--> Processing Dependency: libpakchois.so.0 for package: neon-0.29.3-2.el6.i686
---> Package perl-URI.noarch 0:1.40-2.el6 will be installed
--> Running transaction check
---> Package libproxy.i686 0:0.3.0-2.el6 will be installed
--> Processing Dependency: libproxy-python = 0.3.0-2.el6 for package: libproxy-0.3.0-2.el6.i686
--> Processing Dependency: libproxy-bin = 0.3.0-2.el6 for package: libproxy-0.3.0-2.el6.i686
---> Package pakchois.i686 0:0.4-3.2.el6 will be installed
--> Running transaction check
---> Package libproxy-bin.i686 0:0.3.0-2.el6 will be installed
---> Package libproxy-python.i686 0:0.3.0-2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                      Arch                Version                   Repository         Size
====================================================================================================
Installing:
 mod_dav_svn                  i686                1.6.11-7.el6              base               80 k
 subversion                   i686                1.6.11-7.el6              base              2.2 M
Installing for dependencies:
 libproxy                     i686                0.3.0-2.el6               base               38 k
 libproxy-bin                 i686                0.3.0-2.el6               base              8.0 k
 libproxy-python              i686                0.3.0-2.el6               base              8.3 k
 neon                         i686                0.29.3-2.el6              base              120 k
 pakchois                     i686                0.4-3.2.el6               base               21 k
 perl-URI                     noarch              1.40-2.el6                base              117 k

Transaction Summary
====================================================================================================
Install       8 Package(s)

Total download size: 2.6 M
Installed size: 12 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 2.6 M
(1/8): libproxy-0.3.0-2.el6.i686.rpm                                         |  38 kB     00:00
(2/8): libproxy-bin-0.3.0-2.el6.i686.rpm                                     | 8.0 kB     00:00
(3/8): libproxy-python-0.3.0-2.el6.i686.rpm                                  | 8.3 kB     00:00
(4/8): mod_dav_svn-1.6.11-7.el6.i686.rpm                                     |  80 kB     00:00
(5/8): neon-0.29.3-2.el6.i686.rpm                                            | 120 kB     00:00
(6/8): pakchois-0.4-3.2.el6.i686.rpm                                         |  21 kB     00:00
(7/8): perl-URI-1.40-2.el6.noarch.rpm                                        | 117 kB     00:00
(8/8): subversion-1.6.11-7.el6.i686.rpm                                      | 2.2 MB     00:20
----------------------------------------------------------------------------------------------------
Total                                                               111 kB/s | 2.6 MB     00:24
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : perl-URI-1.40-2.el6.noarch                                                       1/8
  Installing : libproxy-python-0.3.0-2.el6.i686                                                 2/8
  Installing : libproxy-0.3.0-2.el6.i686                                                        3/8
  Installing : libproxy-bin-0.3.0-2.el6.i686                                                    4/8
  Installing : pakchois-0.4-3.2.el6.i686                                                        5/8
  Installing : neon-0.29.3-2.el6.i686                                                           6/8
  Installing : subversion-1.6.11-7.el6.i686                                                     7/8
  Installing : mod_dav_svn-1.6.11-7.el6.i686                                                    8/8
  Verifying  : libproxy-bin-0.3.0-2.el6.i686                                                    1/8
  Verifying  : libproxy-python-0.3.0-2.el6.i686                                                 2/8
  Verifying  : perl-URI-1.40-2.el6.noarch                                                       3/8
  Verifying  : pakchois-0.4-3.2.el6.i686                                                        4/8
  Verifying  : mod_dav_svn-1.6.11-7.el6.i686                                                    5/8
  Verifying  : neon-0.29.3-2.el6.i686                                                           6/8
  Verifying  : libproxy-0.3.0-2.el6.i686                                                        7/8
  Verifying  : subversion-1.6.11-7.el6.i686                                                     8/8

Installed:
  mod_dav_svn.i686 0:1.6.11-7.el6                   subversion.i686 0:1.6.11-7.el6

Dependency Installed:
  libproxy.i686 0:0.3.0-2.el6  libproxy-bin.i686 0:0.3.0-2.el6  libproxy-python.i686 0:0.3.0-2.el6
  neon.i686 0:0.29.3-2.el6     pakchois.i686 0:0.4-3.2.el6      perl-URI.noarch 0:1.40-2.el6

Complete!

How to Enable LDAP Authentication for Subversion on CentOS 6.2

This post will show the quick steps to enable LDAP authentication for existing subversion on linux CentOS 6.2. This guideline assumed that your existing subversion server has been configured properly and working with htpasswd user. This guideline also assumed that 389 LDAP has been installed but not yet configure in your subversion configuration file.

Prerequisites :
How to Install Httpd on CentOS 6.2
How to Install and Configure Subversion 1.6 on CentOS 6.2
How to Install 389 Directory Server on CentOS 6.2

Steps:

1. Append /etc/hosts for ldap server fqdn. If your ldap server has been registered on DNS server, you can skip this step.

[root@svn ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.44 svn.ehowstuff.local svn
192.168.1.48 ldap.ehowstuff.local ldap

2. Locate and open subversion.conf using vi editor

[root@svn ~]# vi /etc/httpd/conf.d/subversion.conf

3. Modify the existing subversion.conf to below :

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
        AuthBasicProvider ldap
        AuthType Basic
        AuthzLDAPAuthoritative on
        AuthName "My Subversion server"
        AuthLDAPURL "ldap://ldap.ehowstuff.local:389/DC=ehowstuff,DC=local?uid?sub?(objectClass=*)" NONE
        AuthzSVNAccessFile /svn/permissions/svnaccess
        Require valid-user
</Location>

4. Restart httpd service :

[root@svn ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

How to Install Subversion 1.6.17 on Fedora 16

Apache Subversion (often abbreviated SVN) is a open source software versioning and revision control system. Some people called it source code control(SCC) software and source code management(SCM) software. By using subversion, developer will able to keep tracks the changes of their code, who is authoring the file, compare the source code and etc. In this post, i will show how to install Subversion 1.6.17 on linux Fedora 16 server. This post assumed that you have set up local yum repository using your DVDROM and had installed minimal installation type Fedora 16.

How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on Fedora 16

Simplly run the following command to install subversion on Fedora 16 server :

[root@fedora16 ~]# yum install svn -y

or

[root@fedora16 ~]# yum install subversion -y

Examples :

[root@fedora16 ~]# yum install svn -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package subversion.i686 0:1.6.17-5.fc16 will be installed
--> Processing Dependency: subversion-libs(x86-32) = 1.6.17-5.fc16 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_client-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_fs_util-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libneon.so.27 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_fs-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_fs_base-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_ra_local-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_ra-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_ra_svn-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_wc-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_delta-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_diff-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_subr-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_fs_fs-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_repos-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Processing Dependency: libsvn_ra_neon-1.so.0 for package: subversion-1.6.17-5.fc16.i686
--> Running transaction check
---> Package neon.i686 0:0.29.6-1.fc16 will be installed
--> Processing Dependency: libgnutls.so.26(GNUTLS_2_12) for package: neon-0.29.6-1.fc16.i686
--> Processing Dependency: libgnutls.so.26 for package: neon-0.29.6-1.fc16.i686
--> Processing Dependency: libgnutls.so.26(GNUTLS_1_4) for package: neon-0.29.6-1.fc16.i686
--> Processing Dependency: libpakchois.so.0 for package: neon-0.29.6-1.fc16.i686
--> Processing Dependency: libproxy.so.1 for package: neon-0.29.6-1.fc16.i686
---> Package subversion-libs.i686 0:1.6.17-5.fc16 will be installed
--> Running transaction check
---> Package gnutls.i686 0:2.12.14-2.fc16 will be installed
--> Processing Dependency: libtasn1.so.3(LIBTASN1_0_3) for package: gnutls-2.12.14-2.fc16.i686
--> Processing Dependency: libtasn1.so.3 for package: gnutls-2.12.14-2.fc16.i686
--> Processing Dependency: libp11-kit.so.0 for package: gnutls-2.12.14-2.fc16.i686
---> Package libproxy.i686 0:0.4.7-1.fc16 will be installed
--> Processing Dependency: libmodman.so.1 for package: libproxy-0.4.7-1.fc16.i686
---> Package pakchois.i686 0:0.4-4 will be installed
--> Running transaction check
---> Package libmodman.i686 0:2.0.1-2.fc15 will be installed
---> Package libtasn1.i686 0:2.7-2.fc15 will be installed
---> Package p11-kit.i686 0:0.6-1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                  Arch          Version                  Repository                    Size
====================================================================================================
Installing:
 subversion               i686          1.6.17-5.fc16            Fedora16-Repository          1.0 M
Installing for dependencies:
 gnutls                   i686          2.12.14-2.fc16           updates                      376 k
 libmodman                i686          2.0.1-2.fc15             Fedora16-Repository           26 k
 libproxy                 i686          0.4.7-1.fc16             Fedora16-Repository           60 k
 libtasn1                 i686          2.7-2.fc15               Fedora16-Repository          319 k
 neon                     i686          0.29.6-1.fc16            Fedora16-Repository          120 k
 p11-kit                  i686          0.6-1.fc16               Fedora16-Repository           34 k
 pakchois                 i686          0.4-4                    Fedora16-Repository           13 k
 subversion-libs          i686          1.6.17-5.fc16            Fedora16-Repository          710 k

Transaction Summary
====================================================================================================
Install       9 Packages

Total download size: 2.7 M
Installed size: 9.1 M
Downloading Packages:
(1/9): gnutls-2.12.14-2.fc16.i686.rpm                                        | 376 kB     00:06
----------------------------------------------------------------------------------------------------
Total                                                               349 kB/s | 2.7 MB     00:07
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : p11-kit-0.6-1.fc16.i686                                                          1/9
  Installing : libmodman-2.0.1-2.fc15.i686                                                      2/9
  Installing : libproxy-0.4.7-1.fc16.i686                                                       3/9
  Installing : pakchois-0.4-4.i686                                                              4/9
  Installing : libtasn1-2.7-2.fc15.i686                                                         5/9
  Installing : gnutls-2.12.14-2.fc16.i686                                                       6/9
  Installing : neon-0.29.6-1.fc16.i686                                                          7/9
  Installing : subversion-libs-1.6.17-5.fc16.i686                                               8/9
  Installing : subversion-1.6.17-5.fc16.i686                                                    9/9

Installed:
  subversion.i686 0:1.6.17-5.fc16

Dependency Installed:
  gnutls.i686 0:2.12.14-2.fc16  libmodman.i686 0:2.0.1-2.fc15         libproxy.i686 0:0.4.7-1.fc16
  libtasn1.i686 0:2.7-2.fc15    neon.i686 0:0.29.6-1.fc16             p11-kit.i686 0:0.6-1.fc16
  pakchois.i686 0:0.4-4         subversion-libs.i686 0:1.6.17-5.fc16

Complete!

How to Fix “/svnserver/svn/testrepo/db/txn-current-lock’: Permission denied”

Question :
When using TortoiseSVN and ssh command line to access svn server, i still can’t commit the file, can’t create the folder, can’t write the source code and always returned me this error message :

'/svnserver/svn/testrepo/db/txn-current-lock': Permission denied

Solution :
This is a common problem on subversion. A lot or developers and programmers who use subversion facing this kind or error. This is about the permissions issues. To solve it, make sure that the apache user has read/write access to your entire “testrepo” repository. To do that, chown -R apache:apache as below :

[root@svnserver ~]# chown -R apache:apache testrepo

How to Install GForge Advanced Server on CentOS 5.5 Server

In this post, i will show you on how to install GForge Advanced Server on CentOS 5.5 Server.

    [root@server ~]# wget http://gforge.org/download/install-gforge-as-571-src.zip
    [root@server ~]# unzip install-gforge-as-571-src.zip
    [root@server ~]# cd gforge-as-571-src
    [root@server gforge-as-571-src] yum install php*
    [root@server gforge-as-571-src]# yum install -y postgresql-server postgresql svn wget poppler-utils wv php-pgsql php-gd php-ldap php-xml php-mbstring
    [root@server gforge-as-571-src]# php check-deps.php
    -=# Welcome to GForge DB-Installer v5.0 #=-
    -=# GForge Dependencies Checker #=-
    
    Checking PHP version... Ok (5.1.6)
    Checking... cvs
    /usr/bin/cvs
    Checking... psql
    /usr/bin/psql
    Checking... svn
    /usr/local/bin/svn
    Checking... ssh
    /usr/bin/ssh
    Checking... wget
    /usr/bin/wget
    Checking... pdftotext
    /usr/bin/pdftotext
    Checking... wvText
    /usr/bin/wvText
    Checking... apache
    /etc/init.d/httpd
    Checking PHP support for... PostgreSQL
    Found
    Checking PHP support for... GD
    Found
    Checking PHP support for... LDAP
    Found
    Checking PHP support for... MultiByte
    Found
    Checking classes... DOMDocument
    Found
    
    All dependencies seem to be installed
    Starting postgresql service:                               [  OK  ]
    
    [root@server gforge-as-571-src]# php install-gforge-1-deps.php CENTOS5
    
    -=# Welcome to GForge Pre-Installer v5.0 #=-
    Do you want to perform an (I)nitial installation or an (U)pgrade of the system [I/u]?
    I
    [root@server gforge-as-571-src]# php install-gforge-2-db.php
    [root@server gforge-as-571-src]# php install-gforge-3.php CENTOS5
    [root@server gforge-as-571-src]# crontab crontab.in
    

How to Install Subversion 1.6.17 on CentOS 5.5 Server

As mentioned in the previous post, Subversion is a open source version control system that will manages files and will keep the changes made to the files. Subversion 1.6.17 has been released on 1st June 2011.For those who have installed subversion 1.6.16, they can simply upgrade the version to subversion 1.6.17. Make sure you have backup the repository before run manual upgrade which mean uninstall the old version and install the latest version.

Prerequisite : How to Install Apache Httpd Web Server on Linux

To install the subversion, follow below steps:

1. Download the latest subversion rpm packages :

[root@server ~]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.17-1.i386.rpm
--2011-07-09 22:43:25-- http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.17-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: 80073 (78K) [application/x-redhat-package-manager]
Saving to: `mod_dav_svn-1.6.17-1.i386.rpm'

100%[================================================>] 80,073 37.3K/s in 2.1s

2011-07-09 22:43:28 (37.3 KB/s) - `mod_dav_svn-1.6.17-1.i386.rpm' saved [80073/80073]

--2011-07-09 22:43:28-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 2197278 (2.1M) [application/x-redhat-package-manager]
Saving to: `subversion-1.6.17-1.i386.rpm'

100%[================================================>] 2,197,278 9.69K/s in 2m 50s

2011-07-09 22:46:18 (12.6 KB/s) - `subversion-1.6.17-1.i386.rpm' saved [2197278/2197278]

--2011-07-09 22:46:18-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 3413350 (3.3M) [application/x-redhat-package-manager]
Saving to: `subversion-devel-1.6.17-1.i386.rpm'

100%[================================================>] 3,413,350 11.1K/s in 5m 18s

2011-07-09 22:51:37 (10.5 KB/s) - `subversion-devel-1.6.17-1.i386.rpm' saved [3413350/3413350]

--2011-07-09 22:51:37-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 1106258 (1.1M) [application/x-redhat-package-manager]
Saving to: `subversion-perl-1.6.17-1.i386.rpm'

100%[================================================>] 1,106,258 9.18K/s in 2m 4s

2011-07-09 22:53:42 (8.71 KB/s) - `subversion-perl-1.6.17-1.i386.rpm' saved [1106258/1106258]

--2011-07-09 22:53:42-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 1289255 (1.2M) [application/x-redhat-package-manager]
Saving to: `subversion-python-1.6.17-1.i386.rpm'

100%[================================================>] 1,289,255 7.12K/s in 2m 26s

2011-07-09 22:56:08 (8.60 KB/s) - `subversion-python-1.6.17-1.i386.rpm' saved [1289255/1289255]

--2011-07-09 22:56:08-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 392647 (383K) [application/x-redhat-package-manager]
Saving to: `subversion-tools-1.6.17-1.i386.rpm'

100%[================================================>] 392,647 14.4K/s in 34s

2011-07-09 22:56:43 (11.3 KB/s) - `subversion-tools-1.6.17-1.i386.rpm' saved [392647/392647]

FINISHED --2011-07-09 22:56:43--
Downloaded: 6 files, 8.1M in 13m 15s (10.4 KB/s)

2. Install the rpm packages :

[root@server ~]# rpm -Uvh mod_dav_svn-1.6.17-1.i386.rpm subversion-tools-1.6.17-1.i386.rpm subversion-python-1.6.17-1.i386.rpm subversion-perl-1.6.17-1.i386.rpm subversion-devel-1.6.17-1.i386.rpm subversion-1.6.17-1.i386.rpm
warning: mod_dav_svn-1.6.17-1.i386.rpm: Header V4 DSA signature: NOKEY, key ID 3bbf077a
Preparing... ########################################### [100%]
1:subversion ########################################### [ 17%]
2:subversion-devel ########################################### [ 33%]
3:subversion-perl ########################################### [ 50%]
4:mod_dav_svn ########################################### [ 67%]
5:subversion-tools ########################################### [ 83%]
6:subversion-python ########################################### [100%]

3. Check and verify the subversion version using below command :

[root@server ~]# svn --version
svn, version 1.6.15 (r1038135)
   compiled Jan 15 2011, 23:26:01

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.apache.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - handles 'http' scheme
  - handles 'https' scheme

Complete installation : Complete Installation of Subversion

How to Backup and Restore the Subversion Repository

In this post, i will show you on how to backup and restore the subversion repository using svnadmin command.

To backup the repository, run below command :

     
    [root@server ~]# mkdir /mysvnbackup
    [root@server ~]# svnadmin dump /svn/repos/testsvn > /mysvnbackup/testsvn.svndump
    * Dumped revision 0.
    

To restore the repository, run below command :

    [root@server ~]# rm -rf /svn/repos/testsvn
    [root@server ~]# svnadmin create /svn/repos/newtestsvn
    [root@server ~]# chown -R apache:apache /svn/repos/newtestsvn
    [root@server ~]# svnadmin load /svn/repos/newtestsvn < /mysvnbackup/testsvn.svndump
    

How to Fix “Repository moved permanently to… please relocate” Error In Subversion

This article assume that you are using the subversion server to control your development source code. For beginner, i believed most of you has facing this error when you try to check in or connect to your subversion repository server.

Error and symptoms : Repository moved permanently; please relocate.

Findings and Mistakes :
1. Apache DocumentRoot cannot same with the SVNPath or SVNParent. Don’t Do this!
2. SVNPath or SVNParent does not overlap Apache Documentroot. Don’t Do this!

Solutions :
1. Apache Documentroot and SVNPath or SVNParent must be in the different physical path or directory, so that it does not match the url.
2. Change the Apache configuration as below :

    <VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName svn.local
    ErrorLog logs/svn.local-error_log
    CustomLog logs/svn.local-access_log common
    </VirtualHost>
    

3. Change the SVNPath or SVNParent as below :

    <Location /svn/repos>
    DAV svn
    SVNParentPath /svn/repos
    ...
    ...
    </Location>
    

Referances :
http://subversion.apache.org
http://serverfault.com

How to Configure LDAP Authentication for Subversion on CentOS 5.5

In this post, i will show you on how to configure your existing subversion with LDAP authentication. This guideline assume that you are already configure the Apache and subversion with htpasswd user. 389 LDAP has been installed but not yet configure in your subversion configuration file.

Prerequisite :
a)How to Install Apache Httpd Web Server on Linux
b)How to Install Subversion 1.6.16 on CentOS 5.5 Server
c)How to Install 389 Directory Server on CentOS/RHEL

Steps:
1. Locate and open subversion.conf using vi editor

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

2. Modify the existing subversion.conf to below:

    # Needed to do Subversion Apache server.
    LoadModule dav_svn_module     modules/mod_dav_svn.so
    
    # Only needed if you decide to do "per-directory" access control.
    LoadModule authz_svn_module   modules/mod_authz_svn.so
    
    #
    # Example location directive.
    #
    
    <Location /svn/repos>
            DAV svn
            SVNParentPath /svn/repos
            AuthBasicProvider ldap
            AuthType Basic
            AuthzLDAPAuthoritative on
            AuthName "My Subversion server"
            AuthLDAPURL "ldap://ldap.intranet.local:389/DC=intranet,DC=local?uid?sub?(objectClass=*)" NONE
            AuthzSVNAccessFile /svn/permissions/svnaccess
            Require valid-user
    </Location>
    

3. Save configuration file and restart the apache server.

    [root@server ~]# service httpd restart
    Stopping httpd:                                            [  OK  ]
    Starting httpd:                                            [  OK  ]
    

How to Install and Configure ViewVC for Subversion on CentOS

Another alternative for subversion repositories web viewer is ViewVC. Just like WebSVN, viewvc having many useful features such as viewing subversion repositories, directories, to view change log listings and it can display specific versions of files as well as diffs between those versions. At the time of this post wrote, the most recent stable release of ViewVC is release 1.1.10.

Prerequisite :
1. How to Install Apache Httpd Web Server on Linux
2. How to Install Subversion on CentOS 5.5 Server

Steps to Install and Configure ViewVC.
1. Download ViewVC stable release 1.1.10
You can download using wget command on CentOS server as below:

    wget http://viewvc.tigris.org/files/documents/3330/48879/viewvc-1.1.10.tar.gz
    
    [root@server ~]# cd /tmp
    [root@server tmp]# wget http://viewvc.tigris.org/files/documents/3330/48879/viewvc-1.1.10.tar.gz
    --2011-04-03 19:09:06--  http://viewvc.tigris.org/files/documents/3330/48879/viewvc-1.1.10.tar.gz
    Resolving viewvc.tigris.org... 204.16.104.146
    Connecting to viewvc.tigris.org|204.16.104.146|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 602017 (588K) [application/x-gzip]
    Saving to: `viewvc-1.1.10.tar.gz'
    
    100%[===========================================>] 602,017     20.0K/s   in 29s
    
    2011-04-03 19:09:38 (20.3 KB/s) - `viewvc-1.1.10.tar.gz' saved [602017/602017]
    

2. Extract and unzip the viewvc-1.1.10.tar.gz using below command:

    [root@server tmp]# tar xvfz viewvc-1.1.10.tar.gz
    

3. Go to viewvc-1.1.10 directory and start the installation:

    ./viewvc-install
    
    [root@server tmp]# cd viewvc-1.1.10
    [root@server viewvc-1.1.10]# ./viewvc-install
    This is the ViewVC 1.1.10 installer.
    
    It will allow you to choose the install path for ViewVC.  You will now
    be asked some installation questions.  Defaults are given in square brackets.
    Just hit [Enter] if a default is okay.
    
    Installation path [/usr/local/viewvc-1.1.10]:
    
    DESTDIR path (generally only used by package maintainers) []:
    -
    -
    -
    -
    -
    -
    -
    ViewVC file installation complete.
    
    Consult the INSTALL document for detailed information on completing the
    installation and configuration of ViewVC on your system.  Here's a brief
    overview of the remaining steps:
    
      1) Edit the /usr/local/viewvc-1.1.10/viewvc.conf file.
    
      2) Either configure an existing web server to run
         /usr/local/viewvc-1.1.10/bin/cgi/viewvc.cgi.
    
         Or, copy /usr/local/viewvc-1.1.10/bin/cgi/viewvc.cgi to an
         already-configured cgi-bin directory.
    
         Or, use the standalone server provided by this distribution at
         /usr/local/viewvc-1.1.10/bin/standalone.py.
    

3. Edit /viewvc.conf for your specific
configuration. In particular, examine the following configuration options:

          svn_roots (for Subversion)
          root_parents (for CVS or Subversion)
          default_root
          root_as_url_component
          rcs_dir
          mime_types_files
    
    [root@server ~]# vi /usr/local/viewvc-1.1.10/viewvc.conf
    
        147 ## Example:
        148 ## root_parents = /opt/svn: svn,
        149 ##                /opt/cvs: cvs
        150 ##
        151 root_parents =
        152
    

Uncomment line 151 and define the subversion root repositories.

    root_parents = /svn/repos: svn,
    

4. Locate your Apache configuration file. Typical locations are:

    /etc/httpd/httpd.conf,
    /etc/httpd/conf/httpd.conf, and
    /etc/apache/httpd.conf.
    

Depending on how Apache was installed. Configure Apache to expose ViewVC to users at the URL of your choice. Edit the apache web server config file as below:

    [root@server ~]# vi /etc/httpd/conf/httpd.conf
    
    565 ScriptAlias /viewvc /usr/local/viewvc-1.1.10/bin/cgi/viewvc.cgi
    566 ScriptAlias /query /usr/local/viewvc-1.1.10/bin/cgi/query.cgi
    

or if without line number, it will be as below:

    ScriptAlias /viewvc /usr/local/viewvc-1.1.10/bin/cgi/viewvc.cgi
    ScriptAlias /query /usr/local/viewvc-1.1.10/bin/cgi/query.cgi
    
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    #
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
    ScriptAlias /viewvc /usr/local/viewvc-1.1.10/bin/cgi/viewvc.cgi
    ScriptAlias /query /usr/local/viewvc-1.1.10/bin/cgi/query.cgi
    #
    # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    

5. Save the httpd.conf then restart the apache server.
6. Test your http://servername/viewvc. If everything properly configured, you should see the page that lists your repositories.

How to Install WebSVN for Subversion on CentOS

In this post, i will guide you on how to set up the WebSVN in your subversion repository. WebSVN will enable you to view your subversion repositories with default useful features as below:-

  • Blame (annotation) view of file authorship
  • Comparing revisions of files / directories
  • Revision and log message browsing / searching
  • RSS feed support for watching any resource

In order to enable other features such as path-based restriction of privileges, proper customization of config.php code is needed. At the time of this article wrote, the current release of WebSVN is WebSVN Release 2.3.2.

Prerequisite :
1. How to Install Apache Httpd Web Server on Linux
2. How to Install Subversion on CentOS 5.5 Server

Steps to install WebSVN :
1. Download the WebSVN Release 2.3.2
You can wget as below. Make sure that you put it or move it to your repository directory.

    [root@server repos]# pwd
    /svn/repos
    [root@server repos]# http://websvn.tigris.org/files/documents/1380/48737/websvn-2.3.2.tar.gz
    -bash: http://websvn.tigris.org/files/documents/1380/48737/websvn-2.3.2.tar.gz: No such file or directory
    [root@server repos]# clear
    [root@server repos]# pwd
    /svn/repos
    [root@server repos]# wget http://websvn.tigris.org/files/documents/1380/48737/websvn-2.3.2.tar.gz
    --2011-04-03 17:53:20--  http://websvn.tigris.org/files/documents/1380/48737/websvn-2.3.2.tar.gz
    Resolving websvn.tigris.org... 204.16.104.146
    Connecting to websvn.tigris.org|204.16.104.146|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 846511 (827K) [application/x-gzip]
    Saving to: `websvn-2.3.2.tar.gz'
    
    100%[===========================================>] 846,511     72.9K/s   in 31s
    
    2011-04-03 17:53:53 (26.5 KB/s) - `websvn-2.3.2.tar.gz' saved [846511/846511]
    

2. Extract and unzip the websvn-2.3.2.tar.gz using below command and rename it as websvn for easy browsing URL as below:
http://servername/websvn/

    [root@server repos]# tar xvfz websvn-2.3.2.tar.gz
    [root@server repos]# mv websvn-2.3.2 websvn
    

3. Go to websvn/include directory. Make a copy of distconfig.php and name it as config.php. config.php will be the main configuration file of your WebSVN.

    [root@server repos]# cd websvn/include
    [root@server include]# ls
    accessfile.php  command.php      diff_util.php   setup.php     utils.php
    auth.php        configclass.php  distconfig.php  svnlook.php   version.php
    bugtraq.php     diff_inc.php     header          template.php
    [root@server include]# cp distconfig.php config.php
    

4. Edit the config.php file. Then uncomment line 106 and modify the parentPath as below:

    [root@server include]# vi config.php
    106 // $config->parentPath('Path/to/parent (e.g. c:\\svn)');
    

Change to :

    106 $config->parentPath('/svn/repos');
    

5. Save the config.php then test your http://servername/websvn. If everything properly configured, you should see the page that lists your repositories.