websvn
http://www.ehowstuff.com/how-to-install-websvn-for-subversion-on-centos/
Install WebSVN for Subversion on centos
------------------
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.
------------------------------------------------------
Install Subversion 1.6.16 on CentOS 5.5 Server
Subversion is a open source version control system that will manages files and will keep the changes made to the files, over time. This will allows us to recover older versions of the data or examine the history of how the data changed. In this post, i will show you on how to install Subversion 1.6.16 on CentOS 5.5.
1. Download Subversion 1.6.16
[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
2. Install the RPM packages
[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]#
3. Setting up directories
mkdir /svn mkdir /svn/repos mkdir /svn/users mkdir /svn/permissions chown -R apache:apache /svn
4. Configure httpd Apache server as below:
DocumentRoot /svn/repos ServerName svn.local ErrorLog logs/svn.local-error_log CustomLog logs/svn.local-access_log common
5. Create and Configure subversion.conf
[root@server ~]# vi /etc/httpd/conf.d/subversion.conf
# 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 AuthType Basic AuthName "Authorization Realm" AuthUserFile /svn/users/passwords AuthzSVNAccessFile /svn/permissions/svnaccess Require valid-user </Location>
6. Create first repository using svnadmin command
[root@server ~]# svnadmin create /svn/repos/testsvn [root@server ~]# chown -R apache:apache /svn/repos/testsvn
7. Create htpasswd user to access the testsvn repository
[root@server ~]# htpasswd -c /svn/users/passwords user1 New password: Re-type new password: Adding password for user user1 [root@server ~]# htpasswd -m /svn/users/passwords user2 New password: Re-type new password: Adding password for user user2
8. Create svnaccess file to access the testsvn repository
[root@server ~]# vi /svn/permissions/svnaccess
[groups] testgroup = user1, user2 [testsvn:/] @testgroup = rw
9. Test your subversion server from browser http://192.168.2.5/svn/repos/testsvn/
testsvn - Revision 0: / -------------------------------------------------------------------------------- Powered by Subversion version 1.6.16 (r1073529).
Proceed to below URL if you want to view your repository using WebSVN or Viewvc.
-----------------------------------------------