Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:cloudlinux:disable-xsendfile-in-redmine [2018/06/26 08:29]
Tihomir created
litespeed_wiki:cloudlinux:disable-xsendfile-in-redmine [2018/06/28 07:57]
Tihomir [Potential problem]
Line 1: Line 1:
 ==== Potential problem ==== ==== Potential problem ====
  
-By default LiteSpeed support **X-Sendfile** or **X-Accel-Redirect** internal redirects for Ruby on Rails but for shared hosting environment that can trigger problems like the fact that the user will not have permissions to access the redmine directory.+By default LiteSpeed support **X-Sendfile** internal redirects for Ruby on Rails but for shared hosting environment that can trigger problems like the fact that the user will not have permissions to access the redmine directory.
  
  
 ==== Solution ==== ==== Solution ====
  
-First you will need to edit the file:+Go to you redmine folder and put that in the **.htaccess** ​file:
  
-<​code> ​/​usr/​local/​lsws/​fcgi-bin/​RackRunner.rb ​</​code>​+<​code> ​SetEnv RACK_NO_XSENDFILE 1 </​code>​
  
-Find this line: 
- 
-<​code>​ if body.respond_to?​(:​to_path) </​code>​ 
- 
-and change it to: 
- 
-<​code>​ 
-if body.respond_to?​(:​to_path) and env["​RACK_NO_XSENDFILE"​] != "​1"​ 
-                         ​headers['​X-LiteSpeed-Location'​] = body.to_path 
-                         #​headers['​Content-Length'​] = '​0'​ 
-                         ​headers.delete('​Content-Length'​) #Correct? 
-</​code>​ 
- 
-That way you can control **X-Sendfile** setting via **.htaccess** file. Go to you redmine folder and put that in the **.htaccess** file: 
- 
-<​code>​ SetEnv RACK_NO_XSENDFILE 1 </​code>​ 
  
 ==== Additionally information ==== ==== Additionally information ====
  
 This is an example for redmine but you can use that in any Ruby on Rails application. This is an example for redmine but you can use that in any Ruby on Rails application.
  • Admin
  • Last modified: 2018/06/28 14:17
  • by Lisa Clarke