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 Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7/CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7/CentOS 7

This article will explain the steps to reset a lost root password or to reset forgotten root password on Linux RHEL 7 or CentOS 7. Basically, the steps will adding...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

1 Comment

  • Avatar for Sharafudheen Sharafudheen says:

    Hi,

    I have installed viewvc-1.1.5. How to integrate viewvc with ldap authentication. I did succesfully on svn , but in viewvc, it is not working. P

Leave a Reply

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