== Windows Installation Instructions for Subversion w/Trac 0.7.1 == For: * Windows 2003 Server SP1 * IIS 6 (note: this page is heavily cribbed from TracOnWindows) Versions used in this example (Available 2004-11-01): * [http://httpd.apache.org/ Apache 2.0.52] * Python 2.3.4 * Subversion 1.1.1 * SQLite 3.0.8 * PySQLite 1.0-py2.3 * Trac 0.7.1 * docutils 0.3.5 * clearsilver 0.9.12 (included in Trac .exe installer) ''For Subversion issues on Windows see the [http://tortoisesvn.tigris.org TortoiseSVN] site, particularly the server section.'' Trac running on Microsoft's Internet Information Server (IIS) is _highly_ experimental. See #692 #693 and #697. Trac running without Apache or IIS: using [source:trunk/README.tracd#latest tracd] and svnserve is experimental (''tracd'') but the performance improvement is ''very'' significant over cgi. See TracOnWindowsSansApacheOrIis (TBD). ---- Note: This example installs to F: (for extra points, then goes DarkReign hard with a seperate application pool and so on.) ---- === Arm Yourself === 1. Get & Read book http://svnbook.red-bean.com === Install Subversion Pre-Requisites === 2. Install Python http://www.python.org [[br]]Add F:\Python23 to path Note that installing to a path that contains spaces is likely to break the install (iis6 doesn't seem to like cgi interpreters with spaces in their path). 3. Install IIS Control panel, Configure server roles... 4. Install Subversion http://subversion.tigris.org (remember to get the python bindings as well) 5. Install docutils http://docutils.sourceforge.net/ {{{ expand and run from the expanded docutils-xxx directory > D:\python23\python install.py }}} === Create Repository === 6. Create repository {{{ F:\> svnadmin create f:\tracsvn }}} 8. Create skeleton repository structure in f:\temp\project Example: {{{ /project /vendor /tags /trunk files /projectname /branches /tags /trunk files }}} 9. Build repository tree {{{ f:\> svn import f:\temp\project file:///f:/tracsvn/ -m "Initial Load" }}} 10. Create local sandbox {{{ f:\> svn checkout file:///f:/svn/repo1 f:\project }}} === Configure IIS === 11. Create the Service-Trac (local) user * Add Service-Trac to the IIS_WPG (local) group 12. Allow the Service-Trac user to run cgi scripts. * Grant Service-Trac the following permissions in the 'Local Security Policy' control panel: * Security Settings > Local Policies > User Rights Assignment > Adjust Memory Quotas for a process * Security Settings > Local Policies > User Rights Assignment > Replace a process level token * Together these permission allow the Service-Trac user to run cgi scripts. * Add Service-Trac to the IIS_WPG group (it's going to be the identity for an IIS Application pool. * See [http://www.microsoft.com/resources/documentation/iis/6/all/proddocs/en-us/ca_configcgi.mspx] for more information. 13. Add a Python CGI web service extension to IIS In the IIS control panel add a new web service extension. The required file is [F:\Python23\python.exe -u "%s" %s]. You will also need to enable this extension. 14. IIS virtual directories Add a virtual directory for /trac in the IIS control panel. It doesn't need execute permissions of any description as that will be taken care of by /trac/cgi-bin. Map this to [F:\Python23\share\trac\htdocs]. Add a cgi-bin vdir under /trac in the IIS control panel. It needs script execute permissions. Map this to [F:\Python23\share\trac\cgi-bin]. 15. IIS Application Pool Add a new application pool in the IIS control panel. Change the Identity of the new pool to Configurable and enter the details for the Service-Trac user you defined earlier. Change the Application settings of the /trac/cgi-bin vdir: click Configuration and select the Mappings tab. Add a new mapping. * Executable: [F:\Python23\python.exe -u "%s" %s] - note that this must be identical to the web service extension added earlier * Extension: [py] * Verbs: All verbs * Script Engine: checked * Verify that file exists: unchecked Change the Application Pool setting of the cgi-bin vdir to the pool you just created. 16. Fix up permissions Change the ownership of F:\tracsvn to Service-Trac. You may also need to change the ownership or grant write/modify on F:\Python23\Lib\site-packages\trac to Service-Trac (so it can write pyc files). Service-Trac will need read access to F:\Python23\share\trac === Install Trac Prerequisites === 17. Install Subversion Python Bindings (Get from same download page as Subversion) [[br]]Copy libsvn and svn directories to D:\Python23\Lib 18. Install SQLite http://www.sqlite.org [[br]]Copy sqlite.exe to D:\Program Files\SQLite This is really optional. Don't let it mess your disk unless something exceptional not described here happens. 19. Install PySQLite http://pysqlite.sourceforge.net 00. Install ClearSilver http://www.clearsilver.net NOT necessary if you use the Trac .exe installer - go back and download it ;) 20. Install Trac http://www.edgewall.com/products/trac/ {{{ python ./setup.py install }}} === Fix a few things === 23. Copy CGI {{{ D:\> copy d:\python23\share\trac\cgi-bin\trac.cgi d:\progra~1\apache~1\apache2\cgi-bin }}} === 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"}}} 25. Run trac-admin {{{ D:\Python23\Scripts> python trac-admin d:/svn/trac.db }}} 26. 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 }}} 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. 27. (BUG) Load Wiki {{{ Trac [d:/svn/trac.db]> wiki load d:/python23/share/trac/wiki-default }}} 28. 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 === 29. Edit httpd.conf: Add: (copy this - there's a typo in Edgewall's version) {{{ # TRAC Alias /trac "D:/Python23/share/trac/htdocs" SetEnv TRAC_ENV "d:/svn/trac.db" AuthType Basic AuthName "Project" AuthUserFile D:/svn/.htaccess Require valid-user Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all }}} 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 given above. {{{ #NT Domain auth config AuthType SSPI SSPIAuth On SSPIAuthoritative On SSPIOfferBasic On AuthName "Project" Require valid-user }}} 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. 30. Restart Apache 31. 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) [http://www.apache.org/dist/httpd/binaries/win32/#xpbug here]. === Finally... === 32. Install Subversion clients as necessary (try [http://rapidsvn.tigris.org RapidSVN] & [http://tortoisesvn.tigris.org/ TortoiseSVN]) 33. Don't forget to lock down the security on the box! 34. Now go get a *real* drink