Edgewall Software

Version 35 (modified by josh_robb at fastmail.fm, 20 years ago) ( diff )

Update with info on running using IIS.

Windows Installation Instructions for Subversion w/Trac 0.6.1

Versions used in this example (Available 2004-05-13):

  • Apache 2.0.49
  • Python 2.3.3
  • Subversion 1.0.2
  • SQLite 2.8.13
  • PySQLite 0.5.0-py2.3
  • Trac 0.6.1
  • docutils 0.3.3

Contact Daragh Fitzpatrick for more info.

Added some information to help install Trac version 0.7.1. The docs should be OK. Contact Muir for questions. For Subversion issues on Windows see the TortoiseSVN site, particularly the server section.

Trac running on Microsoft's Internet Information Server (IIS) is _highly_ experimental. See #692 #693 and #697.


Note: This example installs to D: (for extra points)


Arm Yourself

  1. Get & Read book http://svnbook.red-bean.com

Install Subversion Pre-Requisites

  1. Install Python http://www.python.org
    Add D:\Python23 to path
  1. Install Apache http://httpd.apache.org
  1. Install Subversion http://subversion.tigris.org (remember to get the python bindings as well)
  1. Install docutils http://docutils.sourceforge.net/
      expand and run from the expanded docutils-xxx directory
      > D:\python23\python install.py
    

Create Repository

  1. Create repository directory
    D:\> md d:\svn
    
  1. Create repository
    D:\> svnadmin create d:\svn\repo1
    
  1. Create skeleton repository structure in d:\temp\project Example:
    /project
      /vendor
        /tags
        /trunk
          files
      /projectname
        /branches
        /tags
        /trunk
          files
    
  1. Build repository tree
    D:\> svn import d:\temp\project file:///d:/svn/repo1 -m "Initial Load"
    
  1. Create local sandbox
    D:\> svn checkout file:///d:/svn/repo1 d:\project
    

Configure Apache

  1. Copy files
    D:\> copy d:\progra~1\subver~1\httpd\*.* d:\progra~1\apache~1\apache2\modules
    

You may also need to manually transfer the DLL files from the Subversion installation directory. If the Apache service will not start, or reports an error loading mod_dav_svn.so, you will need to do this. They contain, among other things, the Berkeley DB. This is all you need to do for the DLLs:

D:\> copy d:\progra~1\subver~1\bin\*.dll d:\progra~1\apache~1\apache2\modules
  1. Create password file (w/user 'admin')
    D:\> d:\progra~1\apache~1\apache2\bin\htpasswd -cm d:\svn\.htaccess admin
    
  1. Configure Apache (edit httpd.conf) 13.1. Restrict access/lockdown as appropriate

13.2. Add Modules to httpd.conf

13.1.1. Uncomment:

LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so

13.1.2. Add (after):

# Subversion
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

13.3. Add location root for multiple repositories

# Subversion
<Location /svn>
  DAV svn
  # any /svn/foo URL will map to a repository D:/svn/foo
  # I've only got it working using SVNPath!!
  SVNParentPath D:/svn
  AuthType Basic
  AuthName "Subversion repository"
  AuthUserFile d:/svn/.htaccess
  Require valid-user
</Location>
  1. Restart your machine
  1. Test your install of Subversion http://[hostname]:80/svn/repo1

Phew! Subversion is installed and working - Grab a beverage for yourself.


Setup Users

  1. Add users to password file
    D:\> d:\progra~1\apache~1\apache2\bin\htpasswd -m d:\svn\.htaccess user
    

Install Trac Prerequisites

  1. Install Subversion Python Bindings (Get from same download page as Subversion)
    Copy libsvn and svn directories to D:\Python23\Lib
  1. Install SQLite http://www.sqlite.org
    Copy sqlite.exe to D:\Program Files\SQLite
  1. Install PySQLite http://pysqlite.sourceforge.net
  1. Install Trac http://www.edgewall.com/products/trac/

BUG As of 20040612, Trac-win32 version 0.7.1 DOES NOT include a file called siteconfig.py, which is required for the scripts to work. There are two workarounds: 1) Install 0.7 first and then install 0.7.1 on top of it or 2) Create c:\python23\lib\site-packages\trac\siteconfig.py (or wherever your installation is) yourself:

