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
I hope this will help someone...
I was having this kind of problem: whenever and whatever -> 0 bytes
I solve this moving the
XSendFile On
XSendFilePath /var/1000italy/data/offline
from the virtualHost section
<VirtualHost *:80>
DocumentRoot "/var/{{ app_name }}/web"
ServerName {{ app_name }}.dev
# here was the problem
XSendFile On
XSendFilePath /var/1000italy/data/offline
<Directory "/var/{{ app_name }}/web">
allow from all
Options -Indexes
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/{{ app_name }}_error.log
CustomLog /var/log/apache2/{{ app_name }}_access.log combined
</VirtualHost>
to the directory section
<VirtualHost *:80>
DocumentRoot "/var/{{ app_name }}/web"
ServerName {{ app_name }}.dev
<Directory "/var/{{ app_name }}/web">
allow from all
Options -Indexes
AllowOverride All
# HERE EVERYTHING WORKS FINE
XSendFile On
XSendFilePath /var/1000italy/data/offline
</Directory>
ErrorLog /var/log/apache2/{{ app_name }}_error.log
CustomLog /var/log/apache2/{{ app_name }}_access.log combined
</VirtualHost>
Ciao
If you are getting 0 bytes it could be output compression needs disabled,see here for more. For the XSendFilePath not allowed here error that is a syntax problem with your .htaccess. Check it manually if you can to ensure it is in the right place per the documentation.