close
Warning:
Failed to sync with repository "ogBrowser-Git": (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xA6 I...' for column 'message' at row 1"); repository information may be out of date. Look in the Trac log for more information including mitigation strategies.
- Timestamp:
-
Mar 15, 2010, 9:46:23 AM (17 years ago)
- Author:
-
trac
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v1
|
v2
|
|
| 8 | 8 | * Fast: Should be almost as fast as the [wiki:TracModPython mod_python] version (and much faster than the [wiki:TracCgi CGI]). |
| 9 | 9 | * Automatic reloading: For development, Tracd can be used in ''auto_reload'' mode, which will automatically restart the server whenever you make a change to the code (in Trac itself or in a plugin). |
| | 10 | * Options for tracd: `-r, --auto-reload` |
| 10 | 11 | |
| 11 | 12 | == Cons == |
| … |
… |
|
| 40 | 41 | To exit the server on Windows, be sure to use {{{CTRL-BREAK}}} -- using {{{CTRL-C}}} will leave a Python process running in the background. |
| 41 | 42 | |
| 42 | | When running as a Windows service using a utility such as [http://www.google.com/search?q=srvany.exe SRVANY], stopping or restarting the service will also leave a Python process running -- restart the system instead. |
| 43 | | |
| | 43 | == Installing as a Windows Service == |
| | 44 | |
| | 45 | To install as a Windows service, get the [http://www.google.com/search?q=srvany.exe SRVANY] utility and run: |
| | 46 | {{{ |
| | 47 | C:\path\to\instsrv.exe tracd C:\path\to\srvany.exe |
| | 48 | reg add HKLM\SYSTEM\CurrentControlSet\Services\tracd\Parameters /v Application /d "\"C:\path\to\python.exe\" \"C:\path\to\python\scripts\tracd-script.py\" <your tracd parameters>" |
| | 49 | net start tracd |
| | 50 | }}} |
| | 51 | |
| | 52 | '''DO NOT''' use {{{tracd.exe}}}. Instead register {{{python.exe}}} directly with {{{tracd-script.py}}} as a parameter. If you use {{{tracd.exe}}}, it will spawn the python process without SRVANY's knowledge. This python process will survive a {{{net stop tracd}}}. |
| | 53 | |
| | 54 | If you want tracd to start automatically when you boot Windows, do: |
| | 55 | {{{ |
| | 56 | sc config tracd start= auto |
| | 57 | }}} |
| | 58 | |
| | 59 | The spacing here is important. |
| 44 | 60 | |
| 45 | 61 | == Using Authentication == |
| … |
… |
|
| 50 | 66 | |
| 51 | 67 | {{{ |
| 52 | | sudo htpasswd -c /path/to/env/.htpasswd username |
| | 68 | $ sudo htpasswd -c /path/to/env/.htpasswd username |
| 53 | 69 | }}} |
| 54 | 70 | then for additional users: |
| 55 | 71 | {{{ |
| 56 | | sudo htpasswd /path/to/env/.htpasswd username2 |
| 57 | | }}} |
| 58 | | then for starting the tracd: |
| 59 | | {{{ |
| 60 | | tracd -p 8080 --basic-auth=environmentname,/fullpath/environmentname/.htpasswd,/fullpath/environmentname /fullpath/environmentname |
| 61 | | }}} |
| 62 | | |
| | 72 | $ sudo htpasswd /path/to/env/.htpasswd username2 |
| | 73 | }}} |
| | 74 | then for starting the tracd (on windows skip the "=" after --basic-auth): |
| | 75 | {{{ |
| | 76 | $ tracd -p 8080 --basic-auth=environmentname,/fullpath/environmentname/.htpasswd,/fullpath/environmentname /fullpath/environmentname |
| | 77 | }}} |
| 63 | 78 | |
| 64 | 79 | Tracd provides support for both Basic and Digest authentication. The default is to use Digest; to use Basic authentication, replace `--auth` with `--basic-auth` in the examples below. (You must still specify a dialogic "realm", which can be an empty string by trailing the BASICAUTH with a comma.) |
| … |
… |
|
| 66 | 81 | ''Support for Basic authentication was added in version 0.9.'' |
| 67 | 82 | |
| 68 | | The general format for using authentication is: |
| | 83 | The general format for using authentication is (on windows skip the "=" after --auth): |
| 69 | 84 | |
| 70 | 85 | {{{ |
| … |
… |
|
| 79 | 94 | * '''project_path''' path of the project |
| 80 | 95 | |
| 81 | | Example: |
| | 96 | Example (on windows skip the "=" after --auth): |
| 82 | 97 | |
| 83 | 98 | {{{ |
| … |
… |
|
| 147 | 162 | |
| 148 | 163 | {{{ |
| 149 | | python trac-digest.py -u username -p password >> c:\digest.txt |
| 150 | | tracd --port 8000 --auth=proj_name,c:\digest.txt,trac c:\path\to\proj_name |
| | 164 | $ python trac-digest.py -u username -p password >> c:\digest.txt |
| | 165 | $ tracd --port 8000 --auth=proj_name,c:\digest.txt,trac c:\path\to\proj_name |
| 151 | 166 | }}} |
| 152 | 167 | |
| … |
… |
|
| 155 | 170 | It is possible to use md5sum utility to generate digest-password file using such method: |
| 156 | 171 | {{{ |
| 157 | | echo -e "${user}:trac:${password}\c" | md5sum - >>to-file |
| 158 | | }}} |
| 159 | | and manually delete " -" from the end and add "${user}:trac:" to the start of line from 'to-file'. You can see attachment:trac-digest-corrected.sh for detail. |
| | 172 | $ printf "${user}:trac:${password}" | md5sum - >>user.htdigest |
| | 173 | }}} |
| | 174 | and manually delete " -" from the end and add "${user}:trac:" to the start of line from 'to-file'. |
| 160 | 175 | |
| 161 | 176 | == Tips == |
| … |
… |
|
| 175 | 190 | in the Wiki: `[/<project_name>/chrome/site/software-0.1.tar.gz]` |
| 176 | 191 | |
| 177 | | The development version of Trac supports a new `htdocs:` TracLinks |
| | 192 | Since 0.10, Trac supports a new `htdocs:` TracLinks |
| 178 | 193 | syntax for the above. With this, the example link above can be written simply |
| 179 | 194 | `htdocs:software-0.1.tar.gz`. |
| … |
… |
|
| 185 | 200 | Tracd supports serving projects with different base urls than /<project>. The parameter name to change this is |
| 186 | 201 | {{{ |
| 187 | | tracd --base-path=/some/path |
| | 202 | $ tracd --base-path=/some/path |
| 188 | 203 | }}} |
| 189 | 204 | |