X-Sendfile

From TMM Wiki
Revision as of 11:25, 16 January 2009 by Tmmdan (talk | contribs)
Jump to navigationJump to search

Carma has support for X-Sendfile. This allows your web server to serve your content files without having the transmission of the file subject to php timeouts and memory limits. X-Sendfile makes it so your files are sent directly to your users, taken PHP out of the process. Using this feature can greatly improve your servers performance with Carma, especially if you have large amounts of traffic through or have extremely large content files (>= 500MB per file).


Web Server

Setting up and configuring X-Sendfile is different depending on your type of server. Currently there is only X-Sendfile support for Apache and Lighttpd. Please follow the instructions for your server below.

Apache

To use this feature in Apache you have to first install the module [[1]]. Once that module is installed you have to add the following to your .htaccess file or Apache configuration for each site in Carma:

XSendFile On
XSendFileAllowAbove On


Lighttpd

Lighttpd already has support for this feature however it is usually disabled by default. To enable it you will have to set this parameter:

fastcgi.server = ( ".php" => (( ..., "allow-x-send-file" => "enable" )) )


Carma

Once you are sure that X-Sendfile is enabled for your web server you have to set the following Carma configuration variables in your config.php file:

For video support:

$config['USE_XSENDFILE'] = 1;

For image support:

$config['USE_XSENDFILE_IMAGE'] = 1;


If you need assistance setting the configuration options for Carma please put in a [[2]] and a tech will assist you.