# siteconfig.py
__default_templates_dir__ = r'c:\Python23\share\trac\templates'
__default_htdocs_dir__ = r'c:\Python23\share\trac\htdocs'
__default_wiki_dir__ = r'c:\Python23\share\trac\wiki-default'

Remember to correct the paths in that file! Under no circumstances should you actually *run* 0.7. This will hopefully be fixed in the next version. You will be able to change those directories later (which I'd recommend).

Fix a few things

  1. BUG Edit first line of D:\Python23\Scripts\trac-admin to have:
    #!D:\Python23\python.exe
    
  1. BUG Edit first line of D:\Python23\share\trac\cgi-bin\trac.cgi to have:
    #!D:\Python23\python.exe
    
  1. Copy CGI
    D:\> copy d:\python23\share\trac\cgi-bin\trac.cgi d:\progra~1\apache~1\apache2\cgi-bin
    
  1. BUG not able to run trac-admin initenv… Not available in 0.6.1 (This does work in 0.7.1)

Configure Trac DB

The trac database can be named to match the subversion repository it is working with, which is especially useful if more than one repository will ever be created. In this example "trac.db" would read as "repo1.db"

  1. Run trac-admin
    D:\Python23\Scripts> python trac-admin d:/svn/trac.db
    
  1. Initialize DB
    Trac [d:/svn/trac.db]> initdb
    

or

Trac [d:/svn/trac.db]> initenv
  Enter project name
    Project
  Enter path to repository
    d:\svn\repo1
  Enter path to templates
    d:\Python23\share\trac\templates

BUG Note error message regarding wiki-pages (not present in my version of 0.7.1)

If you get an error here stating that libdb42.dll was not found, copy [SVN PATH]\bin\libdb42.dll to [PYTHON PATH]\lib\libsvn\, then try again.

  1. BUG Load Wiki
    Trac [d:/svn/trac.db]> wiki load d:/python23/share/trac/wiki-default
    
  1. Add administrative permissions (the below adds all permissions for 'admin' user)
    Trac [d:/svn/trac.db]>
    
    permission add admin TRAC_ADMIN
    

Add Trac to Apache

  1. Edit httpd.conf: Add: (copy this - there's a typo in Edgewall's version)
    # TRAC
    Alias /trac "D:/Python23/share/trac/htdocs"
    <Directory "D:/Python23/share/trac/htdocs">
      Options Indexes MultiViews
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>
    
    <Location "/cgi-bin/trac.cgi">
      # For 0.7 release
      SetEnv TRAC_ENV "d:/svn/trac.db"
      # for 0.6.1 release
      SetEnv TRAC_DB "d:/svn/trac.db"
    </Location>
    
    <Location "/cgi-bin/trac.cgi/login">
      AuthType Basic
      AuthName "Project"
      AuthUserFile D:/svn/.htaccess
      Require valid-user
    </Location>
    

Alternatively you could set up the authorisation to use your NT domain login if you are running an NT Domain. This bit of Apache config replaces the <Location "/cgi-bin/trac.cgi/login"> given above.

<Location "/cgi-bin/trac.cgi/login">
  #NT Domain auth config
  AuthType SSPI
  SSPIAuth On
  SSPIAuthoritative On
  SSPIOfferBasic On 
  AuthName "Project"
  Require valid-user
</Location>

You'll also need the sspi_auth_module on your system and loaded like this…

LoadModule sspi_auth_module modules/mod_auth_sspi.so

Or compile it into Apache.

  1. Restart Apache
  1. Hold your breath, test Trac install http://[hostname]:80/cgi-bin/trac.cgi

If it doesn't work, then running Apache from the command-line will give you a few clues.

If your page seems to be lacking stylesheets, you've probably run into a known Apache bug described (and worked around) here.

Finally…

  1. Install Subversion clients as necessary (try RapidSVN & TortoiseSVN)
  1. Don't forget to lock down the security on the box!
  1. Now go get a *real* drink

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.