x-sendfile

Capistrano and XSendFile configuration

两盒软妹~` 提交于 2019-12-04 02:35:37
问题 I am trying to configure Rails production server with Apache 2.2, Passenger 4.0.59 and XSendFile 0.12. Application is deployed via Capistrano. Deployed application produces (maybe large) PDF to #{Rails.root}/tmp and serves this file using send_file . The problem is that Capistrano uses symlinks to point to currently deployed version of application. XSendFile on the other hand dereferences symlinks and refuses to serve a file if its real location is outside document root even if it is allowed

HTTP File Download: Monitoring Download Progress

混江龙づ霸主 提交于 2019-12-03 08:38:30
I am in a situation, when I have to implement downloading of large files(up to 4GB) from a Web server: Apache 2.4.4 via HTTP protocol. I have tried several approaches, but the best solution looks to be the usage of X-SendFile module. As I offer progress bar for file uploads, I would need to have the same feature for file downloads. So here are my questions: Is there any way, including workaround, to achieve file downloads progress monitoring? Is there any way, including workaround, to calculate file download transfer speed? Is there better way to provide efficient file downloads from a web

XSendfile not working - PHP, Apache, Cpanel

拥有回忆 提交于 2019-12-02 13:29:59
问题 I have been strongly recommended to use XSendfile since we are serving quite large files from our server. The server is running Cpanel. Previously we were using a straight force-download script, which also did not work well in some browsers. Hoping to kill two birds with one stone with XSendfile. OK so, our host has enabled Xsendfile on our server. I wrote a quick test script: $file = "/home/deli/central/testfile.doc"; header("X-Sendfile: $file"); header("Content-type: application/octet

Capistrano and XSendFile configuration

♀尐吖头ヾ 提交于 2019-12-01 14:24:10
I am trying to configure Rails production server with Apache 2.2, Passenger 4.0.59 and XSendFile 0.12. Application is deployed via Capistrano. Deployed application produces (maybe large) PDF to #{Rails.root}/tmp and serves this file using send_file . The problem is that Capistrano uses symlinks to point to currently deployed version of application. XSendFile on the other hand dereferences symlinks and refuses to serve a file if its real location is outside document root even if it is allowed by XSendFilePath . Apache's error.log states: (20023)The given path was above the root path: xsendfile:

Capistrano & X-Sendfile

微笑、不失礼 提交于 2019-12-01 06:40:43
I'm trying to make X-Sendfile work for serving my heavy attachments with capistrano. I found that X-Sendfile is not working with symlinks. How could I handle the files inside a folder symlinked by Capistrano so? my web server is apache2 + passenger in my production.rb : config.action_dispatch.x_sendfile_header = "X-Sendfile" in my controller action : filename = File.join([Rails.root, "private/videos", @lesson.link_video1 + ".mp4"]) response.headers["X-Sendfile"]= filename send_file filename, :disposition => :inline, :stream => true, :x_sendfile => true render nothing: true my filesystem

Capistrano & X-Sendfile

北城以北 提交于 2019-12-01 04:25:35
问题 I'm trying to make X-Sendfile work for serving my heavy attachments with capistrano. I found that X-Sendfile is not working with symlinks. How could I handle the files inside a folder symlinked by Capistrano so? my web server is apache2 + passenger in my production.rb : config.action_dispatch.x_sendfile_header = "X-Sendfile" in my controller action : filename = File.join([Rails.root, "private/videos", @lesson.link_video1 + ".mp4"]) response.headers["X-Sendfile"]= filename send_file filename,

rails - x-sendfile + temporary files

余生长醉 提交于 2019-12-01 03:48:17
Some time ago I wrote a question regarding the use of temporary files within a rails app. On thar particular case, I decided to use tempfile This causes a problem if I also want to use the x-sendfile directive ( as a parameter in Rails 2, or as a configuration option in Rails 3 ) so that the file sending is handled by my web server directly, not my rails app. So I thought about doing something like this: require 'tempfile' def foo() # creates a temporary file in tmp/ Tempfile.open('prefix', "#{Rails.root}/tmp") do |f| f.print('a temp message') f.flush send_file(f.path, :x_sendfile => true) #

rails - x-sendfile + temporary files

独自空忆成欢 提交于 2019-12-01 00:53:08
问题 Some time ago I wrote a question regarding the use of temporary files within a rails app. On thar particular case, I decided to use tempfile This causes a problem if I also want to use the x-sendfile directive (as a parameter in Rails 2, or as a configuration option in Rails 3) so that the file sending is handled by my web server directly, not my rails app. So I thought about doing something like this: require 'tempfile' def foo() # creates a temporary file in tmp/ Tempfile.open('prefix', "#

mod_xsendfile for Win x64?

强颜欢笑 提交于 2019-11-30 20:55:04
I'm trying to install the mod_xsendfile Apache Module on Windows (7) x64 (using Apache 2.2) -- yes I'm doomed from the get-go, I know :-). Apparently there is : a) No Win x64 binary for mod_xsendfile, just a Win32 binary from the module's website b) No Win x64 binary for apxs from ApacheLounge I've tried the usual LoadModule xsendfile_module modules/mod_xsendfile.so but the semi-obvious error ( httpd: Syntax error on line 127 of C:/Apache/conf/httpd.conf: Cannot load C:/Apache/modules/mod_xsendfile.so into server: The specified module could not be found. ) occurs, it's not Win x64 compatible.

mod_xsendfile with symbolic links

折月煮酒 提交于 2019-11-30 13:45:09
I'm running into an issue using xsendfile with my Rails 3 app. I'm using capistrano to manage deployments and in each release, there is a symbolic link to the shared/assets dir (e.g. /var/www/site/releases/1234/assets => /var/www/site/shared/assets). The problem is that that XSendFile doesn't seem to follow the symbolic links. In my apache logs, I'm seeing the following error: The given path was above the root path: xsendfile: unable to find file: /var/www/site/releases/20110406205607/assets/pdfs/2/original/test.pdf I have the XSendFilePath config set as XSendFilePath /var/www/site/shared