Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.
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.

share|improve this question
    
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 Answers 4

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
up vote 1 down vote accepted

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

share|improve this answer
    
Specifically, it was missing the trailing slash on the file system path. Thus 'Alias /media/ /home/matt/repos/hello/media/'. Read 'code.google.com/p/modwsgi/wiki/…; for further examples. –  Graham Dumpleton Mar 25 '10 at 22:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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