administration mode
Pssst...Ferdy is the creator of JungleDragon, an awesome wildlife community. Visit JungleDragon

 

WebSVN installation & customization »

FERDY CHRISTANT - APR 2, 2006 (09:49:02 AM)

Now that I have my version management system implemented using SubVersion, I wanted to install WebSVN as well. WebSVN allows for online repository browsing. What exactly does that mean? It means you can use your browser to view all your source code, its different revisions, change history and even differences between revisions. Sounds really cool eh?

Installation

Installation of WebCVS is a joy, assuming you have a working SubVersion setup:
  • Download it.
  • Extract the archive you downloaded to any directory within your Apache root, i.e. "/var/www/html/WebSVN".
  • In the "includes" directory of your extracted WebSVN directory, edit the file "distconfig.inc". Uncomment the following two lines:
    $config->parentPath("/svn/repos");
    $config->setTemplatePath("$locwebsvnreal/templates/BlueGrey/");

    Save the file, and then rename it to "config.inc".
     
  • Open up "http://yourhostname/WebSVN". If all went well, you should see a homepage that lists your repositories.

Customization

I had no real interest in customizing the look & feel of the online repository browsing experience, but found out that WebSVN has a great template system for this. This is what I did to change the header logo, other customizations will work in a similar way:

  • Make a copy of one of the "WebSVN/templates" directories that you would like to use as a starting point. Rename your directory to a name of your choice. Let's assume we called it "MyStyle".
     
  • Edit the file "WebSVN/includes/config.inc, change the line "$config->setTemplatePath("$locwebsvnreal/templates/BlueGrey/");" into "$config->setTemplatePath("$locwebsvnreal/templates/MyStyle/");"
  • Go into the "MyStyle" directory and edit the look & feel. I added a new logo image, and changed the existing reference in the file "header.tmpl".


Do not underestimate the power of online repository browsing. Not only does it give you great insight into the life cycle of source code, it also creates an atmosphere of open innovation. Imagine you implement this for your department of developers, everybody's successes and failures will be surfaced to everybody! This puts the T back in Team.

Comments: 48
Reviews: 6
Average rating: rating
Highest rating: 5
Lowest rating: 4

COMMENT: ALINA RIMBU emailrating

MAY 4, 04:30:41 PM

comment » I used thes einstructions to install Subversion on RedHat.

Many thanks.

Alina Rimbu «

COMMENT: RYAN CONNELLY emailhomepage

MAY 30, 07:04:58 PM

comment » I had some trouble installing the WebSVN. After setting the parent path, I still got the message:

"Please set up a repository path in include/config.inc using $config->parentPath or $config->addRepository."

When adding the repositories manually, websvn seems to work. Did anyone else have this issue?

Great article! «

COMMENT: SIMON email

JUN 29, 08:52:39 PM

comment » Hi,

