Koozali.org: home of the SME Server

Obsolete Releases => SME 9.x Contribs => Topic started by: mpfj on December 08, 2017, 05:50:23 PM

Title: Anyone got ViewVC working ?
Post by: mpfj on December 08, 2017, 05:50:23 PM
I'm looking to install ViewVC and thought I'd just check to see if anyone had attempted this previously and, if so, managed to get it working ?

Cheers
Title: Re: Anyone got ViewVC working ?
Post by: mmccarn on December 09, 2017, 12:59:33 PM
From the viewvc install doc on github, it looks like this should work:
- install the required prerequisites
- run the viewvc install script
- create an ibay to hold viewvc.  During creation, set 'Execution of dynamic content (CGI, PHP, SSI)' to 'Enabled'.
- copy the viewvc "cgi" scripts into the "cgi-bin" folder of the new ibay
Title: Re: Anyone got ViewVC working ?
Post by: Jean-Philippe Pialasse on December 09, 2017, 06:12:59 PM
You have a rpm on epel. This would help getting the needed dependencies sorted out.

Then you will just need to create a fragment for  httpd
Title: Re: Anyone got ViewVC working ?
Post by: mpfj on December 11, 2017, 12:50:40 PM
Okay, almost working as intended:-

(1) Install viewvc via yum
Code: [Select]
yum --enablerepo=epel install viewvc
(2) Create new ibay called “viewvc”, and enable cgi execution

