Go Back to Main Page

How To: Install Subversion with Trac on Windows

Version 1.7

Created: 02-12-2007

Modified: 05-16-2007

============================================================

You will need the following files, download them before starting:
Subversion Files
svn-1.4.0-setup.exe
Home: http://subversion.tigris.org/
Download: http://subversion.tigris.org/files/documents/15/34093/svn-1.4.0-setup.exe
tortoiseSVN-1.40.7501-win32-svn-1.4.0.msi
Home: http://tortoisesvn.tigris.org/
Download:http://downloads.sourceforge.net/tortoisesvn/TortoiseSVN-1.4.0.7501-win32-svn-1.4.0.msi?modtime=1158418822&big_mirror=0

Apache Files
Use apache 2.0.59-win32-x86-no_ssl.msi
Home: http://www.apache.org/
Download: http://www.axint.net/apache/httpd/binaries/win32/apache_2.0.59-win32-x86-no_ssl.msi

Trac Files
Trac
Home: http://trac.edgewall.org/
Download: http://ftp.edgewall.com/pub/trac/trac-0.10.3.win32.exe
Clearsilver
Home: http://www.clearsilver.net/
Download:http://www.clearsilver.net/downloads/win32/clearsilver-0.9.14.win32-py2.3.exe
Python use version 2.3
Home: http://www.python.org/
Download: http://www.python.org/ftp/python/2.3.5/Python-2.3.5.exe
svn-python-1.4.0-py23.exe (note this svn must match your subversion version and python version)
Home: http://subversion.tigris.org/
Download: http://subversion.tigris.org/downloads/svn-python-1.4.0-py2.3.exe
pysqlite-1.1.8.win32-py2.3.exe (note this pysqlite connector needs to be the same version as the installed python)
Home: http://www.initd.org/tracker/pysqlite/wiki/pysqlite
Download: http://initd.org/pub/software/pysqlite/releases/1.1/1.1.8/pysqlite-1.1.8.win32-py2.3.exe
mod_python (if you don't want to use CGI)
Home: http://www.modpython.org/
Download: http://www.apache.org/dist/httpd/modpython/win/3.2.10/mod_python-3.2.10.win32-py2.3-apache2.0.exe
setuptools-0.6c5.win32-py2.3.exe (for the web admin)
Home: http://peak.telecommunity.com/DevCenter/setuptools
Download: http://cheeseshop.python.org/packages/2.3/s/setuptools/setuptools-0.6c5.win32-py2.3.exe#md5=c63116466c40fd38921c9e73a071461c
tracwebadmin-0.1.2dev_r4240-py2.3.egg.zip (for the web admin)
Home: http://trac.edgewall.org/wiki/WebAdmin
Download: http://trac.edgewall.org/attachment/wiki/WebAdmin/TracWebAdmin-0.1.2dev_r4240-py2.3.egg.zip?format=raw

I have only tested this guide with the above files. If you deviate and try to use different versions the end result will probably be different from mine. Because the bindings have to be the same versions I decided to stick with Python23. There seemed to be more support for Python23, and when I was doing the research for this a few months back, I could not find all the bindings I needed for Python 2.4.

This guide assumes that you install subversion and apache to their default locations on the c:\. It also assumes that the database for trac and subversion are placed in a folder called c:\tracsvn\svnrepos if you don't want to place the the database on c:\ or if you change the folder names make sure that you use your path and folder names in the commands!

The guide has two methods for the web server CGI and mod_python. I prefer to use mod_python as its faster.

What this guide does not cover:
Installing SSL
Integration with Active Directory


Install Steps:

Download the necessary files (see the list above, don't start until this is done)

1. Install and Configure Subversion.

a. Run the Subversion installer! Start svn-1.4.0-setup.exe installer. Follow the install wizard and enter the appropriate information.

b. After the installer is finished make sure you have the Environment Variables set for SVN_EDITOR: c. Create a repository you must specify fsfs as the db type. d. Create a windows service for the repository, and start the service. e. Reboot the server. Don't Skip

f. Configure Access g. Create a new Subversion project in the tracsvn\svnrepos repository, and create the projects structure, by running the below from a command line. Give your project a name I used myproject you can use whatever you want
        svn mkdir svn://localhost/myproject
        svn mkdir svn://localhost/myproject/branches
        svn mkdir svn://localhost/myproject/tags
        svn mkdir svn://localhost/myproject/trunk
h. Install Tortoise for each user that will have commit rights or rw access. Users that have r access will only be able read and cannot make commits.

2. Install and Configure Apache

a. Run the apache installer, apache 2.0.59-win32-x86-no_ssl.msi. Follow the install wizard and enter the appropriate information.

b. Copy the subversion modules and the dll's to the apache modules directory: c. Create a password hash: d. Configure the httpd.conf file. e. Install apache as a service - from the bin folder run: (You may not have to do this, check windows services before running the command. If apache is listed as a service skip this step.)
        Apache -k install -n "Apache2"
f. Add Subversion to apache in the httpd.conf (Skip this step if you plan on installing Trac.) g. Delete the c:\tracsvn\svnrepos\conf\svnconf.conf file.

h. Restart the Apache Services.

3. Install and configure Python23 and Python Modules

a. Run the Python-2.3.5.exe file

b. Add Python to the Path c. Add Python\Scripts to the Path d. Reboot the Server Don't Skip this Step

e. Install svn-python f. Install pysqlite g. Install clearsilver h. Install mod_python: (Only if you plan on using mod_python)

4. Install and configure Trac

a. Run the trac-0.10.3.win32.exe installer

b. Copy the CGI script (If you plan to use mod_python skip this step) c. Configure the tracdb d. From the trac prompt type:
        initenv
e. Enter the Project name
        MyTracSite
f. For the database connection string, press enter to accept sqlite.

g. On the Add Repository Prompt press enter to accept the default "svn"

h. Path to repository will be:
        c:\tracsvn\svnrepos
i. path to templates is c:\python23\share\trac\templates press enter to accept the default.

j. Add admin to Trac k. Type "exit" to leave the trac-admin tool.

l. Configure TRAC with Apache - using CGI - (If you plan to use mod_python skip this step) m. Configure Apache for TRAC using - mod_python - n. Install webadmin o. Configure the authz file in the trac.ini

5.Backup the database

Use the hotcopy command, while using a normal backup tool on an FSFS database is possible its not recommended see http://svn.collab.net/repos/svn/trunk/notes/fsfs for more information.

The following is a backup script batch file from: http://justinram.wordpress.com/2006/05/03/subversion-server-windows-backup/

a. Create a bat file with the following data:
    REM Reset HotCopy directory
    rmdir /S Q c:\dbBack
    mkdir c:\dbBack
    
    REM Backup The Subversion db using hotcopy
    svnadmin hotcopy c:/tracsvn/svnrepos c:\dbBack --clean-logs
b. create a scheduled task pointing to the backup script. You could then use a backup tool like NT backup to backup the c:\dbBack directory!

Change log:

+++++++++++++++++++++++++++++++++

2-12-2007:

Created

2-19-2007:

Added the change log section
Added section 5. (Backing up the DB)

3-19-2007

Changed some minor layout issues in section 3.
Fixed some spelling errors.
Added The words How To and Windows: to the title of the article.

5-16-2007

Changed some of the notes before section 1.
Fixed some of the paths had e:\ and they should have been c:\

Credits

Some of the information in this guide comes from the sources below:
Joe White's Blog
http://excastle.com/blog/archive/2005/05/31/048.aspx
Trac's Install Document for Windows
http://trac.edgewall.org/wiki/TracOnWindows
fsfs information
http://svn.collab.net/repos/svn/trunk/notes/fsfs
Backup scripts
http://www.blendedtechnologies.com/daily-backupof-subversion/21
http://justinram.wordpress.com/2006/05/03/subversion-server-windows-backup/
svn.haxx.se
http://svn.haxx.se/users/archive-2006-06/0288.shtml