I have scalable openshift online app with official python-2.7 cartridge. By default everything is served with mod_wsgi handler. How do I configure my app and/or Apache to serve some static files in my repo (like images, css and javascript) with Apache instead of python backend?

  • You mean other than putting them in /static? – Michael Hampton Feb 25 '15 at 13:43
  • Michael Hampton, Putting files in /static doesn't help. As I said, with official python-2.7 cartridge everything is served via wsgi handler. – RSSCake Feb 26 '15 at 14:50
  • If you wanted to escape from the short comings of the OpenShift mod_wsgi setup, you could always consider doing what is described in blog.dscpl.com.au/2015/01/… This uses mod_wsgi-express and it is trivial to have it also host static files. – Graham Dumpleton Feb 27 '15 at 4:03

Just figured it out by examining the cartridge source. Files in $OPENSHIFT_REPO_DIR/wsgi/static folder are served by Apache directly. Its completely undocumented though, and may break in the future.

  • I think the /static folder is the one you should use. Looking at the linked source, the /wsgi/static folder seems to be an alias for it. – Brecht Machiels Dec 1 '15 at 22:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.