(3) Copy the viewvc CGI scripts:-
Code: [Select]
cp /usr/lib/python2.6/site-packages/viewvc/bin/cgi/* /home/e-smith/files/ibays/viewvc/cgi-bin
SVN repos are now visible by visiting <server>/viewvc/cgi-bin/viewvc.cgi ...  :-)

What I'd now like to achieve is to create an http Alias from /viewvc to /viewvc/cgi-bin/viewvc.cgi.
I've created a custom VirtualHost template (80ViewVCRedirect) as follows:-
Code: [Select]
{
  $OUT  = "";
  $OUT .= "\n";
  $OUT .= "# Redirect viewvc to CGI script.\n";
  $OUT .= "ScriptAlias /viewvc /home/e-smith/files/ibays/viewvc/cgi-bin/viewvc.cgi\n";
}

... but there's already an (auto-generated) Alias for /viewvc in the httpd.conf file, so I get the warning:-
Code: [Select]
[warn] The ScriptAlias directive will probably never match because it overlaps an earlier Alias
Can anyone tell me how to achieve this top-level alias ?
Title: Re: Anyone got ViewVC working ?
Post by: Jean-Philippe Pialasse on December 11, 2017, 01:42:26 PM
Okay, almost working as intended:-

(1) Install viewvc via yum
Code: [Select]
yum --enablerepo=epel install viewvc
(2) Create new ibay called “viewvc”, and enable cgi execution

(3) Copy the viewvc CGI scripts:-
Code: [Select]
cp /usr/lib/python2.6/site-packages/viewvc/bin/cgi/* /home/e-smith/files/ibays/viewvc/cgi-bin
that is not what I suggest to do, and i would not do that, as you lose all the good side of having the rpm version and the support provided for updates.
You donot have to create an ibay, just to create an appropriate fragment to allow to navigate to the package web root
see our wiki for example

SVN repos are now visible by visiting <server>/viewvc/cgi-bin/viewvc.cgi ...  :-)

What I'd now like to achieve is to create an http Alias from /viewvc to /viewvc/cgi-bin/viewvc.cgi.
I've created a custom VirtualHost template (80ViewVCRedirect) as follows:-
Code: [Select]
{
  $OUT  = "";
  $OUT .= "\n";
  $OUT .= "# Redirect viewvc to CGI script.\n";
  $OUT .= "ScriptAlias /viewvc /home/e-smith/files/ibays/viewvc/cgi-bin/viewvc.cgi\n";
}

... but there's already an (auto-generated) Alias for /viewvc in the httpd.conf file, so I get the warning:-
Code: [Select]
[warn] The ScriptAlias directive will probably never match because it overlaps an earlier Alias
Can anyone tell me how to achieve this top-level alias ?

this is not the easiest way to proceed.

restore the files where they were, I suggest to reintall rpm  (yum reinstall)
check for the suggested httpd conf from the rpm  /usr/share/doc/viewvc-1.1.26/README.httpd
remove your ibay
remove the current custom fragment
create a template custom according to what is in the rpm doc folder and what you find on the our wiki  https://wiki.contribs.org/Web_Application_RPM#Http_Template_92Foo (as an example, there are others)
Title: Re: Anyone got ViewVC working ?
Post by: mpfj on December 11, 2017, 06:00:31 PM
Okay, that all sounds like a much simpler way of doing it ... so I'm now doing this:-

(1) Install ViewVC
Code: [Select]
yum --enablerepo=epel install viewvc viewvc-httpd
(2) Update /etc/viewvc/viewvc.conf file as follows:-
Code: [Select]
root_parents = /home/e-smith/files/repositories : svn
docroot = /viewvc-docroot

(3) Create a redirection template (80ViewVCRedirect) as follows:-
Code: [Select]
{
  $OUT = "";
  $OUT .= "\n";
  $OUT .= "# Redirect viewvc links\n";
  $OUT .= "Alias /viewvc-docroot /usr/share/viewvc/templates/docroot\n";
  $OUT .= "ScriptAlias /viewvc /usr/lib/python2.6/site-packages/viewvc/bin/cgi/viewvc.cgi\n";
  $OUT .= "<Directory /usr/lib/python2.6/site-packages/viewvc>\n";
  $OUT .= " Order allow,deny\n";
  $OUT .= " Allow from all\n";
  $OUT .= "</Directory>\n";
  $OUT .= "<Directory /usr/share/viewvc/templates/docroot>\n";
  $OUT .= " Order allow,deny\n";
  $OUT .= " Allow from all\n";
  $OUT .= "</Directory>\n";
}

(4) Update / restart httpd
Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
/etc/init.d/httpd-e-smith restart

No need to to create a new ibay, and any rpm updates are maintained.

Thank you :cool:
Title: Re: Anyone got ViewVC working ?
Post by: Jean-Philippe Pialasse on December 11, 2017, 10:33:07 PM
good to hear!

thank you for sharing for the next one.


next step would be to collect all of those and make it a rpm smeserver-viewvc.
Title: Re: Anyone got ViewVC working ?
Post by: ReetP on December 13, 2017, 02:45:44 AM
If someone would paste that up on the wiki and maybe create a NFR bug as a reminder I can probably knock up a smeserver rpm quite quickly once I'm back from holiday in the new year.

I'm off to get my :pint: from Michael Doerner :-)
Title: Re: Anyone got ViewVC working ?
Post by: TerryF on December 13, 2017, 06:23:48 AM
I'm off to get my :pint: from Michael Doerner :-)

Wheres my invite :-)
Title: Re: Anyone got ViewVC working ?
Post by: ReetP on December 13, 2017, 09:45:05 AM
Wheres my invite :-)

I'm in NZ for Crimble, somewhere tropical, hot'n shitty & on a beach to see in New Year and then Sydney for 3 days.

Couldn't get the Mrs to take any more time off to get to your neck of the woods mate :-(

Due to Michaels commitments & my movements we have like a 3 hour window of opportunity. You can come if you want :-) He'd be pleased to see you anytime.

Title: Re: Anyone got ViewVC working ?
Post by: TerryF on December 13, 2017, 01:33:27 PM
That 3hr window scenario sounds like when I had coffee with him two years ago :-)
Title: Re: Anyone got ViewVC working ?
Post by: ReetP on December 13, 2017, 02:08:44 PM
That 3hr window scenario sounds like when I had coffee with him two years ago :-)

:-) It would be longer (last time it was several hours) but we both have packed agendas