Changes between Version 5 and Version 6 of 0.12/TracStandalone
- Timestamp:
- Apr 10, 2010, 7:04:28 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
0.12/TracStandalone
v5 v6 1 ** Note: this page was used to prepare the 0.12 version of wiki:/TracStandalone, see now directly that toplevel page ** 1 2 = Tracd = 2 3 … … 43 44 == Installing as a Windows Service == 44 45 46 === Option 1 === 45 47 To install as a Windows service, get the [http://www.google.com/search?q=srvany.exe SRVANY] utility and run: 46 48 {{{ … … 59 61 The spacing here is important. 60 62 63 For Windows 7 User, srvany.exe may not be an option, so you can use [http://www.google.com/search?q=winserv.exe WINSERV] utility and run: 64 {{{ 65 "C:\path\to\winserv.exe" install tracd -displayname "tracd" -start auto "C:\path\to\python.exe" c:\path\to\python\scripts\tracd-script.py <your tracd parameters>" 66 67 net start tracd 68 }}} 69 70 === Option 2 === 71 72 Use [http://trac-hacks.org/wiki/WindowsServiceScript WindowsServiceScript], available at [http://trac-hacks.org/ Trac Hacks]. Installs, removes, starts, stops, etc. your Trac service. 73 61 74 == Using Authentication == 62 75 … … 66 79 67 80 {{{ 68 sudo htpasswd -c /path/to/env/.htpasswd username81 $ sudo htpasswd -c /path/to/env/.htpasswd username 69 82 }}} 70 83 then for additional users: 71 84 {{{ 72 sudo htpasswd /path/to/env/.htpasswd username285 $ sudo htpasswd /path/to/env/.htpasswd username2 73 86 }}} 74 87 then for starting the tracd (on windows skip the "=" after --basic-auth): … … 83 96 ''Support for Basic authentication was added in version 0.9.'' 84 97 85 The general format for using authentication is ( on windows skip the "=" after --auth):86 87 {{{ 88 $ tracd -p port --auth= base_project_dir,password_file_path,realmproject_path98 The general format for using authentication is (replace `--auth` with `--basic-auth` if you want to use Basic auth): 99 100 {{{ 101 $ tracd -p port --auth="base_project_dir,password_file_path,realm" project_path 89 102 }}} 90 103 91 104 where: 92 105 93 * '''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 94 * '''password_file_path''' path of the password file 95 * '''realm''' realm 96 * '''project_path''' path of the project 97 98 Example (on windows skip the "=" after --auth): 106 * '''base_project_dir''': the base directory of the project specified as follows: 107 * when serving multiple projects: ''relative'' to the `project_bath` 108 * when serving only a single project (`-s`): the name of the project directory 109 Don't use an absolute path here as this won't work. ''Note:'' This parameter is case-sensitive even for environments on Windows. 110 * '''password_file_path''': path to the password file 111 * '''realm''': the realm name (can be anything) 112 * '''project_path''': path of the project 113 114 Examples: 99 115 100 116 {{{ 101 117 $ tracd -p 8080 \ 102 --auth=project1,/path/to/users.htdigest,mycompany.com /path/to/project1 103 }}} 104 Of course, the digest file can be be shared so that it is used for more than one project: 118 --auth="project1,/path/to/passwordfile,mycompany.com" /path/to/project1 119 }}} 120 121 Of course, the password file can be be shared so that it is used for more than one project: 105 122 {{{ 106 123 $ tracd -p 8080 \ 107 --auth= project1,/path/to/users.htdigest,mycompany.com\108 --auth= project2,/path/to/users.htdigest,mycompany.com\124 --auth="project1,/path/to/passwordfile,mycompany.com" \ 125 --auth="project2,/path/to/passwordfile,mycompany.com" \ 109 126 /path/to/project1 /path/to/project2 110 127 }}} 111 128 112 Another way to share the digest file is to specify "*" 113 for the project name: 129 Another way to share the password file is to specify "*" for the project name: 114 130 {{{ 115 131 $ tracd -p 8080 \ 116 --auth="* ",/path/to/users.htdigest,mycompany.com\132 --auth="*,/path/to/users.htdigest,mycompany.com" \ 117 133 /path/to/project1 /path/to/project2 118 134 }}} 119 If using the `-s` parameter for serving a Trac environment from the root of a domain, one must use `*` for the project name 120 121 == How to set up an htdigest password file == 135 136 === Using a htpasswd password file === 137 This section describes how to use `tracd` with Apache .htpasswd files. 138 139 To create a .htpasswd file use Apache's `htpasswd` command (see [#GeneratingPasswordsWithoutApache below] for a method to create these files without using Apache): 140 141 {{{ 142 $ sudo htpasswd -c /path/to/env/.htpasswd username 143 }}} 144 then for additional users: 145 {{{ 146 $ sudo htpasswd /path/to/env/.htpasswd username2 147 }}} 148 149 Then to start `tracd` run something like this: 150 151 {{{ 152 $ tracd -p 8080 --basic-auth="projectdirname,/fullpath/environmentname/.htpasswd,realmname" /fullpath/environmentname 153 }}} 154 155 For example: 156 157 {{{ 158 $ tracd -p 8080 --basic-auth="testenv,/srv/tracenv/testenv/.htpasswd,My Test Env" /srv/tracenv/testenv 159 }}} 160 161 ''Note:'' You might need to pass "-m" as a parameter to htpasswd on some platforms (OpenBSD). 162 163 === Using a htdigest password file === 122 164 123 165 If you have Apache available, you can use the htdigest command to generate the password file. Type 'htdigest' to get some usage instructions, or read [http://httpd.apache.org/docs/2.0/programs/htdigest.html this page] from the Apache manual to get precise instructions. You'll be prompted for a password to enter for each user that you create. For the name of the password file, you can use whatever you like, but if you use something like `users.htdigest` it will remind you what the file contains. As a suggestion, put it in your <projectname>/conf folder along with the [TracIni trac.ini] file. … … 125 167 Note that you can start tracd without the --auth argument, but if you click on the ''Login'' link you will get an error. 126 168 127 == Generating Passwords Without Apache==169 === Generating Passwords Without Apache === 128 170 129 171 If you don't have Apache available, you can use this simple Python script to generate your passwords: … … 164 206 165 207 {{{ 166 python trac-digest.py -u username -p password >> c:\digest.txt167 tracd --port 8000 --auth=proj_name,c:\digest.txt,trac c:\path\to\proj_name208 $ python trac-digest.py -u username -p password >> c:\digest.txt 209 $ tracd --port 8000 --auth=proj_name,c:\digest.txt,trac c:\path\to\proj_name 168 210 }}} 169 211