== Windows Installation Instructions for Subversion w/Trac 0.8 == 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 (Subversion 1.1.3 also works -[mailto:bernd|at|vanskiver.com Bernd]) * SQLite 3.0.8 * PySQLite 1.0-py2.3 * Trac 0.8 * docutils 0.3.5 * clearsilver 0.9.12 (included in Trac .exe installer) Contact [mailto:Daragh|at|i2i-Tech.com Daragh Fitzpatrick] for more info. ''Added some information to help install Trac version 0.8.'' ''The docs should be OK. Contact [mailto:trac-svn-mail@elvendesigns.com Muir] for questions.'' ''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 D: (for extra points) ---- === Arm Yourself === 1. Get & Read book http://svnbook.red-bean.com === Install Subversion Pre-Requisites === 2. Install Python http://www.python.org [[br]]Add D:\Python23 to path 3. Install Apache http://httpd.apache.org 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 directory {{{ D:\> md d:\svn }}} 7. Create repository {{{ D:\> svnadmin create d:\svn\repo1 }}} 8. Create skeleton repository structure in d:\temp\project Example: {{{ /project /vendor /tags /trunk files /projectname /branches /tags /trunk files }}} 9. Build repository tree {{{ D:\> svn import d:\temp\project file:///d:/svn/repo1 -m "Initial Load" }}} 10. Create local sandbox {{{ D:\> svn checkout file:///d:/svn/repo1 d:\project }}} === Configure Apache === 11. 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 }}} 12. Create password file (w/user 'admin') {{{ D:\> d:\progra~1\apache~1\apache2\bin\htpasswd -cm d:\svn\.htaccess admin }}} 13. 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.1.3. Install Apache as Service (IF NOT WORKING when installed to D:) {{{ D:\Progr~1\Apache~1\Apache2\bin\Apache -k install -n "Apache2" }}} 13.3. Add location root for multiple repositories {{{ # Subversion 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 }}} 14. Restart your machine 15. Test your install of Subversion http://[hostname]:80/svn/repo1 Phew! Subversion is installed and working - Grab a beverage for yourself. ---- === Setup Users === 16. Add users to password file {{{ D:\> d:\progra~1\apache~1\apache2\bin\htpasswd -m d:\svn\.htaccess user }}} === 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 [[br]]Download svn-win32-1.0.5_py.zip, which contains required binaries. 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.org/ 00. Install ClearSilver http://www.clearsilver.net NOT necessary if you use the Trac .exe installer - go back and download it ;) But use the source version afterwards, since the .exe installer doesn't install trac/siteconfig correctly. [[br]]Copy neo_cgi.pyd into C:\Python23\Lib\ 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 # following line squishes bug #1168 if IE has troubles editing wiki pages. SSPIBasicPreferred 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 }}} You must download and install this module. It can be found here: http://tortoisesvn.tigris.org/mod_auth_sspi.zip Or compile it into Apache. Note when adding permissions and authenticating against a domain you may need to use the following syntax complete with quotes as seen in #1055. * permission add "DOMAIN\username" TRAC_ADMIN 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 00. If the svn page would not work properly with saying that DLL is missing, then copy the three DLL's - libdb42.dll - libeay32.dll - ssleay32.dll from your [Subversion]\bin directory to your system directory (most likely C:\Windows\system32). === In addition... === 35. In order to use pre- and post-commit hooks with Subversion on Windows, please refer to diff files described in #897, as the changes are not commited into the trunk as of version 0.8-dev. === Another (optional) thing... === 36. In order for Trac to display diffs, you must download and install diffutils. After installing diffutils, you will need to add the path to the diff executable to the Windows PATH environment variable and reboot the machine. Diffutils for windows: http://gnuwin32.sourceforge.net/packages/diffutils.htm