Here is my documentation on setting up WebSVN on VisualSVN on a Windows Server. Two years ago Sebastiaan and I (but mainly Sebastiaan) set up VisualSVN and installed WebSVN on top of it to browse VisualSVN’s repositories via a web interface. Now I needed to install all the latest versions on a new server and document it. I ran into some trouble because my notes were out of date and Google didn’t help me very much so once the documentation was completed I decided to put it online so it might be use to you.
I am not an expert on any of the software described here. A Troubleshooting section on the bottom of this page lists a couple of errors I encountered while installing and tips on what to do with them.
This guide was originally intended for a colleague who would be installing it. The task was to create a complete installation guide leaving nothing out. You can probably skip most of it however I like to be overcomplete rather than leave steps out that may be obvious to me but might mystify someone else.
The installation of VisualSVN with WebSVN consists of six parts:
- VisualSVN Server hosts your code base
- Cygwin for tools such as diff and zip
- WebSVN for browsing repositories
This article does not cover:
- installing Virtualbox
- installing Windows
- setting up certificates
- connecting SVN clients to your SVN server
This guide is based on:
- Windows Server 2008 64bit Service Pack 1 with .NET 3.5 installed. I used Oracle VM VirtualBox to run it on, taking lots of VM snapshots along the way and switching between them. I can highly recommend this method.
- Cygwin 2.830 (64 bit)
- PHP 5.4.22 Win32-VC9-x86 Thread Safe – be sure to download the version containing the file php5apache2_2.dll as this is the version that works with the Apache server in VisualSVN Server.
- VisualSVN Server 2.7.2
- WebSVN 2.3.3
Before you begin, download all necessary software.
The VisualSVN Server 2.7.2 Setup Wizard is opened. Click Next.
Read the End-User License Agreement, tick I accept te terms in the License Agreement and Click Next.
Select VisualSVN Server and Management Console and tick Add Subversion command-line tools to the PATH environment variable. Click Next.
Click Standard Edition.
Fill in these values:
Location: C:\Program Files (x86)\VisualSVN Server\ Repositories: C:\Repositories\ Server Port: 443 [x] Use secure connection (https://)
Click Install and wait for the installation to finish.
Uncheck Subscribe for release notitication via email or RSS and check Start VisualSVN Server Manager. Click Finish.
The VisualSVN Server management console is opened.
In the tree view on the left, right-click VisualSV Server (Local) and choose Properties.
The VisualSVN Server Properties dialog box is opened. Go to the Authentication tab, choose Use Windows authentication, check Basic authentication and click Ok.
The service is restarted. Verify that the server is reachable by opening your browser and navigating to https://localhost. Ignore the ssl error for now and log on with a local user account.
If all is well you’ll get no errors and the VisualSVN Server page is displayed.
You can now close the VisualSVN Server management console and your browser.
Select Install from Internet and click Next.
Is it possible to download the files you need. Cygwin would save these files to a local directory. You could then move the directory to a computer on which you want to install Cygwin offline and point to it as the local repository (Install from Local Directory). Assuming you have a working internet connection on the machine you’re installing on now however select Install from Internet.
Stick to the default Root Directory for the screenshots in this article to stay consistent or choose another one. Select All Users (RECOMMENDED). I didn’t test the Just Me option so I can’t really say anything about that; I just know the All Users option worked for me. Click Next.
Select the location for the downloaded files and click Next. You can delete this directory after installation or you can keep it around for another time. If you want to keep it, you may want to select a different directory. For the installation at hand it doesn’t matter where you store the files.
Select your internet connection type and click Next.
Select a mirror near you and click Next.
- Search for diff. Expand to All > Utils and find the line where it says diffutils: A GNU collection of diff utilities.
- On the line where it says diffutils: A GNU collection of diff utilities, click the word Skip, changing it to the highest version you can find. This will automatically check the Bin box. No need to check the Src box.
Repeat for these tools and do NOT click Next between searches. Your installation choices will remain marked between searches. Give preference to the highest versions if more are available. Install the binaries (Bin column), not the sources (Src column).
- diff (Category: Utils. We just did that one.)
- enscript (Category: Text)
- sed (Category: Base, probably marked for installation by default)
- tar (Category: Base, probably marked for installation by default)
- gzip (Category: Base, probably marked for installation by default)
- zip (Category: Archive, be careful to really choose zip and not bzip2 for example. There are a lot of utilities that look like zip but aren’t.)
- unzip (Category: Archive)
Click Next. Cygwin Setup will ask you if you want to resolve dependencies. Make sure Select required packages (RECOMMENDED) is checked and click Next/.
Cygwin is now downloaded and installed.
Choose where you want your icons and click Finish.
Create a directory C:\php and extract the contents of the file php-5.4.22-Win32-VC9-x86.zip to it.
Copy C:\php\php.ini-production to C:\php\php.ini.
Open the file C:\php\php.ini and make the following changes:
;extension=php_fileinfo.dll --> extension=php_fileinfo.dll ;extension=php_mbstring.dll --> extension=php_mbstring.dll ;extension=php_xsl.dll --> extension=php_xsl.dll
In the Dynamic Extensions section, add this line:
Open C:\Program Files (x86)\VisualSVN Server\conf\httpd-custom.conf and enter this text:
PHPIniDir "C:\PHP\" LoadModule php5_module "C:\PHP\php5apache2_2.dll" AddHandler php5-script .php DirectoryIndex index.php Options FollowSymLinks AuthName "WebSVN" AuthType VisualSVN AuthzVisualSVNGlobalAccessFile "C:/Repositories/Vis ualSVN-GlobalWinAuthz.ini" AuthnVisualSVNBasic on AuthnVisualSVNIntegrated off AuthnVisualSVNUPN Off
Add C:\php to the system path: click Start, right-click Computer, choose Properties. This will open the System window. Click Advanced system settings. In the System Properties window, open the Advanced tab. Click the Environment Variables button. This will open the Environment Variables window. Under System variables select the Path variable and click Edit. This will open the Edit System Variable dialog window. Add ;C:\php to the value and click Ok, Ok, Ok.
Create a folder C:\Program Files (x86)\VisualSVN Server\htdocs\WebSVN and extract the contents of the file websvn-2.3.3.zip\websvn-2.3.3 to it (so leave out the folder inside the zipfile; extract the files that are in that folder).
Copy the file C:\Program Files (x86)\VisualSVN Server\htdocs\WebSVN\include\distconfig.php to C:\Program Files (x86)\VisualSVN Server\htdocs\WebSVN\include\config.php.
Open the file C:\Program Files (x86)\VisualSVN Server\htdocs\WebSVN\include\config.php and add the following lines to it:
$config->setSVNCommandPath('C:\\Program Files (x 86)\\VisualSVN Server\\bin'); $config->setDiffPath('C:\\cygwin64\bin'); $config->setEnscriptPath('C:\\cygwin64\bin'); $config->setSedPath('C:\\cygwin64\bin'); $config->setTarPath('C:\\cygwin64\bin'); $config->setGZipPath('C:\\cygwin64\bin'); $config->setZipPath('C:\\cygwin64\bin'); $config->parentPath('c:\\repositories');
From the Start Menu choose VisualSVN Server Manager. Right-click on Repositories and choose New > Repository. In the Repository Name field, enter Test. Click Next.
Choose Empty repository (recommended option) and click Next.
Choose Explicit Read / Write access for the current user ([SERVERNAME]\Administrator) and click Create.
Open Internet Explorer and navigate to https://localhost/websvn. Ignore the security certificate warning for now.
Click Continue to this website (not recommended). The WebSVN repository browser should come up.
The most difficult part of getting WebSVN running on top of VisualSVN was getting PHP to play nice with Apache. VisualSVN Server comes with Apache and Apache in VisualSVN Server isn’t necessarily the most recent Apache version around. The VisualSVN website advertises the Apache version used in the VisualSVN Server version you’re installing.
If the VisualSVN Server process cannot be started, check Windows Event Viewer. It will list the exact error Apache spits out.
An error stating that Apache can’t run ‘side-by-side’ tends to mean the .NET Framework isn’t (correctly) installed. This shouldn’t be a problem on an up-to-date machine.
An error stating that a module can’t be found does not necessarily mean the module (in most cases php5apache2_2.dll) can’t be found! While it might mean that it may also mean php5apache2_2.dll is not the correct version. Be very careful to download the correct php version for Apache used in VisualSVN server. The versions I used for this article work together but since I am not really from the future I can’t say for certain they are the latest versions when you are reading this.
Installing the Microsoft Visual C++ Redistributale is not necessary to troubleshoot the above errors, contrary to what most forums would like you to believe. It may not harm your server but I didn’t install it and VisualSVN Server and WebSVN run just fine.