On Friday, February 8, 2019 at 3:10:19 PM UTC-5, fernan wrote:
>
> Hi
>
> I have a situation where I think I may benefit from running several trac 
> instances from a single .wsgi script but am confused from reading the docs 
> on what would happen if not all trac instances are accessed in the same 
> way. 
>
> Right now, I'm in a situation where some trac instances are accessed 
> through their own URL/subdomain (e.g. examples trac1 and trac2 below), 
> where some others are accessed behind the same domain (examples trac3-trac5 
> below), using the TRAC_ENV_PARENT_DIR, as described in the docs.
>
> However, notwithstanding these different access routes, they are all 
> installed and deployed consistently to the same hierarchy of directories. 
>
> What confuses me is that from the point of view of trac-admin, they're all 
> under the same TRAC_ENV_PARENT_DIR.  However from the standpoint of the 
> Apache web sever (the URL used to access the resource), they are not. Maybe 
> there's no reason to be confused?
>
> My setup: 
>
> *trac1 *
> /var/lib/trac/trac1 deployed to /var/www/trac1
> accessed at trac.domain1.com
>
> *trac2*
> /var/lib/trac/trac2 deployed to /var/www/trac2
> accessed at trac.domain2.com
>
> *trac3*
> /var/lib/trac/trac3 deployed to /var/www/trac3
> accessed at my.domain3.com/trac/trac3
>
> *trac4*
> /var/lib/trac/trac4 deployed to /var/www/trac4
> accessed at my.domain3.com/trac/trac4
>
> *trac5*
> /var/lib/trac/trac5 deployed to /var/www/trac5
> accessed at my.domain3.com/trac/trac5
>
> Summary: 
> all trac proj environments live under /var/lib/trac 
> all are deployed to /var/www
>
>
> Question:
> Is it OK to just run them all off a single trac.wsgi from e.g. 
> /var/www/cgi-bin/?
>

Yes, should work fine. Use the generic trac.wsgi generated by deploy and 
don't edit it. Instead, set the appropriate environment variables in the 
Apache configuration. 

You need a VirualHost directory with the ServerName set for each of: 
trac.domain1.com, trac.domain2.com and my.domain3.com. For the first two 
you can use "SetEnv trac.env_path ... " to specify the environment dir 
(assuming you have mod_env), for the third you can use "SetEnv 
trac.env_parent_dir ... "

 

> What would happen with this setup if I try to access e.g.
> my.domain3.com/trac/trac1? I'd think this is just an innocuous 
> side-effect ... 
>

I think it will serve the environment for trac1. However, you can put a 
".tracignore" file in trac.env_parent_dir and list the environments to 
ignore when serving my.domain3.com.
https://trac.edgewall.org/browser/tags/trac-1.2.3/trac/web/main.py?marks=847,872,873#L847

It looks like the .tracignore feature is not documented. I will add some 
documentation soon.

 

> Thanks for sharing your wisdom, 
>
> Cheers,
>
>
> -- 
> fernan
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to