1

I'm new to Django and Apache, so apologies if my terminology is a bit off.

I have a Django app that I'm serving with Apache using mod_wsgi. I used this guide, and just switched to Apache from the Django dev server. In my 000-default.conf file I have this line

WSGIScriptAlias / /home/ubuntu/Projects/myapp/wsgi.py

Everything works fine and the homepage of my app is example.com. However, I find now that there are images (a few tilesets) that I was previously accessing at example.com/tiles which are now not accessible, because they are actually stored at /var/www/html/tiles.

I understand why the paths aren't working, but I'm wondering if there's a way I can keep running the django site from example.com while also serving the tiles from a different directory.

mr.adam
  • 241
  • 2
  • 12

1 Answers1

3

I think if you add a preceding configuration directive:

Alias /tiles /var/www/html/tiles

... it should fix it.

Please note that order of Apache configuration directives may matter. More information about Apache and Alias.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
  • Thanks, that's exactly what I needed. I added that line in the 000-default.conf file, right before the lines that define the wsgi processing. – mr.adam May 12 '15 at 22:09
  • And is covered in mod_wsgi documentation at http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#Hosting_Of_Static_Files For an alternate approach which allows interleaving of files in DocumentRoot and your application, see towards end of section http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive – Graham Dumpleton May 13 '15 at 02:40