Login

Snippets by h0axify

Snippet List

Apache X-sendfile with permissions checking

This allows the mod_xsendfile module for Apache safely serving private files. Django take cake about processing and permissions checking, Apache server requested files. Installation of mod_xsendfile: $ tar -xzvf mod_xsendfile-0.12.tar.gz $ /usr/sbin/apxs -c mod_xsendfile-0.12/mod_xsendfile.c $ ld -Bshareable -o mod_xsendfile-0.12/mod_xsendfile.so mod_xsendfile-0.12/mod_xsendfile.o Copy mod_xsendfile.so to your local Apache modules folder. Modify httpd.conf to load an enable the module: LoadModule xsendfile_module modules/mod_xsendfile.so Add to virtual host container: <Virtual ...:80> XSendFile On XSendFilePath /home/django_projects/mysite/media/ </Virtual>

  • http
  • media
  • static
  • xsendfile
Read More

h0axify has posted 1 snippet.