I am trying to install on Fedora Core 5, and have followed the simple instructions here, but when I try to view the repositories (http://localhost/WebSVN) I get the following errors:

Forbidden

You don't have permission to access /WebSVN on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

I tried changing the owership of the /var/www/html/WebSVN folder and subfolders to apache.apache., but this made no difference. Does anybody have any suggestions, or has anyone run into the same issue?

Thanks «

COMMENT: OM

AUG 5, 01:50:25 PM

comment » I am also facing same problem as mension above by RYAN.

I am using Wndow 2003 server with Apache2/php5.

........Waiting for someone to post some way to come out of it.

thnx «

COMMENT: DUP homepage

AUG 7, 10:54:43 AM

comment » Two issues described here can be solved by editing the apache websvn.conf file :

1. Add an alias directive :

Alias /Websvn /var/www/websvn

2. Add a '+' in front of the "FollowSymLinks" Directive :

Options +FollowSymLinks

Hope this helps «

COMMENT: FERDY

AUG 7, 09:20:34 PM

comment » Dup,

Thanks. Although I did not face the issues mentioned by the others, it's really nice of you to post the solution. «

COMMENT: MICHELE

SEP 6, 09:17:46 AM

comment » For the "403 Forbidden error" please refer to

http://fedora.redhat.com/docs/selinux-apache-fc3/sn-simple-setup.html

the execution of following commands as root shuld be work.

"chmod -R apache.apache /var/www/html/websvn/"

"chcon -R -h -t httpd_sys_content_t /var/www/html/websvn/"

Hope this helps.

Thanks all.

bye «

COMMENT: MARC rating

OCT 31, 02:08:17 AM

comment » Very useful tutorial. Thanks «

COMMENT: BOB

NOV 1, 12:10:54 AM

comment » Is it possible to add Repository in the form of a URL instead of path to local svn directory?

This does not seem to work!

$config->addRepository("NameofProj","svn://myproj/proj");

Any work around? «

COMMENT: CHANDU emailhomepage

NOV 13, 11:12:33 AM

comment » Hi,

I installed Subversion in FC5 but, I don't know how to run Subversion in FC5.

If any one know about this please send a mail. «

COMMENT: MANISH PANT email

DEC 19, 11:52:43 AM

comment » Hi,

I tried to use websvn for my repository but getting the error :

XML error: no element found (3) at line 3 column 0 byte 45

cmd: svn --non-interactive --config-dir /tmp log --xml --quiet 'https://172.21.164.51:1116/svn/EPMS_Project_Code/'

while clicking on the repository name at the first page located at

" https://172.21.164.51:1116/websvn "

here 'https://172.21.164.51:1116/svn/EPMS_Project_Code/' is my repository path.

Please help me out «

COMMENT: SYLVAIN email

MAR 14, 15:25:39

comment » Hi,

I have the same problem that MANISH PANT

Please help us !! «

COMMENT: JAMES DICKEN emailhomepage

MAR 26, 07:46:50 PM

comment » That error is caused by Apache not having permission to access the repository. I had a similar problem. Is the server on the same machine as WebSVN?

James «

COMMENT: NATHAN FLOREA

MAY 25, 08:00:50 PM

comment » The problem with $config->parentPath mentioned above is that you have to go a level above your repository. For example, my repos is at /usr/local/svn. That is what contains my db, hooks, etc. directories. So I have to use "/usr/local", NOT "/usr/local/svn", i.e. $config->parentPath("/usr/local"). This took me a frustratingly long time to figure out. It wasn't until I actually looked at the code that I figured it out. I might submit a patch to the text in the example config file to make that clearer. Hopefully this will help anyone who happens across this page while googling for the solution like I did. «

COMMENT: JEREMY email

JUN 19, 12:44:28 PM

comment » Thanks for the instruction they work great. One question with WebSVN thou. Is there a way to limit the access to this site? Does this have to be done in the /etc/httpd/conf/httpd.conf file? Thanks

Jeremy «

COMMENT: RALPH CHILDERS emailhomepage

AUG 16, 11:35:48 PM

comment » Has any one seen this after installing Websvn: Error running this command: svn --config-dir /tmp --version

1) I put websvn under my iis root C:\Inetpub\wwwroot\websvn20.

2) point my browser to http://localhost/websvn20/index.php

And have no ideal what to do... currently looking at the screen. Help will be very welcome. «

COMMENT: MR. BEANS

AUG 22, 12:47:47

comment » I think I am too stupid for that - running apache on xp and use tortoiseSVN.

When I put websvn as a folder under localhost and change the 2lines in the config-file - I only get the error:

Fatal error: Cannot redeclare class config in \xampp\php\pear\Config.php on line 44

??? I know Linux makes it surely easier to handle but I am using windows, sorry «

COMMENT: ENTIDI emailhomepage

NOV 5, 04:44:47 PM

comment » I've downloaded view WebSVN-2.0 and, after a little work, all runs perfectly: very impressive.

A little detail: include/distconfig.inc is now include/distconfig.php and MUST be renamed to include/config.php (I suppose it recently changed the name). Renaming in the old way (that is, to include/config.inc) will force PHP call the PEAR's config.php.

I think this could be the problem MR.BEANS and RALPH CHILDERS are facing. «

COMMENT: LION email

NOV 16, 11:48:40 AM

comment » Problem: XML error: no element found (3) at line 3 column 0 byte 45

Resolv: Add prefix "file:///" for your path to repository.

Example:

$config->addRepository("My Project Name", "/usr/local/sv_repo/My_Project/");

change to

$config->addRepository("My Project Name", "file:///usr/local/sv_repo/My_Project/");

and be happy 01 :) «

COMMENT: LION email

NOV 16, 11:58:11 AM

comment » Problem: Don't show Cyrillic text in my source file. (code page windows 1251)

I change setInputEncoding and setContentEncoding but i don't show any affects 09 .

WebSVN 2.0

OS: FreeBSD 5.3

Web server: 2.0

How to fix it?

Plz. write on to my e-mail. «

COMMENT: MISTERMARTIN75 email

