Changes between Version 1 and Version 2 of TracStandalone


Ignore:
Timestamp:
Mar 4, 2009, 4:43:29 PM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracStandalone

    v1 v2  
    2121 $ tracd -p 8080 /path/to/project
    2222}}}
     23Stricly speaking this will make your Trac accessible to everybody from your network rather than ''localhost only''. To truly limit it use ''--hostname'' option.
     24{{{
     25 $ tracd --hostname=localhost -p 8080 /path/to/project
     26}}}
    2327With more than one project. (http://localhost:8080/project1/ and http://localhost:8080/project2/)
    2428{{{
     
    3438}}}
    3539
     40To 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
    3643== Using Authentication ==
    3744
    38 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, and omit the realm.
     45Using tracd with Apache .htpasswd files:
     46
     47To create a .htpasswd file using htpasswd:
     48
     49{{{
     50sudo htpasswd -c /path/to/env/.htpasswd username
     51}}}
     52then for additional users:
     53{{{
     54sudo htpasswd /var/www/html/.htpasswd-users username2
     55}}}
     56then for starting the tracd:
     57{{{
     58tracd -p 8080 --basic-auth=environmentname,/fullpath/environmentname/.htpasswd,/fullpath/environmentname /fullpath/environmentname
     59}}}
     60
     61
     62Tracd 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.)
    3963
    4064  ''Support for Basic authentication was added in version 0.9.''
    4165
    42 If the file `/path/to/users.htdigest` contains user accounts for project1 with the realm "mycompany.com", you'd use the following command-line to start tracd:
     66The general format for using authentication is:
     67
    4368{{{
    44  $ tracd -p 8080 --auth project1,/path/to/users.htdigest,mycompany.com /path/to/project1
     69 $ tracd -p port --auth=base_project_dir,password_file_path,realm project_path
    4570}}}
    4671
    47 '''Note''': the project "name" passed to the `--auth` option is the base name of the project environment directory.
     72where:
    4873
     74 * '''base_project_dir''' is the base directory of the project; note: this doesn't refer to the project name, and it is case-sensitive even for windows environments
     75 * '''password_file_path''' path of the password file
     76 * '''realm''' realm
     77 * '''project_path''' path of the project
     78
     79Example:
     80
     81{{{
     82 $ tracd -p 8080 \
     83   --auth=project1,/path/to/users.htdigest,mycompany.com /path/to/project1
     84}}}
    4985Of course, the digest file can be be shared so that it is used for more than one project:
    5086{{{
    5187 $ tracd -p 8080 \
    52    --auth project1,/path/to/users.htdigest,mycompany.com \
    53    --auth project2,/path/to/users.htdigest,mycompany.com \
     88   --auth=project1,/path/to/users.htdigest,mycompany.com \
     89   --auth=project2,/path/to/users.htdigest,mycompany.com \
    5490   /path/to/project1 /path/to/project2
    5591}}}
     
    5995{{{
    6096 $ tracd -p 8080 \
    61    --auth *,/path/to/users.htdigest,mycompany.com \
     97   --auth=*,/path/to/users.htdigest,mycompany.com \
    6298   /path/to/project1 /path/to/project2
    6399}}}
     
    74110
    75111{{{
     112#!python
    76113from optparse import OptionParser
    77114import md5
     
    100137{{{
    101138python trac-digest.py -u username -p password >> c:\digest.txt
    102 python tracd --port 8000 --auth proj_name,c:\digest.txt,trac c:\path\to\proj_name
     139tracd --port 8000 --auth=proj_name,c:\digest.txt,trac c:\path\to\proj_name
    103140}}}
     141
     142Note: If you would like to use --basic-auth you need to use htpasswd tool from apache server to generate .htpasswd file. The remaining part is similar but make sure to use empty realm (i.e. coma after path). When using on Windows make sure to use -m option for it (did not tested it on *nix, so not sure if that is the case there).  If you do not have Apache, [trac:source:/tags/trac-0.11b2/contrib/htpasswd.py htpasswd.py] may help.  (Note that it requires a `crypt` or `fcrypt` module; see the source comments for details.)
     143
     144It is possible to use md5sum utility to generate digest-password file using such method:
     145{{{
     146echo -e "${user}:trac:${password}\c" | md5sum - >>to-file
     147}}}
     148and 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.
    104149
    105150== Tips ==
     
    123168`htdocs:software-0.1.tar.gz`.
    124169
     170=== Using apache rewrite rules ===
     171In some situations when you choose to use tracd behind apache, you might experience issues with redirects, like being redirected to URLs with the wrong host or protocol. In this case (and only in this case), setting the `[trac] use_base_url_for_redirect` to `true` can help, as this will force Trac to use the value of `[trac] base_url` for doing the redirects.
     172
     173=== Serving a different base path than / ===
     174Tracd supports serving projects with different base urls then /<project>. The parameter name to change this is
     175{{{
     176tracd --base-path=/some/path
     177}}}
     178
    125179----
    126180See also: TracInstall, TracCgi, TracModPython, TracGuide
    127 
    128 ----
    129 '''Translation:'''
    130  * [https://opensvn.csie.org/traccgi/trac_rus/wiki/StandAloneTracForTeapot Russian] (перевод на Русский)