A Small Orange Forums: WebSVN - Subversion via Apache HowTo - A Small Orange Forums

Jump to content

NOTICE: This is *not* an official support forum

All support requests should be made by through our Support Desk or by emailing help@asmallorange.com.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

WebSVN - Subversion via Apache HowTo How to set up Subversion for public browsing Rate Topic: -----

#1 User is offline   Waylan

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 26
  • Joined: 03-August 05

Posted 24 March 2006 - 03:12 PM

I wanted to set up a Subversion repository and allow public browsing. As dicussed elsewhere, Trac has too many dependencies (including mod_python or fcgi, which can be a pain) and WebDAV is out of the question for the shared accounts, so I needed an alternative.

With a little searching, I found WebSVN which offered a few different, yet clean interfaces and a nice set of options. Here's how I set everything up:

First we create a svn repository. We want to specify the FSFS type because the Berkley DB causes to many permission issues when apache runs as a different user than you.
CODE

    $ cd ~/
    $ mkdir svn
    $ svnadmin create --fs-type fsfs svn

Now, we want to lay out our repo into a nice format. We could create a seperate repo for each project, which WebSVN supports, but in a small shared hosting account we want to keep the used disk space to a minimum. Therefore a single, carefully layed out repo should serve just fine. The Subversion Book has some nice suggestions for this sort of thing. Here's how I did it. First I created a temporary directory and then imported it like so (Be sure to replace <username> with your ASO username):
CODE

    $ mkdir tmpdir
    $ cd tmpdir
    $ mkdir ProjectA
    $ mkdir ProjectA/trunk
    $ mkdir ProjectA/branches
    $ mkdir ProjectA/tags
    $ mkdir ProjectB
    $ mkdir ProjectB/trunk
    $ mkdir ProjectB/branches
    $ mkdir ProjectB/tags
    $ svn import . file:///home/<username>/svn -m 'Inital repository layout'
    Adding         ProjectB
    Adding         ProjectB/trunk
    Adding         ProjectB/branches
    Adding         ProjectB/tags
    Adding         ProjectA
    Adding         ProjectA/trunk
    Adding         ProjectA/branches
    Adding         ProjectA/tags
    
    Committed revision 1.

Now, let's make sure it worked. Then delete the temp dir:
CODE

    $ svnlook tree /home/<username>/svn
    /
     ProjectB/
      trunk/
      branches/
      tags/
     ProjectA/
      trunk/
      branches/
      tags/
    $ cd ../
    $ rm -r tmpdir

Now we want to install WebSVN. Get it via svn You may not want to use truck as I did here - use a stable tag as suggested by the devs. Note that you must use the username and password (both 'guest').
CODE

    $ svn co http://wedsvn.tigris.org/svn/websvn/trunk www/websvn --username guest
    Authentication realm: <http://wedsvn.tigris.org:80> CollabNet SCM Repository
    Password for 'guest': guest
    A  www/websvn/licence.txt
    ...
     U www/websvn
    Checked out revision 445.

Finally, we point WebSVN at our repo and alter any other settings we want:
CODE

    $ cd www/websvn
    $ cp include/distconfig.inc include/config.inc
    $ vim include/config.inc

             // Uncomment and edit this line:
            $config->addRepository("My Projects", "file:///home/<username>/svn");


That should do it. Don't forget to replace <username> with your ASO username.

You can see my slightly modified (and currently empty) repo here. Both the config.inc file and install.txt file included with the package have very good documentation on the options available to you.

The one gripe I have is that it requires Enscript for syntax highlighting, which ASO currenyly does not have installed. I'm using it on my test box at home and it works great. I requested it via ticket so we'll see what happens. I realize I could probably hack WebSVN up to use some bloated php package, but who wants that?
0

#2 User is offline   Waylan

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 26
  • Joined: 03-August 05

Posted 24 March 2006 - 04:30 PM

How about that! ASO just installed Enscript for me. See an example here. cool.gif
0

#3 User is offline   -ASO- Tim

  • Former Head Orange
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,238
  • Joined: 14-March 04

Posted 24 March 2006 - 05:21 PM