FEB 4, 2008 - 09:22:26 AM

comment » Problem: XML error: no element found (3) at line 3 column 0 byte 45

Resolution by Lion did not solve the problem. Running the command manually displays the XML log just the way it should, only WebSVN doesn't get it somehow.

Anybody been able to solve this? «

COMMENT: YOUNSS AZZAYANI email

FEB 8, 2008 - 16:54:04

comment » Thank you man , very helpful guide ;) «

COMMENT: ANIRUDHA JADHAV email

FEB 10, 2008 - 03:19:37 PM

comment » Error running this command: /usr/local/bin/svn --config-dir /tmp --version

ld.so.1: svn: fatal: libucb.so.1: open failed: No such file or directory

Killed

no idea how to resolve this or why i have this error «

COMMENT: JIMMY email

FEB 11, 2008 - 09:43:39 PM

comment » @MISTERMARTIN75: Problem: XML error: no element found (3) at line 3 column 0 byte 45

> Running the command manually displays the XML log just the way it should, only WebSVN doesn't get it somehow.

That probably works manually because you're not running the command as the same user that your apache runs under.

Check your apache's error log and see if there's an error listed there. My apache's log is located at /var/log/http/error_log; yours may be in a different place.

When I tried to run the command as my apache user, I got....

svn: PROPFIND request failed on '/svn/foo'

svn: PROPFIND of '/svn/foo':

Server certificate verification failed: issuer is not trusted (https://example.com) «

COMMENT: MIRA rating

FEB 13, 2008 - 09:37:12 PM

comment » Thanks, Ferdy, for sharing your experience.

Our WebSVN is working and showing the repositories except that whenever I click on the different "link" features, the error_log in /var/log/httpd is showing the following message. And no files or diffs are displayed as a result.

svn: Can't open file '/root/.subversion/servers': Permission denied

I've removed the .subversion dir and replaced with a link to /var/www/.subversion which is owned by csvn. I've added root and apache to the csvn group in /etc/group. Why csvn? When I did a grep svn /etc/group it shows:

csvn:x:502:apache,root

What still needs to be done? I'm almost there (I hope).

thanks.

Mira «

COMMENT: MIRA

FEB 13, 2008 - 11:08:04 PM

comment » I finally got this working...the only step that's missing is to add o+rx permission to root

Mira «

COMMENT: BRIAN emailhomepage

FEB 20, 2008 - 06:55:35 PM

comment » Hello - I have installed WebSVN using an updated ports tree on FreeBSD v6.2. It installed and configured: Apache/2.0.59 (FreeBSD) DAV/2 SVN/1.4.3 PHP/5.2.0 with Suhosin-Patch Server.

My httpd.conf files contains:

LoadModule php5_module libexec/apache2/libphp5.so

DirectoryIndex index.html index.php index.html.var

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

AddHandler cgi-script .php

I can run 'php index.php' from the command line, save the data to out.html and view out.html from my browser.

However, when I try to run the index.php file directly, I get the following:

(8)Exec format error: exec of '/usr/local/www/data/websvn/index.php' failed

Premature end of script headers: index.php

The directly and file permissins seem okay. Does anyone have any idea of what could be wrong here?

Thank you in advance,

Brian «

COMMENT: DAREK

MAR 6, 2008 - 12:36:00

comment » And I've got message:

Error running this command: svn --config-dir /tmp --version

sh: /svn: No such file or directory «

COMMENT: IMEHESZ homepage

MAR 8, 2008 - 09:05:56 PM

comment » hello. almost perfect ;) has anybody installed this with xampp? i set up the WebSVN as shown here, it is listing my repositories (yay!) but when I click on the links i got this message:

Error running this command: svn --non-interactive --config-dir /tmp log --xml --quiet --limit 1 'PATH_TO_MY_PROJ_REPO'

svn: /opt/lampp/lib/libcrypto.so.0.9.8: no version information available (required by /usr/lib/libneon.so.26)

svn: /opt/lampp/lib/libssl.so.0.9.8: no version information available (required by /usr/lib/libneon.so.26)

thanX

iM «

COMMENT: THAPER email

APR 3, 2008 - 10:03:45 PM

comment » Right... well i change the $config->parentPath('/var/svn/repos'); to $config->parentPath('/var/svn/repos/steve'); or anything else and the web page always shows the original set directory... it never changes and I do CTL-R to refresh the page and restart the web server and still the same.... always the first parent directory I set it at... I cant change it!

thanks

03 «

