close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "darcs": Can't find an appropriate component, maybe the corresponding plugin was not enabled? ). Look in the Trac log for more information.
- Timestamp:
-
2011-11-18 01:44:17 (13 years ago)
- Author:
-
trac
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v2
|
|
45 | 45 | |
46 | 46 | To setup Trac environment for `mod_fcgid` it is necessary to use |
47 | | `FCGIDDefaultInitEnv` directive. It cannot be used in `Directory` or |
| 47 | `DefaultInitEnv` directive. It cannot be used in `Directory` or |
48 | 48 | `Location` context, so if you need to support multiple projects, try |
49 | 49 | alternative environment setup below. |
50 | 50 | |
51 | 51 | {{{ |
52 | | FCGIDDefaultInitEnv TRAC_ENV /path/to/env/trac/ |
| 52 | DefaultInitEnv TRAC_ENV /path/to/env/trac/ |
53 | 53 | }}} |
54 | 54 | |
… |
… |
|
94 | 94 | After doing this, we will just have to create a new rule managed by the SCGI handler to access Trac. It can be created in a new virtual server, trac.example.net for instance, and will only need two rules. The '''default''' one will use the SCGI handler associated to the previously created information source. |
95 | 95 | The second rule will be there to serve the few static files needed to correctly display the Trac interface. Create it as ''Directory rule'' for ''/chrome/common'' and just set it to the ''Static files'' handler and with a ''Document root'' that points to the appropriate files: ''/usr/share/trac/htdocs/'' |
| 96 | |
| 97 | Note:\\ |
| 98 | If the tracd process fails to start up, and cherokee displays a 503 error page, you might be missing the [http://trac.saddi.com/flup python-flup] package.\\ |
| 99 | Python-flup is a dependency which provides trac with SCGI capability. You can install it on debian based systems with: |
| 100 | {{{ |
| 101 | sudo apt-get install python-flup |
| 102 | }}} |
96 | 103 | |
97 | 104 | == Simple Lighttpd Configuration == |
… |
… |
|
122 | 129 | and you may set one of the two in `trac.fcgi` instead of in `lighttpd.conf` |
123 | 130 | using `bin-environment` (as in the section above on Apache configuration). |
| 131 | |
| 132 | Note that lighttpd has a bug related to 'SCRIPT_NAME' and 'PATH_INFO' when the uri of fastcgi.server is '/' instead of '/trac' in this example, see #Trac2418. This should be fixed since lighttpd 1.4.23, and you may need to add `"fix-root-scriptname" => "enable"` as parameter of fastcgi.server. |
124 | 133 | |
125 | 134 | For using two projects with lighttpd add the following to your `lighttpd.conf`: |
… |
… |
|
275 | 284 | Note about running lighttpd with reduced permissions: |
276 | 285 | |
277 | | If nothing else helps and trac.fcgi doesn't start with lighttpd settings __server.username = "www-data"__, __server.groupname = "www-data"__, then in the `bin-environment` section set `PYTHON_EGG_CACHE` to the home directory of `www-data` or some other directory accessible to this account for writing. |
| 286 | If nothing else helps and trac.fcgi doesn't start with lighttpd settings `server.username = "www-data"`, `server.groupname = "www-data"`, then in the `bin-environment` section set `PYTHON_EGG_CACHE` to the home directory of `www-data` or some other directory accessible to this account for writing. |
278 | 287 | |
279 | 288 | |
… |
… |
|
284 | 293 | !LiteSpeed web server is an event-driven asynchronous Apache replacement designed from the ground-up to be secure, scalable, and operate with minimal resources. !LiteSpeed can operate directly from an Apache config file and is targeted for business-critical environments. |
285 | 294 | |
286 | | Setup |
287 | | |
288 | | 1) Please make sure you have first have a working install of a Trac project. Test install with “tracd” first. |
289 | | |
290 | | 2) Create a Virtual Host for this setup. From now on we will refer to this vhost as TracVhost. For this tutorial we will be assuming that your trac project will be accessible via: |
| 295 | === Setup === |
| 296 | |
| 297 | 1. Please make sure you have first have a working install of a Trac project. Test install with “tracd” first. |
| 298 | |
| 299 | 2. Create a Virtual Host for this setup. From now on we will refer to this vhost as !TracVhost. For this tutorial we will be assuming that your trac project will be accessible via: |
291 | 300 | |
292 | 301 | {{{ |
… |
… |
|
294 | 303 | }}} |
295 | 304 | |
296 | | 3) Go “TracVhost → External Apps” tab and create a new “External Application”. |
| 305 | 3. Go “!TracVhost → External Apps” tab and create a new “External Application”. |
297 | 306 | |
298 | 307 | {{{ |
… |
… |
|
312 | 321 | }}} |
313 | 322 | |
314 | | 4) Optional. If you need to use htpasswd based authentication. Go to “TracVhost → Security” tab and create a new security “Realm”. |
| 323 | 4. Optional. If you need to use htpasswd based authentication. Go to “!TracVhost → Security” tab and create a new security “Realm”. |
315 | 324 | |
316 | 325 | {{{ |
… |
… |
|
322 | 331 | If you don’t have a htpasswd file or don’t know how to create the entries within one, go to http://sherylcanter.com/encrypt.php, to generate the user:password combos. |
323 | 332 | |
324 | | 5) Go to “PythonVhost → Contexts” and create a new “FCGI Context”. |
| 333 | 5. Go to “!PythonVhost → Contexts” and create a new “FCGI Context”. |
325 | 334 | |
326 | 335 | {{{ |
… |
… |
|
330 | 339 | }}} |
331 | 340 | |
332 | | 6) Modify /fullpathto/mytracproject/conf/trac.ini |
| 341 | 6. Modify `/fullpathto/mytracproject/conf/trac.ini` |
333 | 342 | |
334 | 343 | {{{ |
… |
… |
|
339 | 348 | }}} |
340 | 349 | |
341 | | 7) Restart !LiteSpeed, “lswsctrl restart”, and access your new Trac project at: |
| 350 | 7. Restart !LiteSpeed, “lswsctrl restart”, and access your new Trac project at: |
342 | 351 | |
343 | 352 | {{{ |
… |
… |
|
345 | 354 | }}} |
346 | 355 | |
347 | | === Simple Nginx Configuration === |
348 | | |
349 | | 1) Nginx configuration snippet - confirmed to work on 0.6.32 |
| 356 | == Simple Nginx Configuration == |
| 357 | |
| 358 | 1. Nginx configuration snippet - confirmed to work on 0.6.32 |
350 | 359 | {{{ |
351 | 360 | server { |
… |
… |
|
394 | 403 | fastcgi_param SERVER_PORT $server_port; |
395 | 404 | fastcgi_param SERVER_PROTOCOL $server_protocol; |
| 405 | fastcgi_param QUERY_STRING $query_string; |
396 | 406 | |
397 | 407 | # for authentication to work |
… |
… |
|
402 | 412 | }}} |
403 | 413 | |
404 | | 2) Modified trac.fcgi: |
| 414 | 2. Modified trac.fcgi: |
405 | 415 | |
406 | 416 | {{{ |
… |
… |
|
436 | 446 | }}} |
437 | 447 | |
438 | | 3) reload nginx and launch trac.fcgi like that: |
| 448 | 3. reload nginx and launch trac.fcgi like that: |
439 | 449 | |
440 | 450 | {{{ |
… |
… |
|
444 | 454 | The above assumes that: |
445 | 455 | * There is a user named 'trac' for running trac instances and keeping trac environments in its home directory. |
446 | | * /home/trac/instance contains a trac environment |
447 | | * /home/trac/htpasswd contains authentication information |
448 | | * /home/trac/run is owned by the same group the nginx runs under |
449 | | * and if your system is Linux the /home/trac/run has setgid bit set (chmod g+s run) |
| 456 | * `/home/trac/instance` contains a trac environment |
| 457 | * `/home/trac/htpasswd` contains authentication information |
| 458 | * `/home/trac/run` is owned by the same group the nginx runs under |
| 459 | * and if your system is Linux the `/home/trac/run` has setgid bit set (`chmod g+s run`) |
450 | 460 | * and patch from ticket #T7239 is applied, or you'll have to fix the socket file permissions every time |
451 | 461 | |