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.
On Debian and Ubuntu systems use:
apt-get install libapache2-mod-xsendfile
yum install ea4-experimentalIn WHM, using EasyApache 4 choose the following modules:
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>
In your global Apache config (apache2.conf) for the site add this: (replace with your path to YetiShare, restart Apache after)
You can find the path to your Apache config file by calling this via SSH:
Note this line in the output:
Server compiled with....<br>-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
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'.
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:
SetEnv MOD_X_SENDFILE_ENABLED 1