Handle the fact that the static files are in two locations

The static files are split over two places:
- /usr/share/pdc/static/ which contains the files specific to pdc
- /usr/share/patternfly1/resources/ which contains the files from patternfly1

This means that we much teach apache to go to both places to look for the static
files. This is quite annoying and thankfully something that Patrick Uiterwijk
and I already looked into for flask-multistatic.
So the solution was already known and documented:
https://pagure.io/flask-multistatic/blob/master/f/example.conf
This commit is contained in:
Pierre-Yves Chibon 2015-09-30 10:15:26 +02:00
parent bbbfe4d4e4
commit b7ae30017a

View file

@ -8,7 +8,6 @@ WSGIDaemonProcess pdc user=apache group=apache maximum-requests=1000 display-nam
CustomLog /var/log/httpd/pdc-access.log combined
ErrorLog /var/log/httpd/pdc-error.log
Alias /static/ /usr/share/pdc/static/
Alias /docs/ /usr/share/doc/pdc/docs/build/html/
# Using SetEnv here will not work as expected as it does not change
@ -19,6 +18,14 @@ WSGIDaemonProcess pdc user=apache group=apache maximum-requests=1000 display-nam
# and point the following directive to it.
WSGIScriptAlias / /usr/lib/python2.7/site-packages/pdc/wsgi.py
RewriteEngine on
# First try to find the files in pdc
RewriteCond "/usr/lib/python2.7/site-packages/pdc/static/$1" -f
RewriteRule "^/static/(.*)" "/usr/lib/python2.7/site-packages/pdc/static/$1" [L]
# Try to find them in the patternfly files
RewriteRule "^/static/(.*)" "/usr/share/patternfly1/resources/$1" [L]
<Location "/">
SetHandler wsgi-script