I came unstuck after I upgraded to 1.2 prior to making a second vhost
and second Trac project.
Is there docmentation of a standard file layout or recommended
arrangement for a single server, Apache2 multiple vhost with python 2.7
mod-wsgi and multi-project Trac 1.2 installation on Ubuntu 16.04 LTS server?
I'm getting totally bamboozled by the Trac documentation at this point.
There appears to be many ways to do things.
I remember now that I had similar trouble setting it up the first time a
few years ago and only by copying stuff everywhere (back then) did I get
it going. I'm sure I could do the same thing again but that would be
wrong of me.
I have followed (probably) bits of both
https://trac.edgewall.org/wiki/TracInstall#Usingpip and
https://trac.edgewall.org/demo-1.2/wiki/TracInstall#Usingpip
At this point my Trac instance *is* now 1.2 but not working properly:
close <https://trac.climate.com.au/ticket/73#> *Warning:* Error with
navigation contributor "AccountModule"
Oops…
*Trac detected an internal error:*
AttributeError: 'Environment' object has no attribute 'get_db_cnx'
That is not being styled because Apache cannot find the css. The css
*is* being accessed by tracd (where the environment is
/var/trac/projects/ssds (note the absence of www there)) but not Apache.
The css files do exist where Apache is looking for them and they have
www-data ownership with rwx permissions. Here is my trac vhost conf:
<IfModule mod_alias.c>
Alias /robots.txt /var/www/trac/projects/ssds/htdocs/site/robots/robots.txt
Alias /favicon.ico
/var/www/trac/projects/ssds/htdocs/site/assets/img/ssds.ico
Alias /chrome/cgi-bin /var/www/trac/projects/ssds/cgi-bin
Alias /chrome/common /var/www/trac/projects/ssds/htdocs/common
Alias /chrome/site /var/www/trac/projects/ssds/htdocs/site
</IfModule>
# lock the public out
<Directory /var/www/trac/>
Order deny,allow
Deny from all
</Directory>
# allow public here
<Directory /var/www/trac/projects/htmldocs/>
Order allow,deny
Allow from all
</Directory>
<Location /login>
AuthType Basic
AuthName "ssds"
AuthUserFile /var/svn/user_access/auth-file
Require valid-user
</Location>
<IfModule mod_wsgi.c>
WSGIScriptAlias / /var/www/trac/projects/ssds/cgi-bin/trac.wsgi
<Directory /var/www/trac/projects/ssds/cgi-bin/>
WSGIApplicationGroup %(GLOBAL)
Order deny,allow
Allow from all
</Directory>
</IfModule>
Here is a view-source excerpt from the top of the ticket query page:
(those "alternate" hrefs look a bit dodgy)
<link rel="alternate"
href="/query?status=!closed&group=status&format=rss&col=id&col=summary&col=owner&col=type&col=priority&col=changetime&col=reporter&order=priority"
type="application/rss+xml" class="rss" title="RSS Feed" />
<link rel="alternate"
href="/query?status=!closed&group=status&format=csv&col=id&col=summary&col=owner&col=type&col=priority&col=changetime&col=reporter&order=priority"
type="text/csv" class="csv" title="Comma-delimited Text" />
<link rel="alternate"
href="/query?status=!closed&group=status&format=tab&col=id&col=summary&col=owner&col=type&col=priority&col=changetime&col=reporter&order=priority"
type="text/tab-separated-values" class="tab" title="Tab-delimited Text" />
<link rel="next"
href="/query?status=!closed&group=status&page=2&col=id&col=summary&col=owner&col=type&col=priority&col=changetime&col=reporter&order=priority"
title="Next Page" />
<link rel="start" href="/wiki" />
<link rel="stylesheet" href="/chrome/common/css/trac.css" type="text/css" />
<link rel="stylesheet" href="/chrome/common/css/report.css" type="text/css" />
<link rel="stylesheet" href="/chrome/common/css/jquery-ui/jquery-ui.css"
type="text/css" />
<link rel="stylesheet" href="/chrome/common/css/jquery-ui-addons.css"
type="text/css" />
<link rel="icon" href="/var/www/trac/projects/ssds/htdocs/common/ssds.ico"
type="image/x-icon" />
<style id="trac-noscript" type="text/css">.trac-noscript { display: none !important
}</style>
Thanks for any hints
Mike
On 25/09/2017 7:37 AM, Mike Dewhirst wrote:
Thank you Ryan
I'll get started
M
On 24/09/2017 7:18 PM, RjOllos wrote:
On Sunday, September 24, 2017 at 1:32:45 AM UTC-7, Mike Dewhirst wrote:
What is the optimum way to upgrade Trac from a single project
installation to two completely separate projects?
My opinion is that it's much easier to run everything from a single
server: all Trac projects and the SVN projects.
Trac was built to serve multiple projects (environments) from a
single server. Rather than configuring TRAC_ENV in your installation
you configure TRAC_ENV_PARENT_DIR. If you want different domain names
for your projects, I think that can probably be handled in the Apache
configuration.
If you want to run the Trac projects in different Python
interpreters, that's also possible. It's just a matter of setting up
the proper WSGI directives. Take a look at:
https://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html#daemon-mode-single-application
I'm guessing separate machines but I'd much prefer separate vhosts
under
the same Apache (mod-wsgi) on the same machine. That would simplify
everything for me.
The svn server is on the original trac server and will also host the
separate project source. If we have to go to another machine will
that
be a problem? I do have a virgin machine upon which to start again.
Trac and SVN need to run on the same server. There are ways around
that, like setting up a readonly SVN mirror. It will be much easier
if you just run all your Trac and SVN instances on the same server.
A possible complication is I need to drop Python 2.7 and use 3.5
exclusively on Ubuntu 16.04 LTS.
Trac does not support any version of Python 3.x. You'll have to run
Trac with Python 2.7 for now. Support for 3.x is probably more than a
year away still.
I'd be happy to start again provided I can upload a MySQL dump
from the
original Trac. I would probably switch to Postgres if starting
again.
The SQLite file is in the project environment so it's simple to move
an SQLite project environment to another server.
https://trac.edgewall.org/wiki/TracBackup
TracMigratePlugin is good for converting a database:
http://trac-hacks.org/wiki/TracMigratePlugin
The feature has been added to Trac for the forthcoming Trac 1.4 release.
- Ryan
--
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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
--
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.