0

I can't get viewvc working in Ubuntu 16.04. (The same setup worked in Ubuntu 15.10.) The error message in /var/log/apache2/error.log is:

[authz_core:error] [pid 24296]
 [client 192.168.1.34:37586] AH01630: client denied by server configuration:
 /usr/lib/cgi-bin/viewvc.cgi

Here's what I did. I installed the package:

sudo apt install viewvc

configured /etc/viewvc/viewvc.conf:

[general]
root_parents = /data/svnrepo : svn

[options]
root_as_url_component = 1
allowed_views = annotate, diff, markup, roots, co
template_dir = /etc/viewvc/templates

set up an Apache virtual host:

<VirtualHost *:80>
    ServerAdmin smith@localhost
    ServerName svn.example.com
    Alias /docroot /usr/share/viewvc/docroot
    ScriptAlias / /usr/lib/cgi-bin/viewvc.cgi/

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /usr/lib/cgi-bin/viewvc.cgi/>
     Require all granted
    </Directory>

    <Directory /usr/share/viewvc/docroot>
     Require all granted
    </Directory>
</VirtualHost>

enabled it and restarted apache (with no errors):

sudo a2ensite svn.example.com.conf
sudo service apache2 restart

but whenever I hit svn.example.com, I get this error:

Sun Sep 25 14:25:24.430254 2016] [authz_core:error] [pid 24296]
 [client 192.168.1.34:37586] AH01630: client denied by server configuration:
 /usr/lib/cgi-bin/viewvc.cgi, referer: http://svn.example.com/

I have already tried (without solving the problem):

  • Installing libapache2-svn
  • Deleting all the AllowOverride and Require directives from /etc/apache2/apache2.conf
  • Using Apache 2.2 syntax (Order allow, deny, Allow from all)
  • Adding Options FollowSymLinks and ExecCGI
  • AddHandler cgi-script cgi
  • iptables -F
  • The advice on this page

Any suggestions appreciated!

DanB
  • 874
  • 11
  • 29

1 Answers1

0

The problem turned out to be that the CGI module is not enabled, so the ScriptAlias command wasn't working. The solution was:

$ sudo a2enmod cgi
$ sudo service apache2 restart

and refresh the browser.

I was also able to simplify the Apache config by removing the <Directory> parts:

<VirtualHost *:80>
    ServerAdmin smith@localhost
    ServerName svn.example.com
    Alias /docroot /usr/share/viewvc/docroot
    ScriptAlias / /usr/lib/cgi-bin/viewvc.cgi/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Thanks to C. Michael Pilato for helping to point me in the right direction.

DanB
  • 874
  • 11
  • 29