Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391734

WebSVN with VisualSVN Server, anyone gotten authentication to work?

I have a VisualSVN Server installed on a Windows server, serving several repositories.

Since the web-viewer built into VisualSVN server is a minimalistic subversion browser, I'd like to install WebSVN on top of my repositories.

The problem, however, is that I can't seem to get authentication to work. Ideally I'd like my current repository authentication as specified in VisualSVN to work with WebSVN, so that though I see all the repository names in WebSVN, I can't actually browse into them without the right credentials.

By visiting the cached copy of the topmost link on this google query you can see what I've found so far that looks promising.
(the main blog page seems to have been destroyed, domain of the topmost page I'm referring to is the-wizzard.de)

There I found some php functions I could tack onto one of the php files in WebSVN. I followed the modifications there, but all I succeeded in doing was make WebSVN ask me for a username and password and no matter what I input, it won't let me in.

Unfortunately, php and apache is largely black magic to me.

So, has anyone successfully integrated WebSVN with VisualSVN hosted repositories?

Upvotes: 8

Views: 12765

Answers (5)

bahrep
bahrep

Reputation: 30672

If you are looking for a web-based repository browser which is more feature-rich than the default one and you use VisualSVN Server, then upgrade to VisualSVN Server 3.2 or newer.

VisualSVN Server has a rich web interface for Subversion repositories. Unlike WebSVN, VisualSVN Server's built-in web client works out of the box and does not require an administrator to perform any configuration tasks.

You can see the live demo here: http://demo-server.visualsvn.com/!/

Subversion web user interface in VisualSVN Server

Upvotes: 1

MatthewMartin
MatthewMartin

Reputation: 33193

I got this to work with windows authentication (which is actually AuthType VisualSVN) The trick is to comment out the svn auth and replace it with the same sort of auth text found in the main config file. Thanks to Anthony Johnson for working out all the other details.

# For PHP 5 do something like this:
LoadModule php5_module "F:/wamp/bin/php/php5.3.0/php5apache2_2.dll"
AddType application/x-httpd-php .php


# configure the path to php.ini
PHPIniDir "f:/wamp/bin/php/php5.3.0/"

<IfModule dir_module>
   DirectoryIndex index.html index.php 
</IfModule>

#Alias /websvn/ "F:/Program Files/VisualSVN Server/htdocs/websvn-2.3.1/" 

<Location /websvn-2.3.1/>
   Options FollowSymLinks

    AuthName "Subversion Repositories"
    AuthType VisualSVN
    AuthzVisualSVNAccessFile "F:/Repositories/authz-windows"
    AuthnVisualSVNBasic on
    AuthnVisualSVNIntegrated off
    AuthnVisualSVNUPN Off
   Require valid-user


   SVNListParentPath on
   SVNParentPath "f:/Repositories/"
</Location>

Upvotes: 1

Anthony Johnson
Anthony Johnson

Reputation: 646

I got WebSVN authentication working with VisualSVN server, albeit with a lot of hacking/trial-error customization of my own.

Here's how I did it:

  1. If you haven't already, install PHP manually by downloading the zip file and going through the online php manual install instructions. I installed PHP to C:\PHP

  2. Extract the websvn folder to C:\Program Files\VisualSVN Server\htdocs\

  3. Go through the steps of configuring the websvn directory, i.e. rename configdist.php to config, etc. My repositories were located in C:\SVNRepositories, so to configure the authentication file, I set the config.php line so: $config->useAuthenticationFile('C:/SVNRepositories/authz'); // Global access file

  4. Add the following to C:\Program Files\VisualSVN Server\conf\httpd-custom.conf :

# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php


# configure the path to php.ini
PHPIniDir "C:/php"

<IfModule dir_module>
   DirectoryIndex index.html index.php 
</IfModule>

<Location /websvn/>
   Options FollowSymLinks
   AuthType Basic
   AuthName "Subversion Repository"
   Require valid-user
   AuthUserFile "C:/SVNRepositories/htpasswd"
   AuthzSVNAccessFile "C:/SVNRepositories/authz"
   SVNListParentPath on
   SVNParentPath "C:/SVNRepositories/"
</Location>

This worked for me, and websvn will only show those directories that are authorized for a given user. Note that in order for it to work right, you have to provide "Main Level" access to everybody, and then disable access to certain sub-directories for certain users. For example, I have one user who doesn't have main level access, but does have access to a sub-level. Unfortunately, this person can't see anything in websvn, even if he links directly to filedetails.php for a file he's authorized to see. In my case it's not a big deal because I don't want him accessing websvn anyway, but it's something you'll want to know.

Also, this sets the server up for an ssl connection, so once you've set it up, the address will be and https:// address, not the regular http://.

Upvotes: 7

Jonas Oberschweiber
Jonas Oberschweiber

Reputation: 77

I am the author of the article you mentioned. The information I published was only meant for WebSVN running on IIS. It is my understanding that the software should "just work" when you use PHP on Apache, although I have never set it up in that environment. Have you tried doing some "echo"-debugging (for the lack of a better term) to see where exactly the authentication fails?

Upvotes: 0

Kit Roed
Kit Roed

Reputation: 5227

I'm using VisualSVN Server and I just got done installing Trac. My goal was to get a better web-based repository browser, and Trac is definitely one of the better ones I've seen for Subversion. Go to http://www.visualsvn.com/server/trac/ installation is really quite straightforward. Yes, Trac has a ticket tracking and a wiki system, which you may not be looking for, but the repository and log browser sell it for me.

Now, I have found that it is possible to disable the wiki and ticket tracking systems that come with Trac through simply appending

[components]
trac.ticket.* = disabled
trac.wiki.* = disabled

to the end of the trac.ini configuration file. This causes the start page of the wiki to throw an error that the wiki module cannot be found so you have to set Trac to open with either the Timeline (log view) or Repository Browser on startup by editing the trac.ini again by adding the following under the [trac] heading:

for the log timeline as default

default_handler = TimelineModule

for the repository browser as default

default_handler = BrowserModule

Upvotes: 3

Related Questions