How do I enable downloading using X-sendfile in rails3 from a directory other than the public directory?
Asked Answered
L

2

5

I have enabled the XSendFile module in Apache 2 running on Ubuntu 10.04. I have added the XSendFile on directive and restarted the Apache server successfully. When I add the XSendFilePath /path/to/dir directive and restart Apache I get the following error:

Invalid command 'XSendFilePath', perhaps misspelled or defined by a module not included in the server configuration

Not sure what I'm doing wrong?

Lazurite answered 23/4, 2011 at 0:5 Comment(0)
G
7

On 10.04 Lucid, the version of XSendFile installed by apt by default is 0.9.2:

http://packages.ubuntu.com/lucid/libapache2-mod-xsendfile

The directive XSendFilePath replaced XSendFileAllowAbove in version 0.1.0, so for 0.9.2:

https://tn123.org/mod_xsendfile/

Try using XSendFileAllowAbove if you're on anything less than 0.1.0

Gemmell answered 16/9, 2011 at 21:53 Comment(0)
M
3

Do you have the x-sendfile module installed and enabled in apache? Run "apachectl -M" to see a list of all of modules. You may have to build it, see https://tn123.org/mod_xsendfile/

Micah answered 10/5, 2011 at 22:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.