| 1 | = Tracd = |
| 2 | |
| 3 | Tracd is a lightweight stand-alone Trac server. In most cases it's easier to setup and runs faster than trac.cgi. |
| 4 | |
| 5 | |
| 6 | == Pros == |
| 7 | |
| 8 | * Fewer dependencies: You don't need to install apache or any other web-server. |
| 9 | * Fast: Should be as fast as the TracModPython version (much faster than the cgi). |
| 10 | |
| 11 | == Cons == |
| 12 | |
| 13 | * Less features: Tracd implements a very simple web-server and is not as configurable as apache. |
| 14 | * Only htdigest authentication: Tracd can currently only authenticate users against apache-htdigest files. |
| 15 | * No native https support: [http://www.rickk.com/sslwrap/ sslwrap] can be used instead, |
| 16 | or [http://lists.edgewall.com/archive/trac/2005-August/004381.html STUNNEL]. |
| 17 | |
| 18 | == Usage examples == |
| 19 | |
| 20 | A single project on port 8080. (http://localhost:8080/) |
| 21 | {{{ |
| 22 | $ tracd -p 8080 /path/to/project |
| 23 | }}} |
| 24 | With more than one project. (http://localhost:8080/project1/ and http://localhost:8080/project2/) |
| 25 | {{{ |
| 26 | $ tracd -p 8080 /path/to/project1 /path/to/project2 |
| 27 | }}} |
| 28 | With htdigest authentication. The file /tmp/users.htdigest contain user accounts for project1 with the realm "mycompany.com". |
| 29 | {{{ |
| 30 | $ tracd -p 8080 --auth project1,/tmp/users.htdigest,mycompany.com /path/to/project1 |
| 31 | }}} |
| 32 | htdigest authentication can also be used for more than one project. |
| 33 | The digest file can be shared: |
| 34 | {{{ |
| 35 | $ tracd -p 8080 |
| 36 | --auth project1,/tmp/users.htdigest,mycompany.com |
| 37 | --auth project2,/tmp/users.htdigest,mycompany.com |
| 38 | /path/to/project1 /path/to/project2 |
| 39 | }}} |
| 40 | |
| 41 | == Tracd on Windows == |
| 42 | |
| 43 | tracd also works on Windows. |
| 44 | But on that platform, the sensitivity on multithreading issues is high, |
| 45 | and you ''might'' have problems (i.e. crashes of the Python interpreter). |
| 46 | If this happens, you can force tracd to operate in single-threaded mode: |
| 47 | {{{ |
| 48 | #!text/x-diff |
| 49 | Index: trac/web/standalone.py |
| 50 | =================================================================== |
| 51 | --- trac/web/standalone.py (revision 1862) |
| 52 | +++ trac/web/standalone.py (working copy) |
| 53 | @@ -124,7 +124,7 @@ |
| 54 | return auth['username'] |
| 55 | |
| 56 | |
| 57 | -class TracHTTPServer(ThreadingMixIn, HTTPServer): |
| 58 | +class TracHTTPServer(HTTPServer): |
| 59 | |
| 60 | projects = None |
| 61 | }}} |
| 62 | |
| 63 | Please also report any such issue, as they are believed to be fixed by now. |
| 64 | |
| 65 | |
| 66 | == Generating passwords on Windows == |
| 67 | |
| 68 | If you don't have Apache available, you can use this Python script to generate your passwords (code borrowed heavily from #845): |
| 69 | |
| 70 | {{{ |
| 71 | from optparse import OptionParser |
| 72 | import md5 |
| 73 | |
| 74 | # build the options |
| 75 | usage = "usage: %prog [options]" |
| 76 | parser = OptionParser(usage=usage) |
| 77 | parser.add_option("-u", "--username",action="store", dest="username", type = "string", |
| 78 | help="the username for whom to generate a password") |
| 79 | parser.add_option("-p", "--password",action="store", dest="password", type = "string", |
| 80 | help="the password to use") |
| 81 | (options, args) = parser.parse_args() |
| 82 | |
| 83 | # check options |
| 84 | if (options.username is None) or (options.password is None): |
| 85 | parser.error("You must supply both the username and password") |
| 86 | |
| 87 | # Generate the string to enter into the htdigest file |
| 88 | realm = 'trac' |
| 89 | kd = lambda x: md5.md5(':'.join(x)).hexdigest() |
| 90 | print ':'.join((options.username, realm, kd([options.username, realm, options.password]))) |
| 91 | }}} |
| 92 | |
| 93 | ---- |
| 94 | See also: [source:trunk/README.tracd#latest README.tracd], TracGuide, TracInstall, TracModPython |