Stuck (or perhaps stickied?)! Be sure to pop that into our wiki once we get that set up.
Owner/Manager
A Small Orange Software
<a href="http://www.timdorr.com" target="_blank">timdorr.com</a>

Looking for quick support? <a href="https://www.asmallorange.com/help//index.php?_m=tickets&_a=submit" target="_blank">Submit a support ticket</a>
0

#4 User is offline   Absolut

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 16
  • Joined: 23-December 05

Posted 27 March 2006 - 11:12 PM

Thanks so much for these instructions!

I ran into one problem though. This line didn't work.

CODE

$config->addRepository("My Projects", "file:///home/<username>/svn");


I had to change it to

CODE

$config->addRepository("My Projects", "/home/<username>/svn");


I used version 1.61 and not the latest code, so that could have made a difference.
0

#5 User is offline   Mountain/\Ash

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 03-July 05

Post icon  Posted 05 April 2006 - 07:56 AM

Good stuff - exactly what I was looking at doing. You've saved me so much time. Thanks.

One thing: I found that you had to add the name of the repository.

CODE

$config->addRepository("My Projects", "file:///home/<username>/svn/reposname");


I also used revision 445.
0

#6 User is offline   Waylan

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 26
  • Joined: 03-August 05

Posted 05 April 2006 - 10:44 AM

QUOTE
Tim' date='Mar 24 2006, 5:21 PM' post='44556']
Stuck (or perhaps stickied?)! Be sure to pop that into our wiki once we get that set up.


Wow, that makes two stikies started by myself. biggrin.gif Looking forward to that wiki.

QUOTE(Absolut @ Mar 27 2006, 11:12 PM) View Post

Thanks so much for these instructions!

I ran into one problem though. This line didn't work.

CODE

$config->addRepository("My Projects", "file:///home/<username>/svn");


I had to change it to

CODE

$config->addRepository("My Projects", "/home/<username>/svn");


I used version 1.61 and not the latest code, so that could have made a difference.


Yeah, I have played with a few differnet verisons and that part seems to work a little differently in each. I get the feeling that "file://..." is the new - more inline with svn - way which works with trunk. When the wiki becomes available, I'll be sure to add a warning there. Thanks.

QUOTE(Mountain/\Ash @ Apr 5 2006, 7:56 AM) View Post

Good stuff - exactly what I was looking at doing. You've saved me so much time. Thanks.

One thing: I found that you had to add the name of the repository.

CODE

$config->addRepository("My Projects", "file:///home/<username>/svn/reposname");


I also used revision 445.


Hmm, I didn't and mine works fine. Perhaps you set up your repo a little different? I'm geussing you repo is in a subdir of the svn/ dir while mine is not. Truth be told, that setup is probably better for future expansion ect. That way one could create an additional repo which would not be available to websvn unless it also was added to the config file. That would provide for both private and public repos. I'll have to expond when the wiki goes up.

Oh, and you are all welcome. Glad I could help.

On a side note, my previous links to examples are no longer valid. I've been playing with the url settings and have the url's the way I want them now. See an example here.
0

#7 User is offline   122Blue

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 43
  • Joined: 29-April 06

Posted 07 May 2006 - 01:11 PM

Is there an easy way to download a zip/tar of WebSVN? mellow.gif
IPB Image
0

#8 User is offline   122Blue

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 43
  • Joined: 29-April 06

Posted 07 May 2006 - 03:31 PM

QUOTE(122Blue @ May 7 2006, 12:11 PM) View Post

Is there an easy way to download a zip/tar of WebSVN? mellow.gif

Gah, I figured it out. You have to export it from TortoiseSVN.
IPB Image
0

#9 User is offline   bdude

  • Moderately Sized Orange
  • PipPipPip
  • Group: Members
  • Posts: 105
  • Joined: 24-May 06

Posted 04 June 2006 - 01:31 AM

Just thought I'd tell you the tigiris svn server doesn't need a password
Do you like to blog? Check out my blogging forum proudly hosted by A Small Orange :)
0

#10 User is offline   Waylan

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 26
  • Joined: 03-August 05

Posted 06 June 2006 - 11:26 AM

QUOTE(bdude @ Jun 4 2006, 2:31 AM) View Post

