Author Topic: How to enable XSendFile for Apache?  (Read 17928 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How to enable XSendFile for Apache?
« on: July 06, 2016, 09:46:36 PM »
Hello,
Please hellp me about this, because I can't find (apache2.conf)
https://support.mfscripts.com/public/kb_view/1/

Quote
It is possible to let Apache handle static file serving via mod_xsendfile. This dramatically increases performance for 'local' and 'direct' file storage, shifting the download process away from PHP and onto Apache.
Installation

On Debian and Ubuntu systems use:

apt-get install libapache2-mod-xsendfile

 
 
Apache Configuration

Configuration of mod_xsendfile for Apache below. As of YetiShare v4.0 this is included in the .htaccess file. If it's not there add it at the top.

<IfModule mod_xsendfile.c>
  <Files *.php>
    XSendFile On
    SetEnv MOD_X_SENDFILE_ENABLED 1
  </Files>
</IfModule>

    XSendFile: enables web server handling of X-Sendfile headers (and therefore file serving) for the specified Directory

 

In your global Apache config (apache2.conf) for the site add this: (replace with your path to YetiShare, restart Apache after)

XSendFilePath /home/path/to/yetishare/install/public_html/

You can find the path to your Apache config file by calling this via SSH:

/usr/sbin/apache2 -V

Note this line in the output:

Server compiled with....<br>-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"

Enable on YetiShare

Login to your admin area, go to 'file servers' navigation, click 'edit' on the relevant file server. Scroll to the 'Improved Downloads' option and select 'XSendFile'.

Possible Issues

When adding the XSendFilePath to apache2.conf you may get a failure on Apache restart like:

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

It is likely that you are using an earlier version of mod_xsendfile which doesn't yet support XSendFilePath. Instead, remove that line from apache2.conf. Add the following to your root .htaccess file:

<IfModule mod_xsendfile.c>
  <Files *.php>
    XSendFile On
    XSendFileAllowAbove On
    SetEnv MOD_X_SENDFILE_ENABLED 1
  </Files>
</IfModule>

Offline
*****
Re: How to enable XSendFile for Apache?
« Reply #1 on: July 28, 2016, 10:03:20 AM »
Hi, apache2.conf is /usr/local/apache/conf/httpd.conf
But I guess you have to recompile your Apache via CWP.Admin -> Apache Rebuild with the module, before.
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
Re: How to enable XSendFile for Apache?
« Reply #2 on: October 10, 2016, 01:37:05 PM »
Hi,
My  'xsendfile_module (shared)' is loaded but not working.
I have this in .htaccess:

<IfModule mod_xsendfile.c>
  <Files *.php>
    XSendFile On
    XSendFileAllowAbove On
    SetEnv MOD_X_SENDFILE_ENABLED 1
  </Files>
</IfModule>

Any ideeas?

Offline
*****
Re: How to enable XSendFile for Apache?
« Reply #3 on: October 12, 2016, 06:08:31 AM »
Hi,

try contact to the support http://centos-webpanel.com/support-services
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services