`
huangro
  • 浏览: 328716 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Debian下在Apache2中安装配置xsendfile模块

阅读更多
至于xsendfile模块的作用就不多说了,反正能较大程度提升文件下载的性能。
以下是我在实际操作过程中总结出的配置步骤:
1.首先,添加xsendfile的源到sources.list中:
deb http://ppa.launchpad.net/damokles/ubuntu hardy main
deb-src http://ppa.launchpad.net/damokles/ubuntu hardy main

保存之后,运行命令:
sudo apt-get update
更新

2. 运行命令:
sudo apt-cache search xsendfile
查找模块, 将会找到以下安装包信息:

libapache2-mod-xsendfile - Module to processes X-SENDFILE headers registered by the original output handler

3. 运行命令:
sudo apt-get install libapache2-mod-xsendfile
安装

4. 在apache中进行文件关联, 执行以下命令:
sudo ln -s /etc/apache2/mods-available/xsendfile.load /etc/apache2/mods-enabled


5. 配置apache中的http.conf文件,添加两行:
XSendFile On
 XSendFileAllowAbove on

当然,如果有多个虚拟主机配置,也可以在sites-available目录下的配置文件中配置中添加以上两行.

然后,就可以使用xsendfile模块了。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics