tracstandalone
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | tracstandalone [2015/06/09 15:23] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Tracd ====== | ||
+ | |||
+ | Tracd is a lightweight standalone Trac web server. In most cases it's easier to setup and runs faster than the [[: | ||
+ | |||
+ | ===== Pros ===== | ||
+ | |||
+ | * Fewer dependencies: | ||
+ | * Fast: Should be almost as fast as the [[: | ||
+ | * Automatic reloading: For development, | ||
+ | |||
+ | ===== Cons ===== | ||
+ | |||
+ | * Fewer features: Tracd implements a very simple web-server and is not as configurable or as scalable as Apache HTTPD. | ||
+ | * No native HTTPS support: [[http:// | ||
+ | or [[http:// | ||
+ | |||
+ | ===== Usage examples ===== | ||
+ | |||
+ | A single project on port 8080. (http:// | ||
+ | < | ||
+ | $ tracd -p 8080 / | ||
+ | </ | ||
+ | |||
+ | With more than one project. (http:// | ||
+ | < | ||
+ | $ tracd -p 8080 / | ||
+ | </ | ||
+ | |||
+ | |||
+ | You can't have the last portion of the path identical between the projects since Trac uses that name to keep the URLs of the | ||
+ | different projects unique. So if you use `/ | ||
+ | |||
+ | An alternative way to serve multiple projects is to specify a parent directory in which each subdirectory is a Trac project, using the `-e` option. The example above could be rewritten: | ||
+ | < | ||
+ | $ tracd -p 8080 -e /path/to | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Using Authentication ===== | ||
+ | |||
+ | Tracd provides support for both Basic and Digest authentication. The default is to use Digest; to use Basic authentication, | ||
+ | |||
+ | //Support for Basic authentication was added in version 0.9.// | ||
+ | |||
+ | If the file `/ | ||
+ | < | ||
+ | $ tracd -p 8080 --auth project1,/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | **Note**: the project " | ||
+ | |||
+ | Of course, the digest file can be be shared so that it is used for more than one project: | ||
+ | < | ||
+ | $ tracd -p 8080 \ | ||
+ | | ||
+ | | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | Another way to share the digest file is to specify " | ||
+ | for the project name: | ||
+ | < | ||
+ | $ tracd -p 8080 \ | ||
+ | | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== How to set up an htdigest password file ===== | ||
+ | |||
+ | If you have Apache available, you can use the htdigest command to generate the password file. Type ' | ||
+ | |||
+ | Note that you can start tracd without the --auth argument, but if you click on the //Login// link you will get an error. | ||
+ | |||
+ | ===== Generating Passwords Without Apache ===== | ||
+ | |||
+ | If you don't have Apache available, you can use this simple Python script to generate your passwords: | ||
+ | |||
+ | < | ||
+ | from optparse import OptionParser | ||
+ | import md5 | ||
+ | |||
+ | # build the options | ||
+ | usage = " | ||
+ | parser = OptionParser(usage=usage) | ||
+ | parser.add_option(" | ||
+ | help=" | ||
+ | parser.add_option(" | ||
+ | help=" | ||
+ | (options, args) = parser.parse_args() | ||
+ | |||
+ | # check options | ||
+ | if (options.username is None) or (options.password is None): | ||
+ | | ||
+ | |||
+ | # Generate the string to enter into the htdigest file | ||
+ | realm = ' | ||
+ | kd = lambda x: md5.md5(':' | ||
+ | print ':' | ||
+ | </ | ||
+ | |||
+ | |||
+ | Note: If you use the above script you must use the --auth option to tracd, not --basic-auth, | ||
+ | |||
+ | < | ||
+ | python trac-digest.py -u username -p password >> c: | ||
+ | python tracd --port 8000 --auth proj_name, | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Tips ===== | ||
+ | |||
+ | ==== Serving static content ==== | ||
+ | |||
+ | If `tracd` is the only webserver used for the project, | ||
+ | it can also be used to distribute static content | ||
+ | (tarballs, Doxygen documentation, | ||
+ | |||
+ | This static content should be put in the `$TRAC_ENV/ | ||
+ | and is accessed by URLs like `< | ||
+ | |||
+ | Example: given a `$TRAC_ENV/ | ||
+ | the corresponding relative URL would be `/< | ||
+ | which in turn can be written using the relative link syntax | ||
+ | in the Wiki: `[[::< | ||
+ | |||
+ | The development version of Trac supports a new `htdocs:` TracLinks | ||
+ | syntax for the above. With this, the example link above can be written simply | ||
+ | `htdocs: | ||
+ | |||
+ | ---- | ||
+ | See also: TracInstall, | ||
+ | |||
+ | ---- | ||
+ | **Translation: | ||
+ | * [[https:// | ||
+ | |||
tracstandalone.txt · Last modified: 2015/06/09 15:23 by 127.0.0.1