COMMENT: MICHAEL

APR 9, 2008 - 02:12:12 PM

comment » >> Error running this command: /usr/local/bin/svn --config-dir /tmp --version

Solution for me: Set "safe_mod = Off" in php.ini.

25 «

COMMENT: MAARTEN rating

APR 15, 2008 - 16:42:43

comment » short and simple!!!

ive just installed it from freebsd ports by doing the following

# install websvn from ports

sh> cd /usr/ports/devel/websvn

sh> sudo make install clean

# configure websvn

sh> sudo vi /usr/local/www/data/websvn/include/distconfig.php

# added line

$config->addRepository('MY main repository', 'file:///usr/home/svn/MYrepo', 'phpDEV');

vi>ESC :w /usr/local/www/data/websvn/include/config.php

vi>ESC :q

sh> sudo vi /usr/local/etc/apache22/httpd.conf

# added alias to apache

Alias /websvn /usr/local/www/data/websvn

Options Indexes FollowSymLinks MultiViews

Order deny,allow

Deny from all

AllowOverride FileInfo

allow from all

SSLRequireSSL

vi>ESC :wq

sh> apachectl restart «

COMMENT: MAJID

JUN 16, 2008 - 11:20:11 PM

comment » "Installation of WebCVS is a joy" should be "Installation of WebSVN is a joy" ;) «

COMMENT: RIFDHY email

SEP 5, 2008 - 06:09:19 AM

comment » hi im getting this error on top of my websvn page.any ideas please!!!:(

Warning: opendir(/var/lib/svn) [function.opendir]: failed to open dir: No such file or directory in /usr/share/websvn/include/configclass.inc on line 511

Subversion Server «

COMMENT: DAJVE homepagerating

SEP 22, 2008 - 00:34:29

comment » Hey,

Just a quick note to say thanks for the tutorial - made things much clearer than the documentation.

One thing I will note as it helped me out:

When I added the repository using repository path, it wasn't coming up with any errors but wasn't showing anything inside. I tried it with and without the file:/// prefix (which is necessary) to no avail. What worked was doing a restart (not reload) of Apache and suddenly everything appeared.

This may just be our set up as we've needed to restart the server before for things that don't seem to be connected, but it's another port of call for anyone who's having trouble.

We're running:

Fedora 8

Apache 2.2.4

Cheers again for the tutorial, and also to the commenters,

Dajve «

COMMENT: STIFFLER emailrating

DEC 29, 2008 - 07:58:23 PM

comment » Very nice job.

Websvn ROCKS!!!! «

COMMENT: DAKIS email

JUN 1, 2009 - 08:21:27

comment » Hey,

I 'm getting the following error:

Please set up a repository in include/config.php using $config->parentPath or $config->addRepository

while i have set $config->parentPath to point to my repository

any ideas? «

COMMENT: DEPS

JUN 21, 2009 - 06:03:57 AM

comment » whenever i download the tarball from websvn page, all the binary file creation time /modification time are changing to 1st lanuary 1970.

But the directory time stamps ae correct.

what should be the correct settings if iys using under linux? 29 «

COMMENT: SAM JOHNSON

JUL 22, 2009 - 09:18:40 PM

comment » I'm using M$ unix services to nfs share a directory that is automounted on the system with my apache server.

When using the $config->parentPath('/net/jupiter/Subversion/svn'); Windows is serving Subversion directory as a share and the repositories are below the svn directory. I'm getting access errors in the httpd's error_log even though the UID and GID are hard coded to the apache user and group.

Same problem when I manually mount the share using "mount -t nfs jupiter:/Subversion/svn /svn" Is there an incompatibility or php option I can set to relax permissions?

I can perform directory listings as a user and get no errors.

Thoughts? «

COMMENT: MARCO

OCT 1, 2009 - 11:19:32

comment » Hi,

Ive got a Problem, theres a mistake, which i don't understand.

What can i do to fix this bug?

Error:

Warning: proc_open() has been disabled for security reasons in WebSVN/include/command.php on line 166

Error running this command: svn --config-dir /tmp --version «

COMMENT: ESPENDILLER homepage

OCT 9, 2009 - 16:04:00

comment » @IMEHESZ

svn: /opt/lampp/lib/libcrypto.so.0.9.8: no version information available (required by /usr/lib/libneon.so.26)

for using websvn + xampp you need to unset LD_LIBRARY_PATH. modify php.ini and websvn config.

php.ini:

safe_mode_protected_env_vars =

WebSVN

include/config.php:

putenv("LD_LIBRARY_PATH=");

http://www.espend.de/mikroblog/websvn-mit-xampp-nutzen-ldlibrarypath.html «

COMMENT: JAYANT email

OCT 28, 2009 - 08:36:39 AM

comment » im new to websvn so bear with me.I have recently installed rancid using cvs can u tell me steps to migrate to websvn and whether rhel5 will support it....... «

COMMENT: DEVD emailhomepage

DEC 7, 2009 - 03:02:55 PM

comment » Hi first of all I would to thank the author for making things so easy =. Worked like a charm . Thanks a ton .

@RIFDHY

give the physical directory path of your svn repository. I got the same error, but fixed it by changing the directory path in config.inc. «

COMMENT: JOHN FULTON homepage

JAN 6, 2010 - 03:49:32 PM

comment » When I had the following error:

websvn svn: Can't open file '/root/.subversion/servers': Permission denied

I was running Subversion 1.4.2 with BDB 4.3 and WebSVN 2.0. Upgrading to WebSVN 2.3 fixed the problem. «

COMMENT: JIM email

SEP 4, 2010 - 12:25:00 AM

comment » I keep getting "You do not have the necessary permissions to view this content." But I can't figure out which permission this refers to.

On OpennSuse, Apache2 runs as wwwrun and is in group www. I have all the websvn files and the repositories owned this way.

I also tried turning off the basic authentication, and it still gives me this error. Nothing is in the apache error_log. «

COMMENT: ZOOBE email

OCT 29, 2010 - 09:57:13 AM

comment » Hi, I m facing the following error

"Error running this command: svn --version --config-dir /tmp

'svn' is not recognized as an internal or external command,

operable program or batch file."

Some one plz guide me

23 «

COMMENT: BALA

NOV 14, 2010 - 04:04:21 AM

comment » I was having trouble installing WebSVN with Apache in Linux ( OpenSuse 11 )

Then I decided to install WebSVN with Tomcat 6 as a J2EE web application and it was quite simple compared to configuring it over Apache.

If anyone wants to host WebSVN as a J2EE kind of application with Tomcat below are the steps.

1. You need to install Java-PHP Bridge J2EE web application since WebSVN is pure PHP based application. Visit this URL http://php-java-bridge.sourceforge.net/pjb/tomcat6.php for downloading the JavaBridgeTemplate.war file and complete instructions for same.

2. Download the JavaBridgeTemplate.war and extract it under a new folder namely "javaphpapps" within your tomcat "/webapps" folder.

3. Make sure in Linux you have php-fastcgi installed.

** Note: Before proceeding to Step 4 ensure you have javaphpbridge web application working **

Check it by restarting tomcat (assuming port is 8080). Access javaphpbridge application by accessing as http://localhost:8080/javaphpapps/

index.php should be automatically displayed.

***** ***** ***** *****

4. Download the websvn .zip file and extract it under "javaphpapps" folder namely "websvn"

tomcat directory structure would look as follows

tomcat/bin/

tomcat/conf/

tomcat/webapps/

tomcat/webapps/ROOT/

tomcat/webapps/javaphpapps/

tomcat/webapps/javaphpapps/WEB-INF/lib/JavaBridge.jar

tomcat/webapps/javaphpapps/WEB-INF/lib/php-script.jar

tomcat/webapps/javaphpapps/WEB-INF/lib/php-servlet.jar

tomcat/webapps/javaphpapps/websvn/include

tomcat/webapps/javaphpapps/websvn/lib

5. Restart Tomcat (assuming port is 8080). Access websvn at http://localhost:8080/javaphpapps/websvn

********* optional changes *********

The long URL "/javaphpapps/websvn" can be shortened to "websvn" using "ContextPath" setting in server.xml of tomcat.

File / Database and LDAP authentication etc can also be easily done in Tomcat using this configuration.

Hope this helps.

Thanks

Bala «

COMMENT: ROB emailhomepage

MAR 10, 2011 - 03:46:20 PM

comment » If you want websvn setup to work with apache as well as making sure you authenticate users access to it, check this out:

http://www.duchnik.com/tutorials/vc/setting-up-and-configuring-websvn «

RATE THIS CONTENT (OPTIONAL)
Was this document useful to you?
 
rating Awesome
rating Good
rating Average
rating Poor
rating Useless
CREATE A NEW COMMENT
required field
required field HTML is not allowed. Hyperlinks will automatically be converted.