Missing crucial info in Apache conf (httpd.conf) to serve static files
|Reported by:||rschuon@…||Owned by:||nobody|
|Severity:||Normal||Keywords:||Apache, mod-wsgi, uWSGI, Static, Media|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
To get Apache to be able to serve files statically, the handler (mod-wsgi, or uWSGI) must be disabled for those folders. So, you need another directive under the ones you list, that looks like this:
<Location /static> SetHandler default-handler </Location>
I believe the /static location directive must occur after the / Location directive to turn the handler off correctly.
This allows the request to be caught by Apache rather than uWSGI, and redirected to the static file folder.
Also, the line:
Alias /static/ /usr/local/wsgi/static/
Should actually look like this:
Alias /static /usr/local/wsgi/static/
Without the trailing slash on the alias.
Change History (5)
comment:1 in reply to: ↑ description Changed 4 years ago by msopacua
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset