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模块了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值