Just thought I'd tell you the tigiris svn server doesn't need a password

Yeah, the requirement for a password was recently removed. It didn't occur to me to update that info here. Thanks.
0

#11 User is offline   w12zard

  • Tiny Orange
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 28-June 06

Posted 28 June 2006 - 12:18 PM

I set everything up according to these instructions (thanks alot btw!). Today when I went to look at my repositories I noticed that there were no directories in there. When I click on "Compare with previous" or anything else (including a file path in the "(Show changed files)" I get this error:

svn: Can't check path '/root/.subversion': Permission denied

I assume it needs me to change the path in the config file somwhere to /home/<user>/.subversion. I can't find any docs that talk about this and nothing has come up on Google. Anyone else having trouble?
0

#12 User is offline   w12zard

  • Tiny Orange
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 28-June 06

Posted 28 June 2006 - 03:16 PM

It may be gauche to reply to your own post but here goes: You can fix this problem by applying this patch (I'm using version 1.61).

Index: include/configclass.inc
===================================================================
--- include/configclass.inc (revision 328)
+++ include/configclass.inc (working copy)
@@ -190,7 +190,7 @@
// Tool path locations

var $svnlook = "svnlook";
- var $svn = "svn --non-interactive";
+ var $svn = "svn --non-interactive --config-dir /tmp";
var $diff = "diff";
var $enscript ="enscript";
var $sed = "sed";
@@ -436,7 +436,7 @@

function setSVNCommandPath($path)
{
- $this->setPath($this->svn, $path, "svn");
+ $this->setPath($this->svn, $path, "svn --non-interactive --config-dir /tmp");
$this->setPath($this->svnlook, $path, "svnlook");
}


Enjoy!

0

#13 User is offline   cypher543

  • Very Large Orange
  • PipPipPipPipPip
  • Group: Members
  • Posts: 451
  • Joined: 01-August 06

Posted 02 August 2006 - 09:35 PM

Hmmm...
QUOTE
Fatal error: Call to undefined function: http_build_query() in /home/****/public_html/websvn/include/utils.inc on line 251

Warning: Long periods of exposure to me may cause geekyness.
0

#14 User is offline   Vormav

  • Tiny Orange
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 03-September 06

Posted 10 September 2006 - 09:20 PM

QUOTE(cypher543 @ Aug 2 2006, 7:35 PM) View Post

Hmmm...
QUOTE
Fatal error: Call to undefined function: http_build_query() in /home/****/public_html/websvn/include/utils.inc on line 251



Apparently it's because the latest version has been written for php5, and most ASO servers are still on php4 by default.
Would anyone happen to know how far back you need to go for websvn on aso? I'll probably just get php5 going on my account, but just thought I'd check.

This post has been edited by Vormav: 10 September 2006 - 09:26 PM

0

#15 User is offline   Mountain/\Ash

  • Small Orange
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 03-July 05

Post icon  Posted 10 September 2006 - 09:31 PM

I'm still using revision 445 on 'psi' and it's working OK. But I now use ViewVC now (I perfer the interface) - I'm from a CVS background.
0

#16 User is offline   Joe Morrison

  • Tiny Orange
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 19-October 08

Posted 19 October 2008 - 02:52 PM

Thanks - these instructions are fantastic. I had to make the following minor changes to get it to work:

1. Where it says:

CODE
Authentication realm: <http://wedsvn.tigris.org:80> CollabNet SCM Repository


that should read

CODE
Authentication realm: <http://websvn.tigris.org:80> CollabNet SCM Repository


i.e. change wedsvn to websvn.

2. Instead of:

CODE
cp include/distconfig.inc include/config.inc
vim include/config.inc


that should read:

CODE
cp include/distconfig.inc include/config.php
vim include/config.php


3. To enable PHP5 for the websvn application, add a one-line file /home/<username>/public_html/websvn/.htaccess with the following contents:

CODE
AddType application/x-httpd-php5 .php


4. In the config file the syntax that worked for me was:

CODE
$config->addRepository('Project CF', 'file:///home/<username>/svn');


But these instructions were a huge help - many thanks again.
- Joe

0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

  1. MSN/Bing