'ViewVC Showing viewvc.cgi file content instead of SVN repositories

Using Ubuntu 18.04

SVN & ViewVC configuration

<Location /svn>
   DAV svn
   SVNParentPath /var/lib/svn
   SVNListParentPath On
   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/apache2/svn.passwd
   Require valid-user
</Location>

<Location /viewvc>
   AuthType Basic
   AuthName "ViewSVN"
   AuthUserFile /etc/apache2/svn.passwd
   #AuthUserFile /etc/subversion/passwd
   Require valid-user
</Location>
#ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.wsgi
ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi

Also added svn_roots in the viewvc.conf

SVN is working and showing all repositories in browser, but ViewVC show viewvc.cgi file content instead of repositories.



Solution 1:[1]

See the faq:

The trick appears to be the presence of the trailing slash character on the ScriptAlias directive.

Replace

ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi

with

ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 navylover