On 05/07/12 15:16, Gabor Szabo wrote:
On Thu, Jul 5, 2012 at 4:58 PM, kevin dawson <ke...@dawson10.plus.com> wrote:
On 27/06/12 07:34, Gabor Szabo wrote:
Ok here goes
A maintenance / info for page for Padre trac
if you create a dir call trac off web root
├── trac
│ ├── index.html
│ ├── logo.png
│ └── trac_logo_mini.png
add enc files
then you can use the a2... command
sudo a2dissite trac.conf && sudo service apache2 reload
sudo a2ensite trac.conf && sudo service apache2 reload
and now we have info page when trac is down.
It is simple and quite clean, but any body want to make it better or
cleaner, be my guest.
I am not sure how the a2dissite would help. The trac is in a
<Location /trac/>
within our VirtualHost
I think you can add some static pages to what
padre/template.padre.perlide.org in SVN
generates as that is what drives the static site. I just tried it. As long as I
have trac enabled you see trac but if I comment it out you see the static pages.
Though hopefully we won't see serious downtime for a while.
Gabor
_______________________________________________
Padre-dev mailing list
Padre-dev@perlide.org
http://mail.perlide.org/mailman/listinfo/padre-dev
Good
now we can start on the next step
let us assume that in /etc/apache2/sites-available/
that there is a file called padre_trac
we need to rename it to trac_mod_python.conf
using a2dissite padre_trac
reload apache
that static pages will kick in
now we can rename it to trac_mod_python.conf
then using
a2ensite trac_mod_python.conf
we will be back on line
Now for the mod_wsgi
we create a file in /etc/apache2/sites-available/
trac_wsgi.conf
install mod_wsgi (apt)
and
trac
├── apache
│ └── trac.wsgi
├── conf
├── db
...
enc trac_wsgi.conf, trac.wsgi
tweak above for local settings
then you can just use a2...
to to unload mod_python and load wsgi configuration
have fun
regards
bowtie
ps only one more step after this to go :)
import sys
sys.stdout = sys.stderr
import os
os.environ['PYTHON_EGG_CACHE'] = '/usr/src/trac/eggs'
os.environ['TRAC_ENV_INDEX_TEMPLATE'] = '/usr/src/trac/templates'
import trac.web.main
def application(environ, start_response):
environ['trac.locale'] = 'en_GB.UTF-8'
environ['trac.env_path'] = '/usr/src/trac'
return trac.web.main.dispatch_request(environ, start_response)
WSGIScriptAlias /trac /usr/src/trac/apache/trac.wsgi
<Directory /usr/src/trac/apache>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
<Location "/trac/login">
AuthType Basic
AuthName "Trac"
AuthUserFile /usr/src/trac/trac.htpasswd
# Useful to get the date in the wanted order
# PythonOption TracLocale en_GB.UTF8
Require valid-user
</Location>
_______________________________________________
Padre-dev mailing list
Padre-dev@perlide.org
http://mail.perlide.org/mailman/listinfo/padre-dev