Monday, August 30, 2010

deployment problem gotcha

I had an admin media problem finding base.css in deploying an app from
the Django (svn head) dev server on Windows to Apache 2.2 on Linux

Because I had prepared this email ready to ask for help, I'm posting it
anyway with the hope that it helps someone.

Everything else was working. Firebug was saying it couldn't find
base.css and I couldn't see anything wrong with the following excerpts
from settings.py and vhosts.conf:

... from settings.py ...

MEDIA_ROOT = '/srv/www/ccm/htdocs/static'
MEDIA_URL = '/static/'
ADMIN_MEDIA_ROOT =
'/usr/local/lib64/python/site-packages/django/contrib/admin/media/'
ADMIN_MEDIA_PREFIX = '/media/'

... from vhosts.conf ...

Alias /media/
/usr/local/lib64/python/site-packages/django/contrib/admin/media

<Directory /usr/local/lib64/python/site-packages/django/contrib/admin/media>
AllowOverride None
Order deny,allow
Allow from all
</Directory>

Alias /static/ /srv/www/ccm/htdocs/static/
Alias /tiny_mce/ /srv/www/ccm/htdocs/static/js/tiny_mce/
Alias /jquery/ /srv/www/ccm/htdocs/static/js/jquery/

<Directory /srv/www/ccm/htdocs/>
AllowOverride None
Order deny,allow
Allow from all
</Directory>


Now, in order to get some meaningful error messages I included this

import sys
sys.stdout = sys.stderr

in my wsgi script - as per the recommendation I found in
http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

and after which, I discovered "Symbolic link not allowed or link target
not accessible: /usr/local/lib64/python" in the Apache error log. This
gave the clue that I needed:

/usr/local/lib64/python2.6/site-packages/django/contrib/admin

rather than the one prepared earlier which incorporated /python/ which
is a symbolic link.

Google indicated I could have included Options FollowSymLinks and maybe
I should have done that instead.

Maybe an expert who has read this far might care to comment?

Mike

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment