I would like to use Django's permission system to serve static media only to authenticated users, similar to this question or this one. Both answers point to a Webfaction forum post which no longer exists. Is there any newer information? Django guides say to do this with the XSendFile module for Apache, which needs to be installed by a server admin or compiled according to those lost directions... Thanks! asked 26 Jan '13, 05:16 tbern |
Here are the instructions to compile mod_xsendfile and install into your existing apache based application. Get the source and unpack it in a temporary src directory.
Compile the source using apxs:
Link the object file:
Copy mod_xsndfile.so to your local Apache modules folder.
Modify your httpd.conf to load the module:
Enable XSendFile and specify the path in your httpd.conf:
answered 26 Jan '13, 12:11 timg ♦♦ Worked like a charm!
(02 Feb '13, 19:03)
tbern
1
Webfaction has removed the apxs script from The basic approach for doing this is at http://docs.webfaction.com/software/home-install.html. Here are the exact steps that worked for me: Got the version number (which for me is 2.2.17) with:
Downloaded the nearest version number I can find (2.2.25) from a mirror site, e.g.:
Made a
Ran configure and make:
I compiled
(13 Aug '13, 18:54)
Arty
In case it helps, I've described here the overall process I went through to serve private files with xsendfile and Django.
(14 Aug '13, 20:15)
Arty
FYI - tbern's instructions are still valid, but you need to add APR to your Apache download first. See http://stackoverflow.com/a/9436971 for more info
(18 Dec '15, 09:31)
pjrobertson
|
A complete walk-through combining all answers above can be found at: https://community.webfaction.com/questions/20487/installing-apache-module-xsendfile-for-django answered 12 Dec '16, 06:45 lspee |