Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 765
rswolff Avatar asked Apr 23 '11 00:04

rswolff


2 Answers

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

like image 53
Jared Avatar answered Oct 03 '22 06:10

Jared


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/

like image 25
basszero Avatar answered Oct 03 '22 05:10

basszero