On Saturday, February 13, 2016 at 9:08:49 AM UTC-8, Vijay Varadan wrote:
>
> I did a fresh install of trac in the following environment:
>
> Ubuntu 14.04.3
> python 2.7.,6
> PostgreSQL 9.3.11
> psycopg2 2.6.1
> Genshi 0.7-3
> Babel 1.3
> setuptools 3.3
>
> Everything works fine when I use tracd as follows (user and group are set
> to be the same as Apache):
>
> tracd --port 8000 -r --group=www-data --user=www-data
> /var/wiki/funambulus_trac
>
>
> I proceeded to using the trac wiki with Apache 2.4.7 WSGI configured as
> follows:
>
> Alias /funambulus/chrome/common /var/wiki/funambulus_trac/www/
> htdocs/common
> Alias /funambulus/chrome/site /var/wiki/funambulus_trac/www/
> htdocs/site
> <Directory "/var/wiki/funambulus_trac/www/htdocs">
> # For Apache 2.4
> <IfModule mod_authz_core.c>
> Require all granted
> </IfModule>
> </Directory>
>
>
> WSGIScriptAlias /funambulus /var/wiki/funambulus_trac/www/cgi-bin
> /trac.wsgi
> <Directory /var/wiki/funambulus_trac/www/cgi-bin>
> Options -Indexes -MultiViews -SymLinksIfOwnerMatch
> AllowOverride All
> WSGIApplicationGroup %{GLOBAL}
> # For Apache 2.4
> <IfModule mod_authz_core.c>
> Require all granted
> </IfModule>
> </Directory>
>
>
>
> And the trac.wsgi file is the standard one created via trac-admin ...
> deploy
>
> import os
>
>
> def application(environ, start_request):
> if not 'trac.env_parent_dir' in environ:
> environ.setdefault('trac.env_path', '/var/wiki/funambulus_trac')
> if 'PYTHON_EGG_CACHE' in environ:
> os.environ['PYTHON_EGG_CACHE'] = environ['PYTHON_EGG_CACHE']
> elif 'trac.env_path' in environ:
> os.environ['PYTHON_EGG_CACHE'] = \
> os.path.join(environ['trac.env_path'], '.egg-cache')
> elif 'trac.env_parent_dir' in environ:
> os.environ['PYTHON_EGG_CACHE'] = \
> os.path.join(environ['trac.env_parent_dir'], '.egg-cache')
> from trac.web.main import dispatch_request
> return dispatch_request(environ, start_request)
>
>
>
> When I access trac through WSGI, the header and footer are missing
> everywhere. The site seems to work fine otherwise.
>
>
> <https://lh3.googleusercontent.com/-7asbPOKiHRQ/Vr8bWd1GxJI/AAAAAAAAIMQ/AgBKJ1fxj3Q/s1600/trac-missing-header-footer.png>
>
>
> I've added TRAC_ADMIN temporarily to anonymous role to help with
> debugging, in case someone wants to take a look.
>
>
> Does anyone have pointers as to where to start looking to resolve this?
> I've not done much web development with Python / WSGI, but since everything
> seems to be working fine without WSGI - I could use some pointers.
>
>
> Thanks,
>
> Vijay Varadan
>
I think the documentation for Apache with mod_wsgi needs to be improved.
Could you please try starting from the following?
Define hostname myhost.com
Define envname proj-1.0
Define sitepath /Users/rjollos/Documents/Workspace/trac-dev
Define envpath ${sitepath}/${envname}
WSGIDaemonProcess ${hostname}
python-path=${sitepath}/pve/lib/python2.7/site-packages:${sitepath}/pve/bin
maximum-requests=1000 processes=2 threads=25 inactivity-timeout=120
<VirtualHost *:80>
ServerName ${hostname}
DocumentRoot ${envpath}/www
WSGIScriptAlias /${envname} ${envpath}/www/cgi-bin/trac.wsgi
<Directory ${envpath}/www/cgi-bin>
WSGIApplicationGroup %{GLOBAL}
WSGIProcessGroup ${hostname}
Require all granted
</Directory>
Alias ${envname}/chrome ${envpath}/www/htdocs
<Directory ${envpath}/www>
Options -Indexes
Require all granted
</Directory>
<Directory ${envpath}/files/attachments>
Options -Indexes
Require all granted
</Directory>
</VirtualHost>
You'll need to set hostname, envname and sitepath, and possibly modify the
port 80 -> 8000.
- 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].
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.