Koozali.org: home of the SME Server

Anyone got ViewVC working ?

Offline mpfj

  • 18
  • +0/-0
Anyone got ViewVC working ?
« 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

Offline mmccarn

  • *
  • 2,628
  • +10/-0
Re: Anyone got ViewVC working ?
« Reply #1 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

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Anyone got ViewVC working ?
« Reply #2 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

Offline mpfj

  • 18
  • +0/-0
Re: Anyone got ViewVC working ?
« Reply #3 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 ?

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Anyone got ViewVC working ?
« Reply #4 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)
« Last Edit: December 11, 2017, 01:48:12 PM by Jean-Philippe Pialasse »

Offline mpfj

  • 18
  • +0/-0
Re: Anyone got ViewVC working ?
« Reply #5 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:

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Anyone got ViewVC working ?
« Reply #6 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.

Offline ReetP

  • *
  • 3,744
  • +5/-0
Re: Anyone got ViewVC working ?
« Reply #7 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 :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Anyone got ViewVC working ?
« Reply #8 on: December 13, 2017, 06:23:48 AM »
I'm off to get my :pint: from Michael Doerner :-)

Wheres my invite :-)
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,744
  • +5/-0
Re: Anyone got ViewVC working ?
« Reply #9 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.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Anyone got ViewVC working ?
« Reply #10 on: December 13, 2017, 01:33:27 PM »
That 3hr window scenario sounds like when I had coffee with him two years ago :-)
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,744
  • +5/-0
Re: Anyone got ViewVC working ?
« Reply #11 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
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation