Changes between Version 1 and Version 2 of TracCgi
- Timestamp:
- 14/01/08 13:29:01 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracCgi
v1 v2 33 33 }}} 34 34 35 ''Note that the `SetEnv` directive requires the `mod_env` module to be installed and enable.'' 35 ''Note that the `SetEnv` directive requires the `mod_env` module to be installed and enable. If not, you could set TRAC_ENV in trac.cgi. Just add the following code between "try:" and "from trac.web ...":'' 36 37 {{{ 38 import os 39 os.environ['TRAC_ENV'] = "/path/to/projectenv" 40 }}} 41 42 '' Or for TRAC_ENV_PARENT_DIR: '' 43 44 {{{ 45 import os 46 os.environ['TRAC_ENV_PARENT_DIR'] = "/path/to/project/parent/dir" 47 }}} 36 48 37 49 This will make Trac available at `http://yourhost.example.org/trac`. … … 59 71 60 72 For example, if Trac is mapped to `/cgi-bin/trac.cgi` on your server, the URL of the Alias should be `/cgi-bin/trac.cgi/chrome/common`. 73 74 Similarly, if you have static resources in a projects htdocs directory, you can configure apache to serve those resources (again, put this '''before''' the `ScriptAlias` for the CGI script, and adjust names and locations to match your installation): 75 76 {{{ 77 Alias /trac/chrome/site /path/to/projectenv/htdocs 78 <Directory "/path/to/projectenv/htdocs"> 79 Order allow,deny 80 Allow from all 81 </Directory> 82 }}} 61 83 62 84 Alternatively, you can set the `htdocs_location` configuration option in [wiki:TracIni trac.ini]: … … 113 135 }}} 114 136 115 For better security, it is recommended that you either enable SSL or at least use the “Digest” authentication scheme instead of “Basic”. Please read the [http://httpd.apache.org/docs/2.0/ Apache HTTPD documentation] to find out more. 137 For better security, it is recommended that you either enable SSL or at least use the “Digest” authentication scheme instead of “Basic”. Please read the [http://httpd.apache.org/docs/2.0/ Apache HTTPD documentation] to find out more. For example, on a Debian 4.0r1 (etch) system the relevant section in apache configuration can look like this: 138 {{{ 139 <Location "/trac/login"> 140 LoadModule auth_digest_module /usr/lib/apache2/modules/mod_auth_digest.so 141 AuthType Digest 142 AuthName "trac" 143 AuthDigestDomain /trac 144 AuthUserFile /somewhere/trac.htpasswd 145 Require valid-user 146 </Location> 147 }}} 148 and you'll have to create your .htpasswd file with htdigest instead of htpasswd as follows: 149 {{{ 150 # htdigest /somewhere/trac.htpasswd trac admin 151 }}} 152 where the "trac" parameter above is the same as !AuthName above ("Realm" in apache-docs). 116 153 117 154 ----