The X-sendfile of Apache

Source: Internet
Author: User
Tags sendfile

Online search for an afternoon to find how to configure Apache X-sendfile.

First of all, it is said that only Apache 2.x supports this feature. Next Linux support for this feature requires kernel support. Generally now 2.6 of the inside



The cores are supported, as if they were to be supported by the 2.2 kernel at the earliest.

Test environment:

System: Windows XP

Apache version:

2.11

Secondary script:

PHP 5.2.6

Configuration steps:

1. Download module file

Download in http://www.apachelounge.com/download/



A compiled X-sendfile module in Windows Mod_xsendfile-0.9-w32.zip. Move the file mod_xsendfile.so to the Apache/modules directory after decompression.

2. Configure the Apache configuration file

Configure the following to the configuration file

# load X-sendfile Module

LoadModule xsendfile_module modules/mod_xsendfile.so

Xsendfile on

Xsendfileallowabove on

3. Invoke X-sendfile using PHP

Instance code:

<?php header (' Content-type:application/octetstream '); Header (' content-disposition:attachment; filename= "1.exe"); Header (' X-sendfile:d:/webdocs/zendstudio.exe '); Exit

Reference documents:

Http://blog.sina.com.cn/s/blog_549212ae010086s9.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.