Ubuntu 14.04.x x64 – Install ViewVC with LDAP Authentication

Last Modified 2015.10.16
01. Download and extract ViewVC stable release http://viewvc.tigris.org/servlets/ProjectDocumentList?folderID=6004:
$ cd /root
$ wget http://viewvc.tigris.org/files/documents/3330/49471/viewvc-1.1.24.tar.gz
$ tar xvfz viewvc-1.1.24.tar.gz

02. Go to viewvc-1.1.24 directory and start the installation:
$ cd viewvc-1.1.24
$ ./viewvc-install –prefix=/usr/share/viewvc

DESTDIR path (generally only used by package maintainers) []: Leave blank and press enter.
03. Configure ViewVC by editing the viewvc.conf file:
$ nano /usr/share/viewvc/viewvc.conf

Change from:
# root_parents =

root_parents = /svn : svn

04. Add ViewVC to your virtualhost:
$ nano /etc/apache2/sites-enabled/default-ssl.conf

Add the lines below to the bottom of the file.
## ViewVC
ScriptAlias /viewvc /usr/share/viewvc/bin/cgi/viewvc.cgi
ScriptAlias /query /usr/share/viewvc/bin/cgi/query.cgi
<Directory /usr/share/viewvc/bin/cgi>
Order allow,deny
Allow from all

05. Enable the cgi module:
$ a2enmod cgid

06. Create a user permission config in conf-available and then create link to conf-enabled:
$ touch /etc/apache2/conf-available/viewvc.conf
$ ln -s /etc/apache2/conf-available/viewvc.conf /etc/apache2/conf-enabled/viewvc.conf

07. Add project specific permissions, per project:
$ nano /etc/apache2/conf-enabled/viewvc.conf

<Location /viewvc/Repo1>
AuthType Basic
AuthName “Secure Area”
AuthBasicProvider ldap
AuthLDAPURL “ldap://myserver.server.net:389/ou=People,dc=server,dc=net” TLS
AuthLDAPBindDN “cn=manager,dc=server,dc=net”

Require ldap-attribute gidNumber=12
Require ldap-attribute gidNumber=13
Require ldap-attribute gidNumber=14

08. Restart Apache2:
$ service apache2 restart
Now open the browser and type: https://myserver.server.net/viewvc


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s