yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #40816
[Bug 1500830] Re: setting COMPRESS_ENABLED = False and restarting Apache leads to every xstatic library being NOT FOUND
Not a Horizon bug, instead it's an Apache 'Works As Intended'. Let me
explain how Apache web-server works in conjunction with django-
compressor package.
First, Apache serves dynamic (Django stuff) and static (CSS/JS) Horizon content in 2 different ways:
* https://github.com/openstack-dev/devstack/blob/stable/liberty/files/apache-horizon.template#L2 - dynamic content is served through Apache mod_wsgi where Apache process needs to have an access just to django.wsgi script
* https://github.com/openstack-dev/devstack/blob/stable/liberty/files/apache-horizon.template#L12 - static content is served through Alias directive, which ties Web location to FileSystem location, but the FileSystem location also needs to be made explicitly available to Apache (see [2])
Then, how the Apache would be able to serve something static outside of
%HORIZON_DIR% (which resides usually in /usr/share/openstack_dashboard),
like our XStatic / libjs stuff? In fact it wouldn't :) - and that's what
we had seen on your lab with COMPRESS_ENABLED = False. But when
COMPRESS_ENABLED = True, what it does is putting compressed static
assets into STATIC_ROOT [3] which is already inside %HORIZON_DIR% - the
same thing that collectstatic does!
So the bottom line here: in order to serve static assets from Apache you
_have_ to put them to place with explicitly enabled read access. This
single (and the least confusing) place is Horizon STATIC_ROOT. Either
collectstatic, or compress commands of manage.py do this thing. If you
don't want to multiply number of files, collectstatic --link is the only
viable option. Otherwise, we won't be able to debug uncompressed statics
on production environments.
** Changed in: horizon
Status: New => Invalid
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1500830
Title:
setting COMPRESS_ENABLED = False and restarting Apache leads to every
xstatic library being NOT FOUND
Status in OpenStack Dashboard (Horizon):
Invalid
Bug description:
Hi,
Trying to see if it is possible to debug Horizon in production, one of
my colleague tried to disable compress. Then the result isn't nice at
all. Setting COMPRESS_ENABLED = False and restarting Apache leads to
every xstatic library being NOT FOUND, and loading of pages taking
forever.
To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1500830/+subscriptions
References