WHY WebSVN?WebSVN offers a view onto your subversion repositories that's been designedto reflect the Subversion methodology. You can view the log of any file ordirectory and see a list of all the files changed, added or deleted in anygiven revision. You can also view the differences between 2 versions of afile so as to see exactly what was changed in a particular revision.WebSVN offers the following features:* Easy to use interface* Highly customisable templating system* Colourisation of file listings* Blame view* Log message searching* Fast browsing thanks to internal caching feature* Apache MultiViews support* RSS feed supportSince it's written using PHP, WebSVN is also very portable and easy to install.INSTALLATIONGrab the source and stick it somewhere that your server can get to. Youobviously need to have PHP installed and working. Also note that WebSVNwon't currently work in safe mode, due to the need to call svnlook.You'll also need diff (preferably the GNU version; for Windows users I'drecommend the Cygwin version) and svnlook available.Rename distconfig.inc as config.inc (found in the includes directory)and thenedit it as directed in the file itself.If everything has gone well, you should be able to view your projects bypointing your browser at the index.php file.For those of you wishing to customise the look and feel a little, you shouldread templates.txt, which explains the highly configurable template system.Windows users - note that some of the features offered by WebSVN, whenenabled, require the use of various external programs. They can be downloadedfrom these locations:Diff/Sed/Gzip/Tar: http://www.cygwin.com/Enscript: http://people.ssh.com/mtr/genscript/ACCENTED CHARACTERSWebSVN is designed to worked with accented characters. To do this, it usesthe iconv function. This may not be installed on your system. If you aren'tgetting the characters that you expect, make sure that the iconv module isbeing loaded in php.ini. Windows users will need to copy the appropriateDLLs to the system directory (from the PHP installation directory).CACHINGIn order to return results with a reasonable speed, WebSVN caches the resultsof it's requests to svnlook. Under normal usage this works correctly sinceit's not generally possible to change a revision with subversion.That said, one case that may cause confusion is if someone changes the logmessage of a given revision. WebSVN will have cached the previous log messageand won't know that there's a new one available. There are various solutionsto this problem:1) Turn off caching in the config file. This will severely impede theperfomance of WebSVN.2) Change the post-revprop-change hook so that is deletes the contents of thecache after any change to a revision property3) Only allow the administrator to change revision properties. He can thendelete the cache by hand should this occur.COLOURISATIONYou can few files with syntax colouring if you have Enscript 1.6 or higherinstalled on your system. You'll also need Sed.Simply set the paths in the config file and then uncomment the line:$config->useEnscript();MULTIVIEWSYou may choose to configure access to your repository via Apache's MultiViewsystem. This will enable you to access a respositoy using a url such as:http://servername/wsvn/repname/path/in/repositoryTo do this you must:- Place wsvn.php where you want to. Normally you place it such that it'saccessible straight after the servername, as shown above.- Configure the parent directory of wsvn.php to use MultiViews (see Apachedocs).- Change config.inc to include the line $config->useMultiViews();- Change the paths configured at the beginning of the wsvn.php script.Now go to http://servername/wsvn/ and make sure that you get the index page.The repname part of the URL is the name given to it in the config.inc file.For this reason you may wish to avoid putting spaces in the name.MULTIVIEWS EXAMPLEFirst, you must get the Multiviews option working. In my set up, my Apachedirectory root is set to a location on my harddrive:DocumentRoot "D:/svnpage"In that directory, I have WebSVN installed in a directory called websvn.Normally WebSVN would be accessed by http://servername/websvnwsvn.php in then copied from the WebSVN installation to the document rootdirectory and the variables at the beginning of the script configured asfollows (based on your own directory locations, obviously):// Location of websvn directory via HTTP//// e.g. For http://servername/websvn use /websvn//// Note that wsvn.php need not be in the /websvn directory (and normally isn't).$locwebsvnhttp = "/websvn";// Physical location of websvn directory$locwebsvnreal = "d:/svnpage/websvn";Next, turn on Multiviews in the WebSVN config.inc file:$config->useMultiViews();Finally, Apache needs to know that you want to enable MultiViews for the rootdirectory. This can be done by including this line in the directory's.htaccess file (assuming that the appropriate AllowOverrides directive is setup):Options MultiViewsIf all has gone well, repositories should now by accessible byhttp://servername/wsvn/repnameNote the index page can be accessed through http://servername/wsvnIf you want to view the index page by http://servername/ you need toadd another directive to the .htaccess file:DirectoryIndex wsvn.phpACCESS RIGHTS AND AUTHENTICATIONYou may wish to provide an authentication mechanism for WebSVN. One obvioussolution is to protect the entire WebSVN directory with some form of Apacheauthentication mechanism, but that doesn't allow for per repositoryauthentication.WebSVN provides and access rights mechanism that uses your SVN access file tocontrol read access to the repository. This means that you only have tomaintain one file to define both Subversion and WebSVN access rights.For this to work, you need to configure your authentication method to the /WebSVN/(or /wsvn/) directory. This should be the same authentication as you use forthe svn repositories themselves. Here's an example using SSPI:<Location /WebSVN/>AuthType SSPISSPIAuth OnSSPIAuthoritative OnSSPIDomain IMAJEMAILSSPIOfferBasic OnRequire valid-user</Location>Note the use of the / after /WebSVN/ in the location directive. If you use<Location /WebSVN> then you won't be able to access the index.You should change /WebSVN/ to /wsvn/ if you're using multiviews.Also note that you shouldn't use the AuthzSVNAccessFile command to define theaccess file.Now that you've defined your authentication, you'll be asked for your user nameand password in order to access the WebSVN directory. All that's left is toconfigure WebSVN to use your Subversion access file to control access. Add thisline to your config.inc file:$config->useAuthenticationFile("/path/to/accessfile");Note that if your access file gives read access to, for example, path /a/b/c/ butnot to /a/b/, then the user will be given restricted access to /a/b/ in order toreach /a/b/c/. The user will not be able to see any other files or directories in/a or /a/b/.You should read the Subversion book for information on the access file format.COMMON PROBLEMS1) On a Windows machine, this error is reported:Warning: shell_exec(): Unable to executeIf you experience this problem, you need to give IUSR_<machinename> executepermissions on %systemroot%\system32\cmd.exe. Under most systems, the file willbe C:\WINDOWS\system32\cmd.exe.Right-click on the file, choose properties, and on the security tab clickthe "Add" button. Add the IUSR_<machinename> user, and then select the"read" and "read & execute" boxes.LICENCEGNU Public licence.