The current release of Subversion does not seem to work with Apache 2.2 so please make sure to use Apache 2.0 and not Apache 2.2.
PHP is only needed if you wish to use the enhanced interface provided by WebSVN and SVNManager. MySQL is only needed if you wish to use SVNManager.
The latest versions of the Apache HTTP 2.0 Server (Apache 2.0.59 at the time of this writing), Subversion (Subversion 1.3.2-r19776 at the time of this writing), PHP (PHP 5.1.6 at the time of this writing), MySQL (MySQL 5.0.24 Community Edition at the time of this writing) and SVNManager (SVNManager 0.38 at the time of this writing) can be downloaded from the following websites:
When downloading MySQL, download the Windows Essentials package since it is packaged as a Windows Installer database for easier installation and it contains all that is needed to get SVNManager to work.
(Back to Table of Contents)
The Win32 binaries of Subversion can be installed via an MSI package. In Windows explorer either navigate to the folder where you downloaded the MSI package and double-click on it or open a command prompt and run the package (it is packaged as a .exe file) e.g. C:\>C:\downloads\svn-1.3.2-setup.exe. To help simplify things, it is suggested that it be installed into a directory with no spaces e.g. D:\SVN.
(Back to Table of Contents)
To initialize the repository, first create the directory where the repository will be, then use the svnadmin.exe create command to actually initialize it. Again, to help simplify things, it is suggested that a path name with no spaces be used for the repository. For example:
C:\>mkdir D:\svn-repos
C:\>mkdir D:\svn-repos\repos1
C:\>D:\SVN\bin\svnadmin.exe create D:\svn-repos\repos1
C:\>_
(Back to Table of Contents)
The Win32 binaries of Apache are distributed via an MSI package. Either use Windows Explorer to navigate to the folder where you downloaded the MSI package and double-click on it or open a command prompt and run the package via msiexec.exe For example:
C:\>msiexec.exe /I C:\downloads\apache_2.0.59-win32-x86-no_ssl.msi
C:\>_
Assuming that the Windows machine you are installing on does not have another web server (e.g. IIS) already installed, then install Apache using the "for All Users, on Port 80, as a Service -- Recommended." option. Otherwise, Apache will default to port 8080 and will have to be started manually.
To test if Apache was correctly installed and running, open a web browser on the machine Apache was installed on and attempt to navigate to http://localhost/ (do not forget to specify the port number if anything other than the default port 80 was used i.e. if Apache was setup to use port 8080 then use http://localhost:8080/). The Apache test page should show up. If not, try looking at the documentation or the FAQ on The Apache HTTP Server Project site to help you troubleshoot.
Note that if the option to install Apache on port 8080 (useful so that it can be installed side-by-side with IIS) is selected, Apache will not be installed as a service by default and needs to be installed and started manually. If Apache was installed in that manner but you wish to have it run as a service, open a command prompt and run the following command:
C:\>"C:\Program Files\Apache Group\Apache2\Apache.exe" -n "Apache2" -k install
C:\>"C:\Program Files\Apache Group\Apache2\Apache.exe" -k start
C:\>_
(Back to Table of Contents)
To integrate Subversion into Apache, several binary modules need to be installed into Apache. This is accomplished by copying the files mod_authz_svn.so and mod_dav_svn.so from the Subversion distribution into the modules directory of Apache. The BerkeleyDB library libdb43.dll will also need to be copied into the bin directory of Apache. For example:
C:\>copy D:\SVN\bin\*.so "C:\Program Files\Apache Group\Apache2\modules" /v
D:\SVN\bin\mod_authz_svn.so
D:\SVN\bin\mod_dav_svn.so
2 file(s) copied.
C:\>copy D:\SVN\bin\libdb43.dll "C:\Program Files\Apache Group\Apache2\bin" /v
C:\>_
Once the files are in the correct places, Apache's configuration file needs to be modified. Open Apache's httpd.conf file using a text editor such as notepad as follows:
C:\>notepad.exe "C:\Program Files\Apache Group\Apache2\conf\httpd.conf"
C:\>_
Search for the section that is titled "# Dynamic Shared Object (DSO) Support" and add the following lines to the end of that section:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
In that same section, uncomment the following existing line for dav_module:
LoadModule dav_module modules/mod_dav.so
Then, scroll to the bottom of the file and add the following lines:
<Location /svn-repos>
DAV svn
SVNParentPath D:\svn-repos
</Location>
Finally, re-start the Apache service with the following command:
C:\>"C:\Program Files\Apache Group\Apache2\bin\Apache.exe" -k restart
If all went well, you should be able to open a web browser on the machine and view the repository via the following URL: http://localhost/svn-repos/repos1/ (Include the port number in the URL if necessary).
(Back to Table of Contents)
Setting up basic password authentication with Apache requires creation of a password file, then telling Apache to use the password file to control access.
First, create the password file with the htpasswd.exe utility that comes with Apache as follows (in the following example, the username is qauser):
C:\>mkdir D:\svn-repos\conf
C:\>"C:\Program Files\Apache Group\Apache2\bin\htpasswd.exe" -c -m D:\svn-repos\conf\htpasswd qauser
New password: ******
Re-type new password: ******
Ading password for user qauser
C:\>_
Adding users to an existing password file is done using the same command, but without the -c flag. For example:
C:\>"C:\Program Files\Apache Group\Apache2\bin\htpasswd.exe" -m D:\svn-repos\conf\htpasswd qauser2
New password: *******
Re-type new password: *******
Adding password for user qauser2
C:\>_
Once a password file has been created, Apache needs to be configured to use the password file to control access. Once again, bring up the httpd.conf file in a text editor and modify the Location directive as follows:
<Location /svn-repos>
DAV svn
SVNParentPath D:\svn-repos
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile D:\svn-repos\conf\htpasswd
Require valid-user
</Location>
Note that this will force Apache to require a password for all operations. If anonymous read-only access is desired, the Location directive should be modified as follows:
<Location /svn-repos>
DAV svn
SVNParentPath D:\svn-repos
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile D:\svn-repos\conf\htpasswd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
Apache can also be configured to use per-directory access control. This is done using the authz_svn_module of Apache, which has already been loaded. To activate per-directory access, create an authorization file inside the conf directory of the repository (named, for example, htauthz) and put the following text in it:
[groups]
qausers=qauser,qauser2
[/]
* = r
[repos1:/]
@qausers=rw
This configuration will allow anonymous read-access to all repositories while allowing anyone in the qausers group read-write access to the repository repos1.
Apache's httpd.conf file will also need to be modified as follows (note the removal of the LimitExcept section since anonymous read-only access will now be controlled via the access file):
<Location /svn-repos>
DAV svn
SVNParentPath D:\svn-repos
Satisfy Any
Require valid-user
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile D:\svn-repos\conf\htpasswd
AuthzSVNAccessFile D:\svn-repos\conf\htauthz
</Location>
Note that anytime httpd.conf is modified the Apache service needs to be restarted for the changes to take effect.
(Back to Table of Contents)
PHP is only needed if you want to use the enhanced interface of WebSVN or SVNManager.
The Windows release of PHP comes as a zip file e.g. php-5.1.6-Win32.zip. Using either the built-in Extraction Wizard (Windows XP and later) or a third-party tool such as 7-Zip, extract the contents of the zip file into a directory on the local hard drive (e.g. C:\PHP\). Whatever path you choose for the PHP installation (preferably one without spaces in the path), add it to the PATH environment variable.
Create a php.ini file based off of the php.ini-recommended file that comes with the PHP distribution. This can be done as follows:
C:\>copy C:\PHP\php.ini-recommended C:\PHP\php.ini /v
1 file(s) copied.
C:\>_
To add the PHP module to Apache, open Apache's httpd.conf file in a text editor and make the following modifications:
Locate the section titled "# Dynamic Shared Object (DSO) Support" and add the following lines to the end of that section:
LoadModule php5_module C:/PHP/php5apache2.dll
Then, to let Apache know that files with extensions .php and .html should be processed by PHP, search for the AddType section and add the following line at the end of the section:
AddType application/x-httpd-php .php .html
Then, at the end of the file, add the following line to tell Apache where php.ini can be found:
PHPIniDir "C:/PHP/"
Lastly, to have Apache automatically serve up index.php when a directory is accessed, modify the following line:
DirectoryIndex index.html index.html.var index.php
Once these changes have been made, restart the Apache server.
To test if PHP was correctly configured, create a phpinfo.php file inside Apache's htdocs directory and put the following text in it:
<?php
phpinfo();
?>
Then, open a browser window and try navigating to http://localhost/phpinfo.php (do not forget to add the port number if necessary) and if PHP was correctly configured, you should get a page giving a lot of information on the PHP configuration.
To activate PHP's SVN bindings, the php_svn.dll extension needs to be installed in PHP. For Windows, this is part of the additional PECL modules download (currently this is pecl-5.1.6-Win32.zip) which is also available on the PHP website alongside the main PHP binaries. From the distribution .zip file, extract php_svn.dll and drop it into the PHP extensions directory (e.g. C:\PHP\ext). Then, modify your php.ini file as follows:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
extension_dir = "C:/PHP/ext"
.
.
.
;extension=php_xsl.dll
extension=php_svn.dll
Once this is done, restart the Apache service and bring up the phpinfo.php page in a web browser. A section titled svn should now be present in the generated page.
To be able to use SVNManager, the PHP PEAR module VersionControl_SVN needs to be installed. To do this, first activate PEAR as follows:
C:\>cd PHP
C:\PHP>go-pear.bat
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :
Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type 'all' to change all of them or simply press Enter to
accept these locations.
1. Installation base ($prefix) : C:\PHP
2. Binaries directory : C:\PHP
3. PHP code directory ($php_dir) : C:\PHP\pear
4. Documentation directory : C:\PHP\pear\docs
5. Data directory : C:\PHP\pear\data
6. Tests directory : C:\PHP\pear\tests
7. Name of configuration file : C:\WINDOWS\pear.ini
8. Path to CLI php.exe : C:\PHP\.
1-8, 'all' or Enter to continue:
Beginning install...
Configuration written to C:\WINDOWS\pear.ini...
Initialized registry...
Preparing to instal...
.
.
.
Would you like to alter php.ini <C:\PHP\php.ini>? [Y/n] : Y
php.ini <C:\PHP\php.ini> include_path updated.
Current include path : .;C:\php5\pear
Configured directory : C:\PHP\pear
Currently used php.ini (guess) : C:\PHP\php.ini
Press Enter to continue:
** WARNING! Backed up old pear to C:\PHP\pear.bat_old
The 'pear' command is now at your service at c:\php\pear.bat
.
.
.
Press any key to continue . . .
C:\PHP>
In Windows Explorer, navigate to C:\PHP and double-click on the generated PEAR_ENV.reg file to create environment variables for the current user.
Once PEAR has been properly installed and configured, install the VersionControl_SVN module via the following command-line:
C:\PHP>pear.bat install --alldeps VersionControl_SVN-alpha
downloading VersionControl_SVN-0.3.0alpha1.tgz ...
Starting to download VersionControl_SVN-0.3.0alpha1.tgz (33,829 bytes)
......done: 33,829 bytes
downloading XML_Parser-1.2.7.tgz...
Starting to download XML_Parser-1.2.7.tgz (12,939 bytes)
...done: 12,939 bytes
install ok: channel://pear.php.net/XML_Parser-1.2.7
install ok: channel://pear.php.net/VersionControl_SVN-0.3.0alpha1
C:\PHP>_
(Back to Table of Contents)
Using Subversion, check out the latest stable version (1.62 at the time of this writing) of WebSVN from the public repository as follows (username is 'guest', password is blank):
C:\>mkdir C:\downloads\websvn
C:\>cd C:\downloads\websvn
C:\downloads\websvn>svn.exe co http://websvn.tigris.org/svn/websvn/tags/1.62/
Authentication realm: <http://websvn.tigris.org:80> Collabnet Subversion Repository
Password for 'Administrator':
Authentication realm: <http://websvn.tigris.org:80> Collabnet Subversion Repository
Username: guest
Password for 'guest':
A 1.62\licence.txt
A 1.62\include
A 1.62\include\distconfig.inc
A 1.62\include\svnlook.inc
A 1.62\include\configclass.inc
.
.
.
A 1.62\blame.php
A 1.62\log.php
A 1.62\filedetails.php
A 1.62\templates.txt
U 1.62
Checked out revision 476.
C:\downloads\websvn>_
Create a D:\websvn directory (or wherever you may wish to run WebSVN from) and copy the WebSVN files to that directory. For example:
C:\downloads\websvn>cd 1.62
C:\downloads\websvn\1.62>mkdir D:\websvn
C:\downloads\websvn\1.62>xcopy.exe *.* D:\websvn /s /v
C:blame.php
C:changes.txt
C:comp.php
C:diff.php
C:dl.php
.
.
.
C:templates\Zinn\footer.tmpl
C:templates\Zinn\header.tmpl
C:templates\Zinn\index.tmpl
C:templates\Zinn\log.tmpl
C:templates\Zinn\styles.css
85 File(s) copied
C:\downloads\websvn\1.62>_
Next, in the include subdirectory of the WebSVN files, copy the distconfig.inc to the file config.inc and edit it using a text editor. For example:
C:\downloads\websvn\1.62>D:
D:\>cd D:\websvn\include
D:\websvn\include>copy distconfig.inc config.inc /v
1 file(s) copied.
D:\websvn\include>notepad.exe config.inc
D:\websvn\include>
Uncomment the following line since we are running on Windows:
// $config->setServerIsWindows();
$config->setServerIsWindows();
Then, configure the repositories as in the following example:
// $config->parentPath("Path/to/parent (e.g. c:\\svn)");
$config->parentPath("D:/svn-repos");
Next, edit Apache's httpd.conf and add the following line to alias requests:
Alias /websvn/ "D:/websvn/"
Finally, restart Apache.
Once this is all properly configured, it should be possible to access the Subversion repository through the following URL: http://localhost/websvn/ (add the port number if necessary).
(Back to Table of Contents)
MySQL is only required if you wish to use the enhanced administration interface provided by SVNManager.
Launch the MySQL installer and select "Complete" when you get to the page where you have to choose the "Setup Type". At the end of the install, you will be asked if you wish to start the configuration wizard (there will be a check box captioned, "Configure the MySQL Server now", leave it checked to run the wizard). It is recommend that the wizard be run so that a custom configuration file can be generated.
When running through the configuration wizard, select "Detailed Configuration" when you are asked to choose a configuration type. In the next screen, you will be asked to select a server type. Select "Server Machine" and then move on to the next screen. You will be asked to select the database usage at this point. Select "Multifunctional Database" unless you have a specific reason to choose one of the other options.
The next screen in the wizard will allow you to select the drive and path where the InnoDB storage engine will store its files. You can go with the defaults or modify it as necessary. Once you have made your selection, move on to the next screen. At this point, you will be asked to determine the number of concurrent connections to the MySQL server. Make a selection and then continue.
The next page lists the networking options. Unless you know exactly what you are doing, accept the defaults and continue to the next screen. The next screen allows you to select the default character set for the MySQL database. Make a selection, then continue. You will now be asked to set Windows options. Installation as a service is recommended and so is adding the path to the MySQL binaries to the Windows PATH so make sure both checkboxes are checked, then continue.
In the next configuration screen, you will be asked to enter a root password for the database as well as whether to Enable Root Access From Remote Machines and whether or not to Create An Anonymous Account. Enter a root password and leave the other boxes unchecked unless you know exactly what you are doing. Then, go to the next page and hit 'Execute' to start the process of generating the configuration file and starting the MySQL service. When the wizard is done, hit 'Finish' to close the wizard.
Once MySQL is up and running, a username and password as well as a database needs to be created for use by SVNManager. To create a user, run the mysql program as root using the following command line:
C:\>mysql.exe --user=root mysql
mysql>_
Then, create a user using the following command:
mysql>CREATE USER svnmanager IDENTIFIED BY 'svnmanager';
Query OK, 0 rows affected (0.00 sec)
mysql>_
Next, create a database as follows:
mysql>CREATE DATABASE svnManagerDB;
Query OK, 1 row affected (0.01 sec)
mysql>_
Then, give the user you just created full privileges on the new database as follows:
mysql>GRANT ALL PRIVILEGES ON svnManagerDB.* TO 'svnmanager'@'localhost' IDENTIFIED BY 'svnmanager';
Query OK, 0 rows affected (0.00 sec)
mysql>_
PHP 5 does not have MySQL support built-in but instead has the support contained in an extension module. To activate MySQL support in PHP 5, modify php.ini as follows:
;extension=php_mysql.dll
extension=php_mysql.dll
Next, copy the file libmysql.dll from the PHP distribution into Apache's bin directory as follows:
C:\>copy C:\PHP\libmysql.dll "C:\Program Files\Apache Group\Apache2\bin" /v
1 file(s) copied.
C:\>_
Then, shut down and re-start Apache and bring up the phpinfo.php file in a browser window. A section on mysql configuration should now be present in the generated page.
(Back to Table of Contents)
Note that using SVNManager will overwrite any existing configured users, groups and access control settings. Also, to pull in any existing repositories into SVNManager, the repository will need to be manually dumped out and subsequently imported using the SVNManager interface.
Extract the contents of the SVNManager distribution (e.g. svnmanager-0.38.zip) to a directory on the local machine (e.g. D:\SVNManager).
Next, modify Apache's httpd.conf file to specify the location of SVNManager's files as follows:
Alias /svnmanager/ "D:/svnmanager/"
Next, create the required MySQL tables using the createtables.sql script that comes with the distribution using the following command:
C:\>mysql.exe --user=root --password --database=svnManagerDB < D:\SVNManager\createtables.sql
Enter password: *******
C:\>_
Next, configure SVNManager by first, copying the file config.php.win to config.php, then editing it in a text editor. For example:
C:\>copy D:\SVNManager\config.php.win D:\SVNManager\config.php /v
Overwrite D:\SVNManager\config.php? (Yes/No/All): Y
1 file(s) copied.
C:\>notepad.exe D:\SVNManager\config.php
C:\>_
Modify the config.php file as follows:
$htpassword_cmd = "c:\\Progra~1\\Apache~1\\Apache2\\bin\\htpasswd";
$svn_cmd = "c:\\PROGRA~1\\Subversion\\bin\\svn";
$svn_cmd = "D:\\SVN\\bin\\svn";
$svnadmin_cmd = "c:\\PROGRA~1\\Subversion\\bin\\svnadmin";
$svnadmin_cmd = "D:\\SVN\\bin\\svnadmin";
.
.
.
$svn_repos_loc = "c:\\svn";
$svn_repos_loc = "D:\\svn-repos";
$svn_passwd_file = "c:\\svn\\svn_passwd_file";
$svn_passwd_file = "D:\\svn-repos\\conf\htpasswd";
$svn_access_file = "c:\\svn\\svn_access_file";
$svn_access_file = "D:\\svn-repos\\conf\\htauthz";
.
.
.
$smtp_server = "smtp.domain.org";
$smtp_server = "mail.borland.com";
.
.
.
$dsn = "mysqli://username:password@hostname/databasename";
$dsn = "mysql://svnmanager:svnmanager@localhost/svnManagerDB";
Finally, restart Apache so that any changes made to httpd.conf take effect.
If all went well, it should now be possible to access the SVNManager interface via the URL http://localhost/svnmanager/ (include the port number if necessary).
(Back to Table of Contents)
(Back to Table of Contents)
(Back to Table of Contents)
(This document last updated 2006-08-29, 22:12)