1
Alias /media/ /home/matt/repos/hello/media
<Directory /home/matt/repos/hello/media>
Options -Indexes
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /home/matt/repos/hello/wsgi/django.wsgi

/media is my directory. When I go to mydomain.com/media/, it says 403 Forbidden. And, the rest of my site doesn't work because all static files are 404s. Why? The page loads. Just not the media folder.

Edit: hello is my project folder. I have tried 777 all my permissions of that folder.

Alex
  • 8,471
  • 26
  • 75
  • 99
  • You also need to check the "execute" permission on all sub-folders all the way up to root to ensure the Apache user is permitted to list the directory contents. Next check your error.log file for the underlying cause. – PP. Mar 24 '10 at 12:50

4 Answers4

1

I solved it. I missed a trailing slash. after media/

Alex
  • 8,471
  • 26
  • 75
  • 99
  • Specifically, it was missing the trailing slash on the file system path. Thus 'Alias /media/ /home/matt/repos/hello/media/'. Read 'http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive' for further examples. – Graham Dumpleton Mar 25 '10 at 22:19
0

It depends how the Aliases are applied, but it could be that all the requests are passed to Django. What do the logs tell you?

Try change the WSGIScriptAlias to e.g.

WSGIScriptAlias /wsgi/ /...

and see what happens.

Dan Andreatta
  • 5,454
  • 2
  • 24
  • 14
0

Try with Options Indexes or Options +Indexes instead of Options -Indexes

From Apache doc

if all the options on the Options directive are preceded by a + or - symbol, the options are merged. Any options preceded by a + are added to the options currently in force, and any options preceded by a - are removed from the options currently in force.

ccheneson
  • 181
  • 5
0

The Options -Indexes directive instructs Apache to not generate directory listings in for that directory. Thus the 403 Forbidden when you try to access /media/. Try Options +Indexes, instead.

goedson
  • 411
  • 2
  • 5