freebsd apache x-sendfile
2010-05-18 文章来源:原创 浏览次数:1381
分享文章
安装X-Sendfile:
cd /usr/ports/www/mod_xsendfile/
make install clean
开启X-Sendfile模块:
vi /usr/local/etc/apache22/httpd.conf
把#LoadModule xsendfile_module libexec/apache22/mod_xsendfile.so的#去掉
在需要开启X-Sendfile的虚拟主机加入
XSendFile on
XSendFileAllowAbove on
重启apache:
apachectl stop
apachectl start
下载测试:
- $src_path = "/home/owner/file.tar.gz";
- header('Pragma: public');
- header('Content-Disposition: attachment; filename=file.tar.gz');
- header('Content-Type: application/octet-stream');
- header("X-Sendfile: {$src_path}");
- ?>

文章评论